how to save a list of installed packages and install these packages later
UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how to save a list of installed packages and install these packages later
i screwed my system by changing file permissions recursively from the root folder and want to install ubuntu new now - without all the work of going through the package list and pick all the useful packages again.
i found out that i can get a list with 'dpkg -l' but failed when i wanted to store that in a file - nor do i know how to tell dpkg later to install all these packages again.
help would be much appreciated
mandavi
Click here to see the post LQ members have rated as the most helpful post in this thread.
that should store the installed packages in filename. I don't know of anyway to reinstall packages from that list, but the packages are not so important as the config files. You can quickly go through and reinstall packages, but getting everything reconfigured from scratch can be painful. I would suggest that you back up /etc and everything in /home/username that begins with "."
i screwed my system by changing file permissions recursively from the root folder and want to install ubuntu new now - without all the work of going through the package list and pick all the useful packages again.
i found out that i can get a list with 'dpkg -l' but failed when i wanted to store that in a file - nor do i know how to tell dpkg later to install all these packages again.
help would be much appreciated
mandavi
dpkg --get-selections > selections.txt save the .txt file to a safe place then once reinstalled dpkg --set-selections < selections.txt followed by dselect update and apt-get dselect-upgrade show give you back your installed packages.
That was a very useful advice, Happytux, thanks a lot! As ssfrstlstnm said, config files are important too, but it is also impossible to remember all packages installed on a machine.
So, to replicate a machine (on different architecture, for example), one will need the package list AND the config files... I just went through this (different CPU architecture) and Happytux's advice made it a very easy job...
Along these same lines- is it possible to create an ISO of the whole configuration with all the tweaks, bells, and whistles that I've added to my Ubuntu install, such that I can migrate it to another hard drive?
I know this is a really old thread and you authors have probably already got your questions answered. I just thought I'd say thanks for that bit about the dpkg --get-selections. I'm going to give it a try.
Also, for what it's worth, if you'd like to create your own Ubuntu Live install disk, you can try Ubuntu Customization Kit. There's also Remastersys. I may experiment with these myself. However, especially with regard to Ubuntu (as opposed to pure Debian), I would bet that it'll be easier to just do the dpkg --get-selections thing or save my package list for reinstallation.* Individual settings can be made default for all new users by storing them in /etc/skel. (That is you can store all of your .config type files that are in your personal home folder to /etc/skel and then all new users will get those configurations.) Furthermore, if you save your /home/.config files and your /etc/X11/xorg.conf and just copy them over to a new install, this combined with the same packages being installed should take care of just about all of the customization.
The only thing you won't get that way is the installation and configuration of proprietary drivers; that might be available through Ubuntu's System > Administration > Hardware Drivers though.
* Ubuntu's release cycle is incredibly fast -- every six months -- so if you create your own reinstall disk for the whole OS, it'll soon be obfuscated. That's why I think it's probably better just installing "Jiffy Jackalope" or whatever's the latest and greatest, then copying over the customizations and installing the preferred app's.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.