Score:3

Can I rollback an aborted Jammy dist upgrade?

lc flag

I killed the do-release-upgrade before everything downloaded. I'm running ok, but for now I can only go forward with the release upgrade. I can't get any focal updates. I would like to wait a bit longer before release upgrade but still take focal security updates.

: uname -a
Linux rita 5.4.0-148-generic #165-Ubuntu SMP Tue Apr 18 08:53:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux


: cat /etc/os-release | grep -i version
VERSION="20.04.6 LTS (Focal Fossa)"
VERSION_ID="20.04"
VERSION_CODENAME=focal

: cat /etc/apt/sources.list|grep -v '^#'

deb http://us.archive.ubuntu.com/ubuntu/ jammy main restricted
deb http://us.archive.ubuntu.com/ubuntu/ jammy universe
deb http://us.archive.ubuntu.com/ubuntu/ jammy multiverse

I have a borg backup of my system 1 day before I started the update and then changed my mind a few minutes later.

Can I go back (without too much pain) or must I go forward?

Score:5
bo flag

Your best bet at this point would be to run the following command to change your sources list back to focal:

First, run the following command to test the edit (this will print an edited version of the file in the terminal):

sudo sed -e 's/jammy/focal/g' /etc/apt/sources.list

If everything looks good and all your sources say focal, then use the following command to apply the edit:

sudo sed -i 's/jammy/focal/g' /etc/apt/sources.list

Then, run

sudo apt clean
sudo apt update
sudo apt upgrade

and see what it says.

Unless you have some PPAs that also need to be edited, this should fix the issue.

If you run into problems with software version numbers and other errors, then you might need to proceed with the installation of the upgrade to Jammy or, alternatively, use your backup instead (using your backup would probably be ideal if my method fails).

As far as your backup is concerned, I'm not familiar with that type so you would need to be advised by someone else on that or possibly ask a separate question that focuses on restoring your backup instead.

user535733 avatar
cn flag
+1: Concise, straightforward, safe, and what to do if it doesn't work. A terrific answer.
cepstralspike avatar
lc flag
I checked the PPA list with this: [askubuntu.com post](https://askubuntu.com/questions/148932/how-can-i-get-a-list-of-all-repositories-and-ppas-from-the-command-line-into-an) I had some PPAs but none that needed editing. Looks like all is well.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.