Pre-emptive Request: Backing up installed packages.

James Gray james at grayonline.id.au
Thu Jan 26 07:58:24 UTC 2006


On Thu, 26 Jan 2006 17:43, Michael T. Richter wrote:
> I'm getting the distinct impression that I'm going to have to resort to
> backing up /home and reinstalling Ubuntu to get access to my audio
> hardware again.  The problem is that I've downloaded and installed an
> obscene number of packages from Synaptic.  (It's really quite addictive,
> isn't it?)  Is there any convenient way to automate getting a list of
> packages that have been installed placed on a file somewhere and then
> automagically reinstalling them without having to select them one by one
> through Synaptic?  (And, too, a convenient way to backup the repository
> information?)

Hi Michael,

I haven't done it in a while, but I believe the general idea is:
sudo dpkg --get-selections > my-packages.txt

save the "my-packages.txt" somewhere safe, you'll need it once the machine 
is rebuilt.

then,

sudo dpkg --get-selections < my-packages.txt
sudo apt-get -f install

You'll probably get better results if you use the same sources.list too, so 
back that up as well.

To backup the system configuration, the most thorough way is to simply 
backup the entire "/etc" directory....but that's a bit ugly, becasue some 
of your old settings may just recreate the same problems...you need to know 
what to restore and what not to.  You may get better results using 
"debconf-get-selections" and "debconf-set-selections".

As always, the man pages for these commands provide more info:
man dpkg  (then hit "/" and type "selections" + <ENTER> to search within the 
man page, hitting "n" will jump to the next occurence of "selections").

man debconf-[get|set]-selections

Oh, and for a quick-and-dirty /etc backup:
sudo tar -c /etc | gzip - > etc-backup-`date +%Y%m%d`.tgz

...this will dump a file "etc-backup-YYYYMMDD.tgz" in the current directory, 
so add that to your list of files to keep safe too :)

HTH,

James
-- 
Like I always say -- nothing can beat the BRATWURST here in DUSSELDORF!!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20060126/dcc7c766/attachment.sig>


More information about the ubuntu-users mailing list