AptonCD - Create a backup of all the packages you have installed using apt-get

November 06, 2006
Consider this scenario... You are interested in installing GNU/Linux on your machine. Assuming you already have the latest version burned on to a CD, it is a simple affair of popping the CD into your CD drive and starting the instalation. But once the installation is done and finished, you will most certainly want to install additional software apart from the ones bundled with the CD. And if you are using a Debian based Linux distribution such as Ubuntu, you will be using the apt-get method. Over a period of time you would have installed a number of additional software including any packages satisfying their dependencies as well as upgraded some of the software to the most recent version.

The problem occurs when you decide to re-install Linux on your machine. You are forced to start all over again, downloading additional software using apt-get. Personally, I have re-installed Debian or a Debian based Linux distribution umpteen times on my machine. And each time I have wished there was a simple way of backing up the packages which I have previously downloaded and installed via apt-get.

A good samaritan has pointed out to a unique project named AptonCD which allows one to create a CD image (ISO) of all the packages downloaded via apt-get or even the packages in a given repository.

On Ubuntu for instance, you can install it using the command:
# sudo apt-get install aptoncd
Once it is installed, you will find a Gnome menu entry at the location System -> Administration -> AptonCD. Clicking on it opens a GUI which will aid in the creation of an ISO image of all the packages stored in the /var/cache/apt/archives directory and any other files which are needed. You can also run aptoncd from the command line to start the AptonCD program.

So how do you use the program ?

It is simple really, the GUI has two tabs namely Create and Restore. The Create tab has a single button which when clicked copies all the necessary packages from the /var/cache/ directory and displays it in a pop up dialog. Here you get to decide if you need to add any additional packages stored in an alternate location or remove some of the already selected packages. There is also an option to set the target media as a CD or DVD and the location where you want to save the resultant image.

Fig: The create tab has just a single button

Fig: Selectively include the packages using this dialog

Once the choices are made, the program creates the necessary CD/DVD image and saves it in the location you had chosen. Now you can either store it in a different location or burn it to a CD/DVD.

Fig: Restore tab allows you to restore from backup

The Restore tab of the AptonCD GUI contain three buttons each catering to a specific purpose. This tab allows you to -
  • Restore all packages available from an AptonCD media (read it as CD or DVD) on to the computer.
  • Restore packages from an AptonCD ISO image previously generated and stored locally.
  • Add a CD/DVD created as a repository for apt-get, aptitude or synaptic. Which means the program adds the necessary lines of code required in the /etc/apt/sources.list file which will enable you to use apt-get or any similar program to install the software on the CD.
I found this program really convenient to use not only when I re-install Ubuntu but also when I want to install the same set of programs on a different machine.

One thing it lacks is a way to automatically download the packages from a remote repository and create a CD/DVD image. But then this software is still in its beta stage and hopefully we can see more features built into it in coming years.

The AptonCD project is the brain child of Rafael who's first language (I believe) is Portuguese. Not surprisingly, I found the help files bundled with the project to require a bit more work as in the present form, they are just place holders for the required documentation. But he has done a remarkable job on the software itself and in its current form, it works flawlessly.

12 comments:

  • It be nice to have same type of an app but with SMART PM and RPM based distro, such as my favorite SUSE.

  • wow, thanks, you're a lifesaver , and a big thank you to the creator of aptoncd

  • Thanks for pointing to this app. I have missed that for a looong time. I just could not believe such a tool had not existed in Debian world, and it makes all Debian-like distributions very dependend on Internet. I got spoiled by FreeBSD's pkg_create, that I have started to draw my own solution to the problem.

    This GUI app is nice, but still something as lightweight and flexible as pkg_create would be very useful. On FreeBSD it is as easy as running...

    $ for p in `\ls /var/db/pkg`; do pkg_create -jb ${p}; doe

    And done.

  • This realy annoys me too. having to spend time to intall all the packages post install. and you have to be there to enter command wait for it to finish then enter the next. I took a bash history and made it into a shell script so it installs all the packages and edits all conf files. so i can run one command and leave it unattended and return to a complete system. but this would save even more time downloading each package every install.

  • Hi, my name is also Rafael and I'm writing the APTonCD help files.
    The documentation was improved and we invite everyone to make suggestions :-)

  • Hi, I am a newbie here. I managed to create the iso image from one PC and burn it to cd. I have installed aptoncd script on other PC, I wanted to use the cd as a repository. So I choose the third option (add CD/DVD), from this point I dont’t know what to do next. Appreciate if any body can help me.
    Regards,

  • Heri,
    When you choose the third option, I guess it will add the path to your CD/DVD to the /etc/apt/sources.list.

    So there is nothing there to do for you other than running the apt-get command from the command line to install the software you had burned on the CD. Or you could also use synaptic to install the packages.

    Hope this helps.

  • Thank's Paul,
    I will try your suggestion.

  • Unknown

    Does anyone know of a way of listing just the names of all the additional packages that you've installed (on Ubuntu or Debian)?

    You could use this to restore a machine later.

    You would still need to download all the files but it might be more useful for a server.

    Thanks.

  • This app is great!
    Installing softwares in my Ubuntu system is a concern for me (I'm on dialup connection) as they have to be redownloaded after a reformat. I attempt to manually backup the installer-files but it gets complicated for packages with large dependencies.

    With APTonCD I can save all that work. It can backup all the packages installed on to a cd/dvd/.iso flie in few clicks. On the target machine (the fresh installation of Ubuntu) it installs the selected packages along with their dependencies requiring no internet connection, restoring the old system back in matter of minutes, including the system updates(again in few clicks)!
    Its got a nice GUI and more features making matters simple. eg- the search box.

    This is something I badly needed. Many thanks to the developers & the blogger.

    Its a must have app for Debian & *buntu users atleast for the ones with poor or no internet connection.

  • Unknown

    You can do this another way ...

    Well, FYI, there is a way with a lot less disk space (not that aptoncd is not very cool) ...

    Step 1 Make a list of all the applications you have installed :

    sudo dpkg –-get-selections | grep -v deinstall > ubuntu-files

    * Note : that is all one line and there are two - - in front of "get-selections" ;)


    Step 2 Save the file "ubuntu-files" on a flash drive or e-mail it to yourself ...


    Step 3 Reinstall Ubuntu, update :

    sduo apt-get update
    sudo apt-get dist-upgrade


    Step 4 Re-install all those applications ...

    sudo dpkg –-set-selections < ubuntu-files

    * Again, all one line and two - - in front of "set-selections"

    Step 5 Install :

    sudo deslect

    This opens a deslect session. Just type 'I' to install (that is a capital i ).

    Enjoy

  • A life saver here in Africa, where downloading software takes an eternity and costs a lot of money. Thanks, Rafael!