Back up your applications

Contents

Let us suppose that you are using a very special application. It may be possible that after a long time of use, the repository from where you downloaded your application is not available any more. It may also be possible that, after a long use, something happened to your device, and you need to reinstall your favorite application.

We are going to explain you a way to keep a copy of the DEB package of your favorite application, so that you can install it again even if the package is not available any more from the repositories.

WARNING: Downloading deb files for all the installed packages may cause the root file-system to be exhausted thereby "bricking" the device. Proceed with caution.

After previous steps, you have a list with all the desired packages you want to download to your device. In our previous examples this list could be any one of these:

package.list

package-abiword.list

package-without-debconf.list

Now you just need to edit this list in order to use it with apt-get:

As a normal user type the following command:

$ vim /home/user/package.list

After vi editor is running, then type the following command:

:%s!install!!

This last command will clean the lines, removing the word install and leaving just the name of the packages. Now we want to add an order for apt-get to download the desired packages, so type the following command:

This last command will add to the beginning of each line the needed instructions for apt-get to only download the packages: -d install --reinstall. In order to prevent the script from stopping at any question we have inserted the --force-yes -yy option. Now we just need to save the file typing the following command:

With previous steps you have downloaded all your favourite applications, for backup purposes. Now just imagine that you need to install them again from scratch, then you will need to proceed as follows:

To install all the packages from the list:

open the package.list file in VIM

remove the -d option from each of the lines (:%s!-d!!)

save and execute the file again as root (# sh</home/user/package.list)

If you wish to install an individual package, execute the apt-get command separately for that package by using the specific line from the packages.list file.

executing package.list will only download the package, not the dependencies. This may create problems during restore when the package dependencies are not available in the archive. Of course, this would only be a problem if the package list was a selection of the entire system package list. When downloading the entire system package list, all packages would be available and dependecies would not be an issue.

safe way would be to remove the application via 'apt-get remove' and 'apt-get autoremove' and then use the apt-get with the -d and -o option to download the package with the dependencies.