This problem arose when I upgraded to 24.04 prior to the 8/29/2024 .1 release: The upgrade broke the internet connection. This is the bug:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/2055012
Here is the link from this forum:
Internet is not working after upgrading to ubuntu 24.04
My problem is that the fix, as described, is not clear to me (as follows):
/etc/resolv.confbecame a broken link, along withsystemd-resolve.service. I needed to remove both of them and write a newresolv.confto fix the error.
I assumed that the broken link is the symbolic link in /etc. Initially I though it should point to resolv.conf instead of stub-resolve.conf So I set the symbolic link at /etc/resolv.conf to /etc/run/systemd/resolve/resolv.conf.
I used nautilus Wired Settings manager (IPv4) to write nameserver 8.8.8.8 into the file /etc/run/systemd/resolve/resolv.conf then used nano to check nameserver 8.8.8.8 is in the file and stayed there after rebooting the PC (or reinserting it after rebooting the PC).
I tried writing (as "nameserver") our local DCHP compliant DNS IP address, this did not work either.
In "Wired settings" IPv4 method is "Automatic (DCHP)".
For "removing systemd-resolve.service", I followed this:
https://www.turek.dev/posts/disable-systemd-resolved-cleanly/
and set dnsstublistener=no
I rebooted PC sporadically.
There is no file resolv.conf.old to restore.
UPDATE:
In order to replace the symlink with the real file (resolv.conf), in /etc, I tried:
sudo mv resolv.conf xxx.xxx
then
cp /run/systemd/resolve/resolv.conf resolv.conf
UPDATE 2:
The contents of the file did not change after copying it (I did check):
nameserver [my local DNS address]
search .
then
ping -n 8.8.8.8
"Network is unreachable".
Ping -n google.com
"Temporary failure in name resolution"
then, in /etc:
ls-l resolv.conf
-rw-r--r-- 1 root root 790 Sep 8 18:34 resolv.conf
My Netplan status is "Offline".
resolvectl status says:
Global
Protocols: -LLMNR -mDNA -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: foreign
Current DNS server: [IP of my DNS server]
DNS servers: [Same IP as above]
Link2 (enp0s31f6)
Current Scopes: none
Protocols: DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
DNS Servers [same IP as above]
I have spent several hours and failed thus far. Any good advice much appreciated: If I can get the internet back (as others have clearly been able to do), then I can reinstall systemd-resolved and apply the 24.04 bug fixes. Many thanks for the good advice so far.
Paul
UPDATE 3:
nmcli -p device show
===============================================================================
Device details (lo)
===============================================================================
GENERAL.DEVICE: lo
-------------------------------------------------------------------------------
GENERAL.TYPE: loopback
-------------------------------------------------------------------------------
GENERAL.HWADDR: 00:00:00:00:00:00
-------------------------------------------------------------------------------
GENERAL.MTU: 65536
-------------------------------------------------------------------------------
GENERAL.STATE: 100 (connected (externally))
-------------------------------------------------------------------------------
GENERAL.CONNECTION: lo
-------------------------------------------------------------------------------
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/136
-------------------------------------------------------------------------------
IP4.ADDRESS[1]: 127.0.0.1/8
IP4.GATEWAY: --
-------------------------------------------------------------------------------
IP6.ADDRESS[1]: ::1/128
IP6.GATEWAY: --
-------------------------------------------------------------------------------
===============================================================================
Device details (enp0s31f6)
===============================================================================
GENERAL.DEVICE: enp0s31f6
-------------------------------------------------------------------------------
GENERAL.TYPE: ethernet
-------------------------------------------------------------------------------
GENERAL.HWADDR: C0:25:A5:88:93:F8
-------------------------------------------------------------------------------
GENERAL.MTU: 1500
-------------------------------------------------------------------------------
GENERAL.STATE: 30 (disconnected)
-------------------------------------------------------------------------------
GENERAL.CONNECTION: --
-------------------------------------------------------------------------------
GENERAL.CON-PATH: --
-------------------------------------------------------------------------------
WIRED-PROPERTIES.CARRIER: on
-------------------------------------------------------------------------------
IP4.GATEWAY: --
-------------------------------------------------------------------------------
IP6.GATEWAY: --
-------------------------------------------------------------------------------