How to Clone Packages in Debian Derived Systems

April 16, 2014 | By
| Reply More

I love fresh Ubuntu installation on my machines, but I hate to use the dpkg debian package manager tool to backup and restore my packages.

clone packages debian

The following commands are used to backup ubuntu/debian package selection list.

Backup:

sudo dpkg --get-selections > dpkglist.txt

Restore:

sudo dpkg --set-selections < dpkglist.txt
sudo apt-get -y update
sudo apt-get dselect-upgrade

I have used and continue to use so many commands that sometimes I ask myself one question: How is it possible that I remember all these commands?

I want an easy solution that will help me to clone and restore package info of a debian based system or chroot environment. The apt-clone can do that!

According to the apt-clone creator's official page, it is a small shell script that provides a convenient means of replicating package selections across multiple hosts.

I find the apt-clone very useful when it comes to deploying software on my machines because I can easily duplicate the package selection of a single system on any other machine. The apt-clone command-line tool saves me a significant amount of time, time is priceless!

Money can't buy it!

Instead of managing and installing packages on every machine and workstation I can use apt-clone and it will automatically do the job for me.

Install the software only once in one single machine, let apt-clone work for you. The apt-clone tool is included in the official repositories so we can use the apt-get utility to install it in Ubuntu and other Debian based linux distros.

The following command will help you to install apt-clone tool in your machine. Open a new terminal (CTRL+ALT+T) and run it.

The advanced package manager will automatically build the dependencies tree, download and install the software for you. Just type the following command, press Enter and watch it working.

It is so nice when everything is automated.

sudo apt-get install apt-clone

But, who is apt-clone right for?

  1. Anyone who manages multiple workstations, and needs to make sure that a consistent software library is available across those systems.
  2. Home users who regularly wipe their systems, and has more than a few software packages they use that are not included in the default install.
  3. IT managers for public libraries and educational institutions, where each user does not have a designated workstation.
  4. Support Technicians for medium and large businesses, where uniform availability of software is critical to day-to-day operations.

How to use apt-clone tool

After the installation of the apt-clone tool is finished you can easily launch it from the terminal, but since it is command-line we need to learn two or three commands in order to use it for accomplishing our own tasks.

When combined with the -h the apt-clone tool will give you information on its usage, commands and available options.

The following command will help you to learn how to use the apt-clone utility.

apt-clone -h

In order to create a clone file you have to type the following command.

sudo apt-clone clone specify_destination_path_here

The following command will create a clone file in my Desktop folder.

sudo apt-clone clone /home/oltjano/Desktop

After the clone file is created you can easily request information on it with the info like shown below.

sudo apt-clone info name_of_clone_file_here

The use the following command to restore a clone file from source. You can also specify a destination where the clone file should be restored by using the --destination option.

sudo apt-clone restore name_of_clone_file_here

Filed Under : HOWTOS

Free Linux Ebook to Download

Leave a Reply

Commenting Policy:
Promotion of your products ? Comment gets deleted.
All comments are subject to moderation.