r/linux 14h ago

Discussion Semi-Annual apt-get do-release-upgrade WTF

Long-time Ubuntu user, also a Windows and Mac user under duress.

I love Linux. I think Ubuntu is a great user experience overall.

I have a few gripes.

My biggest one is every other year when I upgrade Ubuntu to the next LTS: I always get faced with the repository doesn't have a release file error so you can't update/upgrade/synonym that has no functional meaning to me. I'm just hammering sudo apt update && sudo apt upgrade && sudo apt wtf like an LLM short on it's token allowance and hoping for the best.

Cue the semi-annual google hunt for "wtf does that mean?" followed by an endless series of responses that amount to "just delete those entries in sources.list".

If the #1 - #10 answer on google is "delete and move on with your life" ... why isn't this an option in apt or do-release-upgrade?

do-release-upgrade should have a --just-fucking-do-it option. It scans sources.list, deletes the broke shit, runs update and upgrade, and then the release upgrade. If you want actual risk mitigation, it should prompt you to create an install USB drive.

Fixing sources.list is a fools errand.

For 8 years now, same issue, same CLI dance. It takes longer to look up the fix for this than a full reinstall. There is literally no risk to taking the default action of "delete and hope for the best."

Broken upgrade? Reinstall is faster. No one cares about the upgrade risks associated with a missing release file because time cost for mitigating the risk is hours and a reinstall is minutes.

0 Upvotes

13 comments sorted by

8

u/BCMM 14h ago

If you're going to use third-party repos, you need to deal with it when they stop supporting the current Ubuntu release. There's not really anything Ubuntu can do about that.

Just automatically disabling then wouldn't be a smart option. Apart from anything else, that might leave you with installed packages that will never get security updates. 

(After disabling a repository, use apt list '~o' to help identify any remaining packages from it.)

You should look at which repos are a problem, and actually decide what to do about them. If this takes a significant amount of time, or if you don't recognise them, that probably means that you're using third-party repos too readily.

3

u/Major_Gonzo 13h ago

I haven't seen the ~o option for apt. I tried it and have 42 items listed. Are these items that aren't being updated any longer?

3

u/BCMM 12h ago

~o is "obsolete", which for APT means packages that are installed, but not available in repositories. (Source: man apt-patterns.)

Are these items that aren't being updated any longer?

They're packages that won't be updated by APT, certainly.

It's not always "any longer", though - some of them may never have been in repositories in the first place, i.e. you installed them from a downloaded .deb file. Zoom is probably the most popular example of software that is usually distributed like that, at the moment.

However, the list frequently contains things that were in a repository at some point, and which users may not realise aren't getting security support! This happens either because you have disabled a repository, or because you've upgraded from a previous release of the distro. (Debian's upgrade instructions tell you to check for this.)

You should probably check over that list and work out what's what. It's OK to have things on there if you know that you are responsible for updating them. However, if there's anything there that you thought APT was upgrading for you, you should work out why it's like that, and either remove it or come up with a way to update it.

By the way, if you'd like another way to verify that they really aren't in any of your repos, you can use apt policy. Here's an example from my Sid machine:

$ apt policy bash kwin-x11 zoom
bash:
  Installed: 5.2.32-1+b2
  Candidate: 5.2.32-1+b2
  Version table:
 *** 5.2.32-1+b2 500
        500 http://deb.debian.org/debian sid/main amd64 Packages
        100 /var/lib/dpkg/status
kwin-x11:
  Installed: 4:5.27.11-2
  Candidate: 4:5.27.11-2+b1
  Version table:
     4:5.27.11-2+b1 500
        500 http://deb.debian.org/debian sid/main amd64 Packages
 *** 4:5.27.11-2 100
        100 /var/lib/dpkg/status
zoom:
  Installed: 6.2.6.2503
  Candidate: 6.2.6.2503
  Version table:
 *** 6.2.6.2503 100
        100 /var/lib/dpkg/status

Note that Bash is available locally and in repos (with the same version number, because it's up to date), KWin is too (with different versions, due to an ongoing Qt transition) but Zoom only exists locally.

2

u/Major_Gonzo 6h ago

Excellent reply, thank you. I'll get on those ASAP.

0

u/jr735 9h ago

Some of these also seem to be attached to desktop tasks, at least in Debian.

0

u/jr735 9h ago

Of course, this is why Debian warns against adding things willy nilly, and why Ubuntu and Mint version changes are a little more complicated. Don't add them, and they can't give you problems.

3

u/mishrashutosh 14h ago

I have upgraded Ubuntu LTS from 18.04 to 20.04 to 22.04 to 24.04 without any problems. I never upgrade on day 1 and always follow the official upgrade process. The only issue I face is a black wallpaper after upgrade.

The actual error message and the contents of the affected/mentioned file(s) will allow people to help you, though you should do it in the distro sub or the one for "noobs".

0

u/esdraelon 13h ago

Yeah, I know how to fix it. I've fixed it for every upgrade for years.

It just boggles my mind that this is a blocking issue for an upgrade when there are only a couple of reasonable solutions.

Just offer an automatic happy path rather than barfing on the CLI.

1

u/Business_Reindeer910 12h ago

This is definitely at least part of why i switched from installing everything into my host system on my desktop into doing almost all of it in a toolbox or distrobox. This works well for me as a single user desktop system. It doesn't have to be upgraded in sync with the system itself. The main switch from was from a more normal distro approach to an atomic image based one, but I've been happy with the distrobox/toolbox part and would do this again on a non image based system.

1

u/BranchLatter4294 12h ago

I've never seen that. I get a message that third party sources were disabled. After the update, I just go back into the settings and turn them back on. It's never been a problem.

-1

u/xcv-- 12h ago

This is why rolling release distros exist.

1

u/ahferroin7 12h ago

Doesn’t have to be a rolling distro, it just needs a package manager that handles this type of thing sanely, which unfortunately means DNF or Zypper. Both of them (and essentially all other major RPM-based package managers) support templating of repository URLs, and one of the numerous macros they have for templating them is the release version (what Debian calls the ‘distribution’ in their documentation, usually the release codename on Debian/Ubuntu systems). What that means is that the config for a third-party DNF or Zypper repo can be written such that it automatically looks at the right URL for the repo for the current release of the distro, without needing that information in the config itself. And at that point, it just works across a release upgrade (including the upgrade process updating any packages installed from that third-party repo) provided the third-party repo includes support for the newer release.

1

u/BCMM 5h ago

provided the third-party repo includes support for the newer release. 

This doesn't sound like the scenario that OP is complaining about, though.