Importing gpg keys only works with dhcpcd, and not NetworkManager

I have been having trouble importing keys for a while now. I usually get the error

    gpg: keyserver receive failed: Server indicated a failure

I tried changing keyserver, I played with firewall settings, and changed DNS settings to no avail. I only have problems with gpg, no other networking problems whatsoever.

Eventually I found that changing to dhcpcd over NetworkManager fixes the issue. This is however not a complete solution since dhcpcd fails to set up my wired connection on boot, and enabling NetworkManager is the only way I have found to start my connection. Once wired connection is set up, disabling NetworkManager and enabling dhcpcd works without problem.

If possible, I would like to diagnose why gpg doesn’t work with NetworkManager, and failing that I would like to be able to fix my issue with dhcpcd failing to setup wired connection on boot.

Probably a baseless speculation of mine, but maybe check the IPv6 on NetworkManager Settings for your connections and disable it …

Hi @Tilpo,

I spent most of my afternoon researching this. (Yeah, a weird one, I know. But what can I say?) I only found this page on the Archwiki.

In the section for DHCP client, there is a warning:

Do not enable the systemd units shipped with the dhclient and dhcpcd packages. They will conflict with NetworkManager, see the note in #Installation for details.

In the same section, it describes how to use dhcpcd and NetworkManager together:

DHCP client

By default NetworkManager uses its internal DHCP client. The internal DHCPv4 plugin is based on the nettools’ n-dhcp4 library, while the internal DHCPv6 plugin is made from code based on systemd-networkd.

To use a different DHCP client install one of the alternatives:

To change the DHCP client backend, set the option main.dhcp=_dhcp_client_name_ with a configuration file in /etc/NetworkManager/conf.d/. E.g.:

/etc/NetworkManager/conf.d/dhcp-client.conf:

[main]
dhcp=dhclient

So you could always try that and see if that helps. It might not be ideal, but if it works it is a workable workaround that can work.

Hope this helps!

That did the trick, it seems! Thanks a lot.

Now some part of the system seems to be confused. Upon boot it takes about a minute to set up internet access, after the OS gets stuck on Setting network address, and Plasma gives periodic notifications that it failed doing so; see attached two screenshots. After a while it switches to network enp34s0 instead of Wired connection 1 and stops complaining. Any ideas how to fix this?

Screenshot_20220828_161425
Screenshot_20220828_161451

Absolutely nuffink, sorry.

:man_shrugging:

:sob:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.