1

How can I be informed when a new version of a specific package is available for install? Is there a way to have apt-get skip a specific version, but install when the next one is available?

I am running Raspbian on a Raspberry Pi 3, and have determined that the current version of a particular package breaks my set up. I reverted to a backed up image and then used apt-mark hold to prevent that package from being updated as I continue to apt-get update and apt-get upgrade to maintain all other packages on the device.

I see that apt-cache show gives me specific version information about the package that I put on hold, but I can't tell if it is giving me information on the version that is already installed or the version that is available to be installed, but not yet installed. How can I see what version is installed and what is available to be installed?

Aside from getting this information, ideally, is there a way for apt-mark to only hold a specific version, but allow the next one to go? (I'm assuming that my issue will be resolved in the next version.)

Note, I have specifically not mentioned what package I'm having a problem with because I'm not trying (in this question) to troubleshoot that specific issue, but rather learn tools to manage similar issues in the future.

2 Answers 2

2

You could do so using package pinning. Create a file in /etc/apt/preferences.d:

Package: package-name
Pin: version 1:2.3.4.5-6
Pin-Priority: 450

This will set the priority of a particular package version below 500 (which AFAIK is the default value), so that this particular version will not be installed unless no other version is available. A future version will have the default priority and should be picked up during updates.

As you have already found out, apt-cache policy package-name will tell you which package versions are available. It will also display the priorities you have set by pinning.

1

I've found apt-cache policy [package name] to give me the version number of the currently installed version and the version number of the version available to install.

Not a complete answer to my question, but a simple, convenient way to get the information I was looking for.

1
  • Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    Commented Feb 26, 2020 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.