Hanno’s Coding Log: software development, geek stuff

Keeping packages on Ubuntu fresh install

I am about to test migrating my Ubuntu installation to 64bit. I’ll test compatibility with my used applications first in a VM.

For that I installed Ubuntu 8.10 64bit Desktop edition into the VM. Since I don’t want to manually reinstall all packages by hand, I came up with the following aptitude / dpkg commands after reading a few other instructions:

On the source system, execute:

sudo aptitude search '~i !~M' -F '%p install' > packages-list

This will generate a list of all manually installed packages in packages-list. (All packages not installed as a dependency of another package.)

On the destination system execute:

sudo dpkg --set-selections < packages-list
sudo apt-get update && sudo apt-get dselect-upgrade

This will install all the packages from the list. (and apt will take care of resolving dependencies)

That’s it. If you have already used a different method and want to fix things, read on:

If you just used a method involving dpkg --get-selections on the source system, you lost all information about automatically installed packages.

You can generate a list of all automatically installed packages on your source system:

sudo aptitude search ~M -F %p > autoremove-packages-list

and get the information into your destination system with:

sudo aptitude markauto `cat autoremove-packages-list`

Note that autoremove-packages-list is a filename.

  • Digg
  • del.icio.us
  • MisterWong
  • Technorati
  • StumbleUpon
  • Yigg

Related posts

You can follow any responses to this entry through the RSS 2.0 feed.

Stoppt die Vorratsdatenspeicherung! Jetzt klicken & handeln!Willst du auch bei der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien: