A dpkg trick for fresh installations

After every fresh install, I used to download all the necessary packages that I had in the previous installation. This was definitely not easy, I could hardly remember half of them and it used to take a lot of time. But by using using dpkg we can do it in a few commands. Chk it out.

Before doing a fresh install, run this command to save a list of all package selections. This is a list of the packages that you had in your previous system.

[shredder12]$ sudo dpkg --get-selections > packages.list

Now, in the freshly installed system run this command to replicate all the packages that you had in ur previous installation.

[shredder12]$ sudo dpkg --set-selections < packages.list  &&  sudo apt-get dselect-upgrade

2 Comments

ATOzTOA (not verified)
December 28th, 2009 06:14 pm

This will only work if you are installing fresh... else it will remove any packages which are already installed but not in the backup list...

Anon Linuxer (not verified)
December 29th, 2009 01:35 pm
Another alternative: use AptOnCd.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <p> <br>
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Search Engines will index and follow ONLY links to allowed domains.

More information about formatting options

Mollom CAPTCHA (play audio CAPTCHA)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.