Ubuntu – How to upgrade Ubuntu release while keeping versions of already installed packages

upgrade

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?

UPDATE 1:

  • 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.

Best Answer

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

Related Question