Just a thought

Package installation after re/new install (Ubuntu)

Posted by stringofthoughts on April 29, 2009

Re installation is a headache but what’s more painful is the package installation all over again. You had a lot of softwares installed in your system and now you have to do it all over again. Funny thing is sometimes it’s hard to remember all the softwares. I did this after my every new and re-install and it’s very time consuming and more frustrating. But, with Linux you learn new things everyday, which is why Linux is so much fun to use. I recently learned that I could avoid all this by a few simple commands :).

$ sudo dpkg –get-selections > myPackages

This will make a list of all the installed package in your system and store it in a file. Nice 🙂 now we ‘ve a complete list of packages that we’d need after say re-install.

Re-install the system and use this command to get everything back the way it was without wasting any time and getting frustrated.  (Make sure you keep myPackages in some other drive before re-installation :P)

$ sudo dpkg –set-selections < myPackages && sudo apt-get dselect-upgrade

This takes the packages from list and installs just like it was before re-install.

See how easy things are in Linux when you know exactly how to use it.


2 Responses to “Package installation after re/new install (Ubuntu)”

  1. Nepomuk said

    Nice tip! I’ll have to remember that one for the next time I reinstall Xubuntu! 🙂


  2. Bob said

    Hello and really like your website, just starting to explore it. I tried to save my packages with the dpkg command under your Package installation after re/new install (Ubuntu), and got the following error. I am using Ubuntu 10.04 Lucid.

    clark@clark-office:~$ sudo dpkg –get-selections > myPackages
    dpkg: need an action option

    Type dpkg –help for help about installing and deinstalling packages [*];
    Use `dselect’ or `aptitude’ for user-friendly package management;
    Type dpkg -Dhelp for a list of dpkg debug flag values;
    Type dpkg –force-help for a list of forcing options;
    Type dpkg-deb –help for help about manipulating *.deb files;
    Type dpkg –license for copyright license and lack of warranty (GNU GPL) [*].

    Options marked [*] produce a lot of output – pipe it through `less’ or `more’ !

    I really like the brevity of your process for saving packages and reinstalling them, just what I’ve been looking for.
    Thank you,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: