Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there any way to backup installed software, install a fresh Ubuntu system, and restore the software on the newly installed system, without an Internet connection? I already cleared my apt cache.

share|improve this question

4 Answers 4

up vote 2 down vote accepted

Backup

  1. Ctrl + Alt + T(Opens Terminal)

  2. Get root access (i) Type "sudo su" then press Enter (ii)Give Your Password

  3. Install Require Packages (i)apt-get install fakeroot(ii)apt-get install dpkg-repack

  4. cd to Your Backup directory For example ,Say U have a Thumbdrive and created a folder backup "cd /media/usb/backup"

  5. Run the Following in terminal

    fakeroot -u dpkg-repack dpkg --get-selections | grep install | cut -f1

.Restore

Steps to reinstall packages

1.Ctrl + Alt +T(Opens Terminal)

2.cd to the "backup" directory

Eg: "cd /media/usb/backup"

3.Run the Following in terminal

sudo dpkg -i *.deb

Source :Facebook doc

Edit

If it lead to broken dependencies open the terminal and type

sudo apt-get install -f 
share|improve this answer
    
feel free to edit –  Tachyons May 29 '12 at 12:00

You can use dpkg : sudo dpkg --get-selections > backup

and then you copy backup, and then you reinstall and use

sudo dpkg --set-selections < selections
sudo apt-get update && sudo apt-get -u dselect-upgrade

( not from me, found on http://syslog.tv/2010/07/02/using-dpkg-selections-to-backup-and-install-packages/ )

However, you need to have the same sources.list ( especially if you used ppa ), so I recommend to make a copy of /etc/apt/. If you plan to upgrade the Ubuntu version, not all versions would be identical, so maybe that's not exactly what you want

share|improve this answer

This one-liner will tar up all the (official) files of your installed packages:

dpkg -l | grep ^ii | awk '{print $2}' | while read pkgname; do dpkg -L $pkgname; done | while read fname; do test -f "$fname" && echo $fname; done | tar zcf /path/to/backup.tar.gz -T-
share|improve this answer

Install and use 'aptoncd'

This will take whatever you have in /var/cache/apt/archives and create a media (CD-DVD) to use to install software via apt. You can the upgrade and install the same set of softwares in several machines with no need to re-download those packages again.

share|improve this answer
2  
-1 ,because aptoncd uses apt cache –  Tachyons Aug 9 '12 at 0:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.