27

Is there a way, that I could backup all my programs, all apps, put them in a directory or something, so that I could install them quickly next time, without having to manually going over the app center, downloading them from terminal, etc?

Note that I might import them from a distro other than the one I exported them on. So, say I'm in Ubuntu, exported some stuff, and then installed BT and wanted to import them from there.

2
  • 3
    @Martin Betz: I disagree that that question is a duplicate. The OP clearly wants a comprehensive back-up of all installed applications, including ones that weren't installed through apt-get or dpkg.
    – Flimm
    Commented Jan 15, 2013 at 13:08
  • 4
    Possible duplicate of How to backup settings and list of installed packages
    – raphael
    Commented Jul 2, 2016 at 23:05

5 Answers 5

39

When I have to format my Ubuntu I follow this steps:

  1. dpkg --get-selections > package_list This creates a text file (package_list) with all package installed in your system. You can edit the file if you want to delete some packages.
  2. Backup /etc/apt/sources.list file and /etc/apt/sources.list.d/ folder. Here there are all the repositories.
  3. Backup /home/MyUser folder. All application settings are hide folders/files in your user's home folder, maybe you want to select what settings you want to restore.
  4. Format and install new Ubuntu.
  5. Restore your repositories (/etc/apt/sources.list file and /etc/apt/sources.list.d/ folder).
  6. sudo apt-get update && sudo apt-get upgrade
  7. sudo dpkg --clear-selections and sudo dpkg --set-selections < package_list. To restore the information of your installed packages.
  8. Install them: sudo apt-get update && sudo apt-get dselect-upgrade
  9. Finally, sudo apt-get autoremove to clean some packages.

Well, there are 9 steps, but you have an easy Ubuntu clean install.

Another solution is to mantain a list with your installed applications, then sudo apt-get install app-name (you can create a bash script).

10
  • @lago Is it possible to avoid default installed applications. As an example firefox is default installed, and vlc is not. So next when i will install system only install vlc.
    – shantanu
    Commented Oct 31, 2013 at 12:26
  • @shantanu for do that you have to build your own Ubuntu image. There are some software that helps you. Search in Google or ask another question :)
    – ilazgo
    Commented Oct 31, 2013 at 13:09
  • @lago sorry for my bad explanation. Actually i mean that, A fresh installed ubuntu has firefox installed. Now i install vlc. Lets get package list. There should be two package, firefox and vlc. Now i want to install fresh ubuntu again. Want to restore my packages. dpkg --set-selection < package_list. dpkg will run for firefox and vlc. But i don't need firefox, only vlc which is not installed by default (in fresh ubuntu).
    – shantanu
    Commented Oct 31, 2013 at 21:22
  • @shantanu well, for that, you have to get an empty Ubuntu image (and then install all what you want), or you have to do a sudo apt-get remove --purge firefox for every package you want to unninstall. Yo can do that in a bash script.
    – ilazgo
    Commented Nov 4, 2013 at 7:25
  • 2
    For future reader: I took a leap of faith and did the reinstallation yesterday. The part where I "export" then "import" list of installed software went without hitch. The "back up home folder" part went nicely because I configured my laptop exactly like before. Some people reported that back in time snapshot may not recognize old snapshots if the account / permission configuration is not exactly the same.
    – Heisenberg
    Commented Nov 18, 2013 at 21:02
1

@ilazgo's answer right on point!!Thank you. I used a slightly different format due to the problem I had at hand. Mine involved moving an encrypted home folder from a disk image I had initially created to the current home folder. Using @ilazgo's solution in addition to rsync options source destination, I was able to merge the two. Another solution can be found Here

0

For versions up to 15.04, Aptik is a nice GUI method of backing up to a remote drive and restoring everything with a few clicks of the mouse.

It's available in the PPAs.

1
  • can you please mention the link to the page which shows the installtion of this software?
    – Alex Jones
    Commented Mar 8, 2015 at 16:21
0

Aptik is something you could look into

http://www.unixmen.com/aptik-backup-ppas-themes-icons-application-settings-ubuntu/

1
  • 7
    Although your answer is 100% correct, it might also become 100% useless if that link is moved, changed, merged into another one or the main site just disappears... :-( Therefore, please edit your answer, and copy the relevant steps from the link into your answer, thereby guaranteeing your answer for 100% of the lifetime of this site! ;-) You can always leave the link in at the bottom of your answer as a source for your material...
    – Fabby
    Commented Aug 31, 2015 at 19:29
0

If you in apt environment:

  • sudo apt install apt-clone
  • Backup your packages sudo apt-clone clone ~/my-backup-packages
  • sudo apt-clone restore-new-distro my-backup-packages.tar.gz for restore a clone file from to and try upgrading along the way. this can be used so that the current release is cloned, a new install is done and then the old clone is installed.

Carefully: restore overwrite sources.list see how-to-backup-settings-and-list-of-installed-packages for solution.

As wrote @raphael it is duplicate how-to-backup-settings-and-list-of-installed-packages

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .