← 返回命令列表

Linux command

apt-clone 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Clone

sudo apt-clone clone [path/to/directory]

Example

sudo apt-clone clone --with-dpkg-repack [path/to/directory]

Restore

sudo apt-clone restore [path/to/apt-clone-state-hostname.tar.gz]

Example

sudo apt-clone restore [path/to/clone.tar.gz] --destination [path/to/directory]

Example

apt-clone info [path/to/apt-clone-state-hostname.tar.gz]

Example

sudo apt-clone restore-new-distro [path/to/clone.tar.gz] [new_distro_codename]

说明

apt-clone creates and restores backups of the installed package state on Debian-based systems. It captures information about installed packages, their versions, and repository sources, enabling system migration or recovery. Clone files are compressed tar archives containing package lists and APT source configurations. This allows replicating a system's software configuration on another machine or after a fresh installation.

参数

--source _path_
Specify an alternative source directory for cloning (default is /).
--destination _path_
Specify the destination directory for restore (debootstraps the clone into this directory).
--with-dpkg-repack
Include package files for packages no longer available in repositories.
--with-dpkg-status
Include the full dpkg status file.
-h, --help
Show help message and exit.
--debug
Enable debug output.

FAQ

What is the apt-clone command used for?

apt-clone creates and restores backups of the installed package state on Debian-based systems. It captures information about installed packages, their versions, and repository sources, enabling system migration or recovery. Clone files are compressed tar archives containing package lists and APT source configurations. This allows replicating a system's software configuration on another machine or after a fresh installation.

How do I run a basic apt-clone example?

Run `sudo apt-clone clone [path/to/directory]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --source _path_ do in apt-clone?

Specify an alternative source directory for cloning (default is /).