Sometimes it's important to keep current versions of already installed packages when upgrading Ubuntu release, let's say, from 12.04 to 14.04.

I don't emphasize if it's server or desktop assuming this procedure should be same.

Standard release upgrade steps are:

  1. sudo apt-get update
  2. sudo do-release-upgrade

But this will upgrade packages as well. Is there a way to keep versions of already installed packages?


  • I will perform release upgrades remotely, so I will a need command line solution. It's possible to check versions using dpkg, apt-cache policy (and maybe with aptitude, haven't tried yet).

  • I won't have any packages in remote computer's repository. I will just need to specify what versions I need and it will download that required packages.

I feel like I will need to write a custom script to solve this issue, but it doesn't seem the best way - packages will be upgrading along with a release upgrade and then I will downgrade them. It'd be nice if I were able to install/keep required version during a release upgrade process.

  • Have you looked at the Synaptic Package Manager? Will that not do what you require? – User24601 Mar 3 '15 at 9:00
  • Hi. I will update my post later today. I'm looking for command line solution. – Askar Mar 3 '15 at 9:28
  • Do you try to keep the packages (eg. the deb-files) or are trying to keep the binaries installed and have them available to run them side-by-side with the new version? – MadMike Mar 3 '15 at 9:36
  • @MadMike I have updated my post. – Askar Mar 3 '15 at 11:01
  • 1
    You can mark packages to hold, Similar question here I don't know how well the upgrade will go if you hold a key package. – squareborg Mar 3 '15 at 11:09

you would be best downloading the packages and saving them to a USB or CD/DVD Rom for install at a later date.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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