LinuxCommandLibrary

apt-clone

Clone installed APT packages to another system

TLDR

Clone the package state of the current system into a specified directory

$ apt-clone clone [path/to/directory]
copy

Create a clone file (tar.gz) for backup purposes
$ apt-clone clone --destination [path/to/backup.tar.gz]
copy

Restore the package state from a clone file
$ apt-clone restore [path/to/backup.tar.gz]
copy

Show information about a clone file (e.g., the release, architecture)
$ apt-clone info [path/to/backup.tar.gz]
copy

Check if the clone file can be restored on the current system
$ apt-clone restore [path/to/backup.tar.gz] --destination [path/to/restore]
copy

SYNOPSIS

apt-clone [options]

PARAMETERS

--all
    Clone all packages including automatically installed dependencies.

--show-installed
    Show currently installed packages (listing the manifest).

--with-dpkg-repack
    Include downloaded packages with dpkg-repack to the archive to make it portable.

--destination
    Specify the destination path for cloning data (default is ./apt-clone.tar.gz).

--source
    Specify the source path for restoration.

--restore
    Restore packages from a previously saved state.

--same-version
    Try to install the exact same versions as on the original system.

--purge
    Purge removed packages (restore functionality only).

--simulate
    Simulate the restore process without actually installing any packages.

--help
    Display help message.

DESCRIPTION

apt-clone is a utility designed to clone the packages installed on one Debian-based system (like Ubuntu) to another.

It works by generating a manifest of currently installed packages, including their versions. This manifest can then be used on another system to install the same packages, effectively replicating the software environment.

This is particularly useful for system administrators who need to deploy identical software configurations across multiple machines, or for developers who want to ensure a consistent environment for testing and development. apt-clone simplifies this process by automating the package installation and configuration. It also supports creating an archive containing the packages for offline installation.

CAVEATS

apt-clone relies on the APT package manager. It cannot clone or restore software installed outside of APT (e.g., manually compiled programs). It also may fail if package versions are no longer available in the repositories.

USAGE EXAMPLE

To clone the installed packages to an archive file:
apt-clone create apt-clone.tar.gz
To restore the packages from the archive on a new system:
apt-clone restore apt-clone.tar.gz

HISTORY

apt-clone was developed to simplify the task of replicating software environments across multiple Debian-based systems.

It addresses the need for a quick and reliable way to migrate or duplicate package configurations.

Over time, it has evolved to include features such as package archiving and more refined restoration options.

SEE ALSO

apt(8), dpkg(1)

Copied to clipboard