LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 05-24-2006, 11:48 PM   #1
gugamare
LQ Newbie
 
Registered: Dec 2004
Location: São Paulo, Brazil
Distribution: Ubuntu 9.10
Posts: 24

Rep: Reputation: 15
apt-get backup/recovery


I am planning to do some heart surgery on my Debian system (I got some packages I need to downgrade) and I am worried that I'll end-up screwing things up.

Since I don't want to spend the weekend kicking myself if something goes wrong, I m wondering if there is a painless way to make a complete backup of my installed packages, through apt-get/synaptic/etc, and restore my machine to where it is today?

Does any one know a way I can do this?

Thanks
 
Old 05-24-2006, 11:56 PM   #2
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
Well, I know a way to record what packages you have now and then restore them later, but it won't backup config files. If you want to backup everything, use dd, g4u, or partition image.

Otherwise do the following
Code:
dpkg --get-selections > myselections.txt
Save that text file somewhere, as well as your sources.list.

Then to restore it, copy your sources.list to the machine and do
Code:
dpkg --set-selections < myselections.txt
apt-get update
dselect update
apt-get dselect-upgrade
This should install all the programs you had installed on the machine before, but you'll have lost the config files unless you back them up separately...
 
Old 05-25-2006, 12:14 AM   #3
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,733
Blog Entries: 12

Rep: Reputation: 457Reputation: 457Reputation: 457Reputation: 457Reputation: 457
For a convenient reinstallation save the list of programs/packages in /root/old-packages-YYYYMMDD-HHMM.txt which can be used to reinstall all packages with apt-get after the update installation:

apt-get install $(</root/old-packages-20051221-2030.txt)

Keep in mind like pljvaldez previously stated you will lose any custom configuration files you may have made.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup/Recovery aerogate Mandriva 2 11-11-2005 05:17 AM
Backup/recovery recommendations stutterbug Red Hat 2 04-25-2005 04:17 AM
Best backup recovery suite ldaled Linux - Software 6 09-27-2003 06:51 AM
Recovery Using tar backup hacketta Linux - Newbie 3 05-01-2002 11:40 AM
Backup and Recovery Tips hacketta Linux - Newbie 0 10-08-2001 05:58 AM


All times are GMT -5. The time now is 01:10 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration