Score:6

Held package still shows as upgradable

bq flag

I have an Ubuntu 20.04 Server for an application that still needs a specific ancient java version (8u252-b09). Anything 271 and later breaks the app.

I used apt-mark to hold the package:

$ sudo apt-mark showhold
openjdk-8-jre-headless

But when I check for new packages, it still shows as upgradable:

$ sudo apt update
...
$ sudo apt list --upgradable
Listing... Done
openjdk-8-jre-headless/focal-updates,focal-security 8u352...

If seems like if I run apt upgrade now it will upgrade to the new package and break the application.

I'm stuck in a tough place: I must update the server (there is another pending important security update), but I cannot break the application. I know I could also manually update other available packages one at a time, but that will be tedious over the life of the server, as well as likely someone eventually makes a mistake and just does a basic apt upgrade.

How can I be sure this package won't upgrade?

Score:6
cn flag

Packages which are held back are listed by apt list --upgradable when a newer version is available.

These packages are not going to be ugraded during apt upgrade since they are marked as held back. The meaning of marking a package as hold is to prevent installing, removing or upgrading a package automatically. See man apt-mark:

PREVENT CHANGES FOR A PACKAGE
       hold
           hold is used to mark a package as held back, which will prevent the package from
           being automatically installed, upgraded or removed.

If you feel unsure about that, you can run the upgrade command with the -s or --simulate option:

apt upgrade -s

will show you that the held back package is not going to be upgraded.

Levente avatar
cn flag
I would like to offer an observation: when one uses the GUI, held packages will also show up in the Updater's dialog popup, but, while other packages will have their checkbox automatically checked initially, held packages will not have the checkmark automatically, meaning, they wouldn't get updated. This seems to completely correspond with what you described.
bq flag
`apt upgrade -s` is what I was looking for, thank you.
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.