Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the apt-clone of linux

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use the apt-clone of linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Using apt-clone can help you back up installed packages and restore them in a newly installed Ubuntu system. If you have multiple Ubuntu systems that need to install the same set of packages, apt-clone can help you improve efficiency and accomplish this task quickly.

How do I install apt-clone?

The apt-clone package can be found in Ubuntu/Debian 's official repository, so use the apt package manager or the apt-get package manager to install it. Use the apt package manager to install apt-clone.

How does $sudo apt install apt-clone use apt-clone to back up installed packages?

After successfully installing apt-clone. Just provide a location to save the backup file. We will save the installed package backup in the / backup directory. Apt-clone saves the list of installed packages to apt-clone-state-Ubuntu18.2daygeek.com.tar.gz.

$sudo apt-clone clone / backup

We can also check by running the ls command.

$ls-lh / backup/total 32K Murray rwmurf RW Murray Rafe-1 root root 29K Apr 20 19:06 apt-clone-state-Ubuntu18.2daygeek.com.tar.gz

Run the following command to view the details of the backup file.

$apt-clone info / backup/apt-clone-state-Ubuntu18.2daygeek.com.tar.gzHostname: Ubuntu18.2daygeek.comArch: amd64Distro: bionicMeta: libunity-scopes-json-def-desktop, ubuntu-desktopInstalled: 1792 pkgs (automatic) Date: Sat Apr 2019: 06:43 2019

Based on the above output, there are a total of 1792 packages in the backup file.

How do I restore a software package that uses apt-clone for backup?

You can use any remote copy program to copy files on the remote server.

$scp / backup/apt-clone-state-ubunt-18-04.tar.gz Destination-Server:/opt

After the replication is complete, use apt-clone to perform the restore. Use the following command to restore.

$sudo apt-clone restore / opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz

Note that the restore will overwrite the existing / etc/apt/sources.list and install / remove the package. So be careful. If you want to restore all packages to folders instead of actually restoring them, you can use the following command.

Sudo apt-clone restore / opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz-- this is the end of the destination / opt/oldubuntu article on "how to use the apt-clone of linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report