Desktop Environment (if applicable):
<none - server installation →
Problem Description:
Terminal upgrade of a ubuntu 22.04 to 24.04
After upgrade the error
“Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings”
appears and pinging, update etc does not work.
connection via ssh works.
ssh works, so the VM’s NIC and IP are fine; what’s missing is DNS.
After the jump to 24.04 the old /etc/resolv.conf symlink often points at
now-vanished files, so everything that needs a hostname (ping, apt, the
update manager) fails while raw IP traffic still works.
Quick check
ping 1.1.1.1 # ← this should work
ping ubuntu.com # ← this will time out
ls -l /etc/resolv.conf
If resolv.conf is not a symlink to /run/systemd/resolve/resolv.conf
(or is an empty file) you’ve found the culprit.
How exactly did you do the upgrade from 22.04 to 24.04, the whole transition from resolvconf (which is obsoltete since many years now) to systemd-resolved should be handled by do-release-upgrade properly … i.e. resolvconf should be completely removed, systemd-resolved should be installed and started and said symlink should be put in place automatically …
The behavior you see clearly indicates either a bug in the upgrader (but then many more people would have complained about it by now) or some non-standard steps in your upgrade process …
The fix vanished because something is still re-creating the old /etc/resolv.conf at every boot. That “something” is almost always the legacy resolvconf package, which 24.04 no longer uses.
Get rid of it once and the symlink will stay put.
# 1 – see if resolvconf is still around
dpkg -l resolvconf
# 2 – if it shows “ii” (installed), purge it
sudo apt purge resolvconf
# 3 – make sure the modern resolver is enabled
sudo systemctl enable --now systemd-resolved
# 4 – put the permanent symlink back
sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
Reboot. /etc/resolv.conf should still point at /run/systemd/resolve/resolv.conf, DNS works, and the upgrader’s
meta-release check stops complaining.
Why did this happen at all?
A standard do-release-upgrade removes resolvconf and switches you
to systemd-resolved automatically.
If resolvconf was held back, manually re-installed, or the upgrade
was done with custom scripts, it can sneak back in and overwrite /etc/resolv.conf on each boot.
Purging the package (or fixing whatever re-installs it) makes the fix
stick for good.
some packages were hold back: This is not a problem eventually they will be upgraded so you do not need to make anything else for now just make sure you are doing updates consistently.