Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have Debian stable disribution installed on my computer. Once I installed some packages from testing but now it causes some troubles so I would like to downgrade them. I've tried next commands:

apt-get --reinstall install  `apt-show-versions | grep newer | cut -d ' ' -f 1 | tr '\n' ' '`

this doesn't work because apt tries to retrieve the same versions of packages and complains that it can't download them because I now have no sources for testing packages in sources.list

apt-get -t squeeze  install  `apt-show-versions | grep newer | cut -d ' ' -f 1 | tr '\n' ' '`

doesn't work either. Writes that the newest versions of packages have already installed. I thought -t sqeeze forces apt to install packages from stable.

Anyway how can I solve this task?

share|improve this question
    
wouldn't it work if you add the testing sources to sources.list again, purge the testing applications, remove the sources and install again? –  wullxz Aug 9 '12 at 11:13

1 Answer 1

As @wullxz said. You can do that by purging the new packages, removing or commenting out the unstable repo from the sources list, installing the old packages then, uncomment or add the unstable repo again to sources.list if you want to use some other packages from it.

  • Purge new package:

sudo apt-get purge my-package

  • Edit sources.list and comment out the testing repo:

sudo nano /etc/apt/sources.list

  • Install old stable package again:

sudo apt-get update

sudo apt-get install my-package

  • (Optional) Use the testing repo again (as aforementioned) if u need to and, lock the version for that particular package temporarily:

# uncomment the testing repo from sources.list

sudo nano /etc/apt/sources.list

# Lock the current version of the package.

echo "my-package hold" | dpkg --set-selections

  • If you would like to remove the lock and install the testing package again:

echo "my-package install" | dpkg --set-selections

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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