Given that APT has the power of the super COW and this should be amazing.

There's a simple, elegant and working way (because I tried with pin solutions proposed as well as the preferences file, and they don't work) to tell, hey check all the sources.list repositories, then if I have any packages that are ABOVE the maximum version available from the sources.list rollback the installation up to that version?

A perfect fitting example is that I found that the Ubuntu 14.04 LTS cd installer AUTO enables the backports repository, something that I really don't want. However doing so I already found the machine after a first fresh installation with kernel 3.19 when the default for Ubuntu 14.04 LTS is the 3.04.

For this reason I enabled only Ubuntu main and Ubuntu security and I would gladly remove/rollback all the backports packages back to what it was without backports repository.

How can I do this if is true that APT has the power of the super cow?

1 Answer 1


You don't tell how you tried pinning and how it failed, but the solution is pinning indeed. If you've already removed all sources you aren't interested in, create /etc/apt/preferences.d/back.pref with the following contents:

Package: *
Pin: release o=*
Pin-Priority: 1001

After this, apt-get dist-upgrade will up/downgrade all packages to your current sources.

If it doesn't work out, check the output of apt-cache policy and apt-cache policy OFFENDING-PACKAGE for hints.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .