In the next article we are going to take a look at apt-clone. This is a simple way to clone the packages installed on your Ubuntu and restore them to another computer in a very simple and fast way. Many times installing the same set of packages on multiple Ubuntu systems is a time consuming and tedious task. If we don't want to waste time installing the same packages over and over on multiple systems, this is a good option.
Actually, when it comes to install packages on Ubuntu systems of similar architecture, there are many methods available to facilitate this task. You can simply migrate the applications, settings and data from your old Ubuntu system to a freshly installed system with a couple of mouse clicks using Aptic. We will also be able to back up the complete list of installed packages using the package manager. For example we can use APT, and install them later on a newly installed system.
Apt-clone will help us when installing applications that run on Ubuntu and similar operating systems. We will be able very easily install the same set of packages on multiple systems so that all of them have them. We can also make a backup copy of the entire list of installed applications and restore them wherever and whenever necessary.
Back up installed packages and restore them later on another Ubuntu system
Next we will see how install and use apt-clone on Debian based systems. I tested this utility on Ubuntu 18.04 system, however it should work on all Debian and Ubuntu based systems.
We will be able to install apt-clone in our Ubuntu very easily. We will find the program available in the default repositories of our operating system. To install it, we just have to open a terminal (Ctrl + Alt + T) and write the following command in it:
sudo apt install apt-clone
Backup installed packages
Once installed, we are going to create a directory to store the installed packages. Then we will clone them and save them in the location we just created. To do so, in the terminal (Ctrl + Alt + T) we will only have to type the following commands:
mkdir ~/paquetesInstalados sudo apt-clone clone ~/paquetesInstalados
The above command will save all the packages installed on our Ubuntu system. They will be saved in a file called apt-clone-state-entreunosyceros-satellite2.tar.gz located in the directory ~ / installed packages.
View backup file details
For view backup file details, we will execute the following command in the terminal:
apt-clone info paquetesInstalados/apt-clone-state-entreunosyceros-satelite2.tar.gz
As you can see in the above screenshot, I have 2054 packages in total on my Ubuntu 18.04.
Restore the backup file
Once the backup file is obtained, we are going to copy it to our USB drive. Then we can go to any other system where we want to install the same set of packages. To install these packages, we can open a terminal (Ctrl + Alt + T) and write the following command in it:
sudo apt-clone restore apt-clone-state-entreunosyceros-satelite2.tar.gz
Keep in mind that this command will overwrite your existing /etc/apt/sources.list file and install / remove packages. We will have to make sure that the destination system is the same distribution as the source system. For example, if the source system is running 18.04-bit version 64 LTS, the target system must also have the same version and architecture.
If you don't want to restore the packages on the system, you just have to use the option –Destination / location / file. An example of the command to use would be the following:
sudo apt-clone restore apt-clone-state-entreunosyceros-satelite2.tar.gz --destination ~/viejoUbuntu
In this case, the above command will restore the packages to a folder called ~ / oldUbuntu.
Information about apt-clone
If you need more information and details about apt-clone, you can take a look at the help section opening a terminal (Ctrl + Alt + T) and typing in it:
You can also check man pages. You can access them by typing in the same terminal:
For more information about this program, you can consult the page on GitHub From this project.