[Snippet] Ubuntu: Backup Your Applications Easily With A Single Command

ubuntu-app-backupInstalling applications in Ubuntu is as easy as the app store in iPhone. Hit the Ubuntu Software Center, find the application you want and click Install. Due to this convenience, most of the time, you won’t need to backup the applications itself.

However, there are times when you want to restore the newly formatted machine to the original state and you find it a chores to manually install all the applications again. This is when the backup is useful.

When we say “backup” in this case, we don’t really mean backing up the actual application. What we are going to do is to export the list of all your installed app onto a text file. Next time, we can just get the system to reinstall the apps listed in the text file.

Backing up your Apps

(Optional) To list all your installed applications, open a terminal and type:

sudo dpkg --list

To backup your list of applications to a text file:

sudo dpkg --get-selections > app-backup-list.txt

This will create a text file of the name “app-backup-list.txt” in your Home folder.

Restoring your apps

To restore your applications, first make sure that the app-backup-list.txt file is in your Home folder, then type in the terminal:

sudo dpkg --get-selections < app-backup-list.txt
sudo apt-get -y update
sudo apt-get dselect-upgrade

Note: This will only reinstall the applications. It won’t restore back the settings that you have previously set. You might want to back up the whole Home folder to preserve all your settings.

That’s it.

Image credit: cesarastudillo

Do you like what you read here?

Receive the latest update in your inbox.

Or connect with us:

7 Comments

  • Jesús Iniesta

    Hummm it's not a bad idea, but i don't like it. And that's just because I use a lot of external repositories and PPA's, and this will back up only the apps installed and I will have to look for its repositories manually. Any tip about that?

    Reply

  • cpsj

    Minor correction all the ‘–’ options have come out with single long hyphen – otherwise very useful info

    Reply

  • Jose Cortijo

    is there any front end to do this nicely? it would be perfect to backup in the ubuntu one for example… upload your sources.list, the app-backup-list.txt and your local settings .local folder for example…

    Reply