Skip to content

Instantly share code, notes, and snippets.

@catchsudheera
Created December 31, 2024 12:00
Show Gist options
  • Save catchsudheera/68bcb4747e7e4127cd1162112791c99e to your computer and use it in GitHub Desktop.
Save catchsudheera/68bcb4747e7e4127cd1162112791c99e to your computer and use it in GitHub Desktop.
Upgrade ubuntu server from EOL version "Lunar" to latest
sudo sed -i 's|http://ports.ubuntu.com/ubuntu-ports|http://old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list
sudo apt update && sudo apt upgrade -y
sudo sed -i 's|lunar|mantic|g' /etc/apt/sources.list
sudo apt update && sudo apt upgrade -y
# Had to fix the installs for libc6
sudo apt --fix-broken install
sudo apt dist-upgrade
# use `cat /etc/os-release` to ensure you have upgraded to mantic at this point
# reboot the system
sudo do-release-upgrade
@satsen
Copy link

satsen commented Jan 8, 2025

Thanks. In my case the sources.list contained mirror://mirrors.ubuntu.com/mirrors.txt, so I replaced that with https://old-releases.ubuntu.com/ubuntu and it worked.

@catchsudheera
Copy link
Author

That works to update the apt cache but dist-upgrade might still not work.

@satsen
Copy link

satsen commented Jan 8, 2025

It worked for me

@supratimdeka1
Copy link

Worked perfectly for my lunar VM. Thanks for posting!

@kmi3c
Copy link

kmi3c commented Feb 25, 2025

Worked like a charm. Thank You very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment