Ubuntu – How to backup the programs/applications, so that after I reinstall a new one, I can still use the backup-ed ones


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.

Best Answer

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).