Recovering a list of installed apps

How to make them do what you want, not to rant on about. Slashdot is better for rants anyway.

Recovering a list of installed apps

Postby Doug Coulter » Wed Nov 01, 2017 10:40 am

Well, I blew it with a finger fumble and wiped out the disk on one of my dev boxes...(it's embarassing). I spend a lot of time building a box, customizing what apps are available according to what that box is mainly going to be used for, and other settings. Most of my boxen are so big that backing up whole disk images is...well, it takes far too long even though I have that big NAS, and it's pretty hard to do anyway with an opsys (all of them?) that won't let you just image a disk while in use - or since they are always writing...you simply can't get an accurate image. So you have to take it out and put it on another machine and so on - a real pain when some of mine aren't all that easily physically accessible.

A step on the way to making all this a little easier is to get a list of all the installed optional apps and automate their re-installation later on. This has more uses than just disaster recovery, as some opsys version upgrades are "clean slate" and you really want your old familiar tools back on the new-improved version.

On linux, there's a way, and it even gets stuff like the oddball C lib dependencies for say, perl modules, and even those modules themselves if you used synaptic or apt-get to put them in (not so much cpanm, but getting all the dependency chain IS the hard part). This even worked for me with a rather complex LEMP stack, NGINX, MySQL, FastCGI and so on, some of which took some other fiddling and for which I'll be posting fixup and example scripts later on here - they really save some time getting a LEMP stack or a GTK+ dev environment going - and since I don't (have to) do all that very often, I often don't remember the fiddly details and workarounds, and would otherwise have to research all that every time - ugh.

https://www.cyberciti.biz/tips/linux-ge ... store.html

Shows a way to do the app-list re-install thing and though this is old, it still works, though on the raw box one of the dselect utilities needed to be installed first (I guess it dropped off of the common distros).

Excerpting from the link in case it dies of old age:
You can store list of installed software to a file called /backup/installed-software.log, enter:
$ dpkg --get-selections > /backup/installed-software.log
##################
Under a Debian/Ubuntu Linux type the following two commands to reinstall all the programs:
# dpkg --set-selections < /backup/installed-software.log

Once list is imported, use the dselect command or other tools to install the packages, enter:
# dselect

Select 'i' for install the software. OR use the following command:
# apt-get dselect-upgrade


Basically, you can generate the installed app list and save that in a file...which in my case was fairly large - I have lots of tools and would like to have some continuity with them to save skull-sweat.
You save that off someplace safe...later on, you can inform the system (or a raw box) about this list and have it all install again. Not too shabby. I use .deb based distros (basically MATE over ubuntu) here, but the link above gives instructions for yum (redhat) stuff too.


Here's a sample file from one of my machines:
installed.log.tar.gz
some handy tools
(15.84 KiB) Downloaded 263 times


Note that lots of this is just default stuff from the distro (Mint-mate 18.2),

In this case, I had another machine to capture the list from. I often have more than one copy of things I use a lot which serve as a more-or-less lazy backup. But doing this all by hand...gaaaack. This was pretty painless.

Backing up one's home directory is good, easy, and I sometimes do that, but this is another animal entirely.
Some things that depend on other things, which in turn depend on a third thing - to 4-5 levels deep, aren't handled well at all by the standard mechanisms - you can't just install the top thing and have apt-get or synaptic find all the dependencies. But this just works...
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Return to Operating systems

Who is online

Users browsing this forum: No registered users and 2 guests