ubuntu系统备份和还原
If you need to reinstall Ubuntu or if you just want to install a new version from scratch, wouldn’t it be useful to have an easy way to reinstall all your apps and settings? You can easily accomplish this using a free tool called Aptik.
如果您需要重新安装Ubuntu,或者只想从头开始安装新版本,那么有一种简便的方法来重新安装所有应用程序和设置是否有用? 您可以使用名为Aptik的免费工具轻松完成此操作。
Aptik (Automated Package Backup and Restore), an application available in Ubuntu, Linux Mint, and other Debian- and Ubuntu-based Linux distributions, allows you to backup a list of installed PPAs (Personal Package Archives), which are software repositories, downloaded packages, installed applications and themes, and application settings to an external USB drive, network drive, or a cloud service like Dropbox.
Aptik(自动软件包备份和还原)是在Ubuntu,Linux Mint以及其他基于Debian和UbuntuLinux发行版中可用的应用程序,它允许您备份已安装的PPA(个人软件包档案)列表,这些PPA是已下载的软件存储库。程序包,已安装的应用程序和主题以及应用程序设置到外部USB驱动器,网络驱动器或Dropbox等云服务。
NOTE: When we say to type something in this article and there are quotes around the text, DO NOT type the quotes, unless we specify otherwise.
注意:当我们说要在本文中键入某些内容并且文本周围有引号时,请不要键入引号,除非我们另外指定。
To install Aptik, you must add the PPA. To do so, press Ctrl + Alt + T to open a Terminal window. Type the following text at the prompt and press Enter.
要安装Aptik,您必须添加PPA。 为此,请按Ctrl + Alt + T打开“终端”窗口。 在提示符下键入以下文本,然后按Enter。
sudo apt-add-repository –y ppa:teejee2008/ppa
sudo apt-add-repository –y ppa:teejee2008 / ppa
Type your password when prompted and press Enter.
出现提示时输入密码,然后按Enter。
Type the following text at the prompt to make sure the repository is up-to-date.
在提示符下键入以下文本,以确保存储库是最新的。
sudo apt-get update
sudo apt-get更新
When the update is finished, you are ready to install Aptik. Type the following text at the prompt and press Enter.
更新完成后,就可以安装Aptik了。 在提示符下键入以下文本,然后按Enter。
sudo apt-get install aptik
sudo apt-get install aptik
NOTE: You may see some errors about packages that the update failed to fetch. If they are similar to the ones listed on the following image, you should have no problem installing Aptik.
注意:您可能会看到有关更新无法获取的程序包的一些错误。 如果它们与下图中列出的相似,则安装Aptik应该没有问题。
The progress of the installation displays and then a message displays saying how much disk space will be used. When asked if you want to continue, type a “y” and press Enter.
显示安装进度,然后显示一条消息,说明将使用多少磁盘空间。 当询问您是否要继续时,键入“ y”,然后按Enter。
When the installation if finished, close the Terminal window by typing “Exit” and pressing Enter, or by clicking the “X” button in the upper-left corner of the window.
安装完成后,请通过键入“退出”并按Enter或单击窗口左上角的“ X”按钮来关闭“终端”窗口。
Before running Aptik, you should set up a backup directory on a USB flash drive, a network drive, or on a cloud account, such as Dropbox or Google Drive. For this example, will will use Dropbox.
在运行Aptik之前,您应该在USB闪存驱动器,网络驱动器或云帐户(例如Dropbox或Google Drive)上设置备份目录。 对于此示例,将使用Dropbox。
Once your backup directory is set up, click the “Search” button at the top of the Unity Launcher bar.
设置备份目录后,单击Unity Launcher栏顶部的“搜索”按钮。
Type “aptik” in the search box. Results of the search display as you type. When the icon for Aptik displays, click on it to open the application.
在搜索框中输入“ aptik”。 输入时显示搜索结果。 当显示Aptik的图标时,单击它以打开应用程序。
A dialog box displays asking for your password. Enter your password in the edit box and click “OK.”
出现一个对话框,要求您输入密码。 在编辑框中输入密码,然后单击“确定”。
The main Aptik window displays. Select “Other…” from the “Backup Directory” drop-down list. This allows you to select the backup directory you created.
显示Aptik主窗口。 从“备份目录”下拉列表中选择“其他”。 这使您可以选择创建的备份目录。
NOTE: The “Open” button to the right of the drop-down list opens the selected directory in a Files Manager window.
注意:下拉列表右侧的“打开”按钮可在“文件管理器”窗口中打开所选目录。
On the “Backup Directory” dialog box, navigate to your backup directory and then click “Open.”
在“备份目录”对话框上,导航到您的备份目录,然后单击“打开”。
NOTE: If you haven’t created a backup directory yet, or you want to add a subdirectory in the selected directory, use the “Create Folder” button to create a new directory.
注意:如果尚未创建备份目录,或者要在所选目录中添加子目录,请使用“创建文件夹”按钮创建一个新目录。
To backup the list of installed PPAs, click “Backup” to the right of “Software Sources (PPAs).”
要备份已安装的PPA列表,请单击“软件源(PPA)”右侧的“备份”。
The “Backup Software Sources” dialog box displays. The list of installed packages and the associated PPA for each displays. Select the PPAs you want to backup, or use the “Select All” button to select all the PPAs in the list.
显示“备份软件源”对话框。 每个显示的已安装软件包列表和关联的PPA。 选择要备份的PPA,或使用“全选”按钮选择列表中的所有PPA。
Click “Backup” to begin the backup process.
单击“备份”开始备份过程。
A dialog box displays when the backup is finished telling you the backup was created successfully. Click “OK” to close the dialog box.
备份完成后,将显示一个对话框,告诉您备份已成功创建。 单击“确定”关闭对话框。
A file named “ppa.list” will be created in the backup directory.
将在备份目录中创建一个名为“ ppa.list”的文件。
The next item, “Downloaded Packages (APT Cache)”, is only useful if you are re-installing the same version of Ubuntu. It backs up the packages in your system cache (/var/cache/apt/archives). If you are upgrading your system, you can skip this step because the packages for the new version of the system will be newer than the packages in the system cache.
下一项“ Downloaded Packages(APT Cache)”仅在您重新安装相同版本的Ubuntu时才有用。 它将备份系统缓存中的软件包(/ var / cache / apt / archives)。 如果要升级系统,则可以跳过此步骤,因为新版本系统的软件包将比系统缓存中的软件包新。
Backing up downloaded packages and then restoring them on the re-installed Ubuntu system will save time and Internet bandwidth when the packages are reinstalled. Because the packages will be available in the system cache once you restore them, the download will be skipped and the installation of the packages will complete more quickly.
备份下载的软件包,然后将其还原到重新安装的Ubuntu系统上,可以在重新安装软件包时节省时间和Internet带宽。 由于还原后,这些软件包将在系统缓存中可用,因此下载将被跳过,并且软件包的安装将更快地完成。
If you are reinstalling the same version of your Ubuntu system, click the “Backup” button to the right of “Downloaded Packages (APT Cache)” to backup the packages in the system cache.
如果要重新安装相同版本的Ubuntu系统,请单击“下载的软件包(APT缓存)”右侧的“备份”按钮,以将软件包备份到系统缓存中。
NOTE: When you backup the downloaded packages, there is no secondary dialog box. The packages in your system cache (/var/cache/apt/archives) are copied to an “archives” directory in the backup directory and a dialog box displays when the backup is finished, indicating that the packages were copied successfully.
注意:备份下载的软件包时,没有第二个对话框。 系统缓存(/ var / cache / apt / archives)中的软件包将复制到备份目录中的“ archives”目录中,并且在备份完成后将显示一个对话框,指示软件包已成功复制。
There are some packages that are part of your Ubuntu distribution. These are not checked, since they are automatically installed when you install the Ubuntu system. For example, Firefox is a package that is installed by default in Ubuntu and other similar Linux distributions. Therefore, it will not be selected by default.
Ubuntu发行版中包含一些软件包。 这些未选中,因为在安装Ubuntu系统时会自动安装它们。 例如,Firefox是默认情况下安装在Ubuntu和其他类似Linux发行版中的软件包。 因此,默认情况下不会选择它。
Packages that you installed after installing the system, such as the package for the Chrome web browser or the package containing Aptik (yes, Aptik is automatically selected to back up), are selected by default. This allows you to easily back up the packages that are not included in the system when installed.
默认情况下会选择安装系统后安装的软件包,例如Chrome Web浏览器的软件包或包含Aptik的软件包(是的,将自动选择Aptik进行备份)。 这样一来,您可以轻松备份系统中未包含的软件包。
Select the packages you want to back up and de-select the packages you don’t want to backup. Click “Backup” to the right of “Software Selections” to back up the selected top-level packages.
选择您要备份的软件包,然后取消选择您不想备份的软件包。 单击“软件选择”右侧的“备份”以备份选定的顶级程序包。
NOTE: Dependency packages are not included in this backup.
注意:依赖性程序包不包括在此备份中。
Two files, named “packages.list” and “packages-installed.list”, are created in the backup directory and a dialog box displays indicating that the backup was created successfully. Click “OK” to close the dialog box.
在备份目录中创建了两个名为“ packages.list ”和“ packages-installed.list”的文件,并显示一个对话框,指示已成功创建备份。 单击“确定”关闭对话框。
NOTE: The “packages-installed.list” file lists all the packages. The “packages.list” file also lists all the packages, but indicates which ones were selected.
注意:“ packages-installed.list”文件列出了所有软件包。 “ packages.list”文件还列出了所有软件包,但指出了选择了哪些软件包。
To backup settings for installed applications, click the “Backup” button to the right of “Application Settings” on the main Aptik window. Select the settings you want to back up and click “Backup”.
要备份已安装应用程序的设置,请在Aptik主窗口中单击“应用程序设置”右侧的“备份”按钮。 选择要备份的设置,然后单击“备份”。
NOTE: Click the “Select All” button if you want to back up all application settings.
注意:如果要备份所有应用程序设置,请单击“全选”按钮。
The selected settings files are zipped into a file called “app-settings.tar.gz”.
所选设置文件被压缩到名为“ app-settings.tar.gz”的文件中。
When the zipping is complete, the zipped file is copied to the backup directory and a dialog box displays telling you that the backups were created successfully. Click “OK” to close the dialog box.
压缩完成后,将压缩文件复制到备份目录,并显示一个对话框,告诉您备份已成功创建。 单击“确定”关闭对话框。
Themes from the “/usr/share/themes” directory and icons from the “/usr/share/icons” directory can also be backed up. To do so, click the “Backup” button to the right of “Themes and Icons”. The “Backup Themes” dialog box displays with all the themes and icons selected by default. De-select any themes or icons you don’t want to back up and click “Backup.”
也可以备份“ / usr / share / themes”目录中的主题和“ / usr / share / icons”目录中的图标。 为此,请单击“主题和图标”右侧的“备份”按钮。 将显示“备份主题”对话框,默认情况下将选中所有主题和图标。 取消选择您不想备份的任何主题或图标,然后单击“备份”。
The themes are zipped and copied to a “themes” directory in the backup directory and the icons are zipped and copied to an “icons” directory in the backup directory. A dialog box displays telling you that the backups were created successfully. Click “OK” to close the dialog box.
将主题压缩并复制到备份目录中的“主题”目录,将图标压缩并复制到备份目录中的“ icons”目录。 出现一个对话框,告诉您备份已成功创建。 单击“确定”关闭对话框。
Once you’ve completed the desired backups, close Aptik by clicking the “X” button in the upper-left corner of the main window.
完成所需的备份后,通过单击主窗口左上角的“ X”按钮关闭Aptik。
Your backup files are available in the backup directory you chose.
您的备份文件位于您选择的备份目录中。
When you re-install your Ubuntu system or install a new version of Ubuntu, install Aptik on the newly installed system and make the backup files you generated available to the system. Run Aptik and use the “Restore” button for each item to restore your PPAs, applications, packages, settings, themes, and icons.
当您重新安装Ubuntu系统或安装新版本的Ubuntu时,请在新安装的系统上安装Aptik,并使生成的备份文件对系统可用。 运行Aptik,然后对每个项目使用“还原”按钮来还原您的PPA,应用程序,程序包,设置,主题和图标。
翻译自: https://www.howtogeek.com/206454/how-to-backup-and-restore-your-apps-and-ppas-in-ubuntu-using-aptik/
ubuntu系统备份和还原