![ubuntu系统备份和还原](https://i-blog.csdnimg.cn/blog_migrate/f91eba2f5cf5e3d87dce96728617379c.png)
ubuntu系统备份和还原
![00_lead_image_aptik 00_lead_image_aptik](https://i-blog.csdnimg.cn/blog_migrate/31a857d48a7165e9faecaab6a295c0b8.png)
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。
![01_command_to_add_repository 01_command_to_add_repository](https://i-blog.csdnimg.cn/blog_migrate/285407cb196abb8cce19f5cb5e339534.png)
Type the following text at the prompt to make sure the repository is up-to-date.
在提示符下键入以下文本,以确保存储库是最新的。
sudo apt-get update
sudo apt-get更新
![02_update_command 02_update_command](https://i-blog.csdnimg.cn/blog_migrate/1af125fa8cb4b4f8ea8b82f93175c8d4.png)
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应该没有问题。
![03_command_to_install_aptik 03_command_to_install_aptik](https://i-blog.csdnimg.cn/blog_migrate/495b29201be06cff16ebc232685f3c03.png)
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。
![04_do_you_want_to_continue 04_do_you_want_to_continue](https://i-blog.csdnimg.cn/blog_migrate/55b81829cfbb541cf90d0c4f162588cf.png)
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”按钮来关闭“终端”窗口。
![05_closing_terminal_window 05_closing_terminal_window](https://i-blog.csdnimg.cn/blog_migrate/16294b8dc85d85424c2956dfcec55290.png)
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。
![06_creating_backup_folder 06_creating_backup_folder](https://i-blog.csdnimg.cn/blog_migrate/4fa7692bd80f8d6d8ef16761e3b2cf4b.png)
Once your backup directory is set up, click the “Search” button at the top of the Unity Launcher bar.
设置备份目录后,单击Unity Launcher栏顶部的“搜索”按钮。
![07_opening_search 07_opening_search](https://i-blog.csdnimg.cn/blog_migrate/630357f5ebf8f7a9b53d9b13b670acd7.png)
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的图标时,单击它以打开应用程序。
![08_starting_aptik 08_starting_aptik](https://i-blog.csdnimg.cn/blog_migrate/4a2a0730b50ef7724aed07e213cead5c.png)
A dialog box displays asking for your password. Enter your password in the edit box and click “OK.”
出现一个对话框,要求您输入密码。 在编辑框中输入密码,然后单击“确定”。
![09_entering_password 09_entering_password](https://i-blog.csdnimg.cn/blog_migrate/ca2067fe4d9144e7e56d2641eb90e3f8.png)
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.
注意:下拉列表右侧的“打开”按钮可在“文件管理器”窗口中打开所选目录。
![10_selecting_other_for_directory 10_selecting_other_for_directory](https://i-blog.csdnimg.cn/blog_migrate/5abd601118b702813f24e61d7ee4361b.png)
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.
注意:如果尚未创建备份目录,或者要在所选目录中添加子目录,请使用“创建文件夹”按钮创建一个新目录。
![11_choosing_directory 11_choosing_directory](https://i-blog.csdnimg.cn/blog_migrate/79b52524bc0e009e579ba39206769ca0.png)
To backup the list of installed PPAs, click “Backup” to the right of “Software Sources (PPAs).”
要备份已安装的PPA列表,请单击“软件源(PPA)”右侧的“备份”。
![12_clicking_backup_software_sources 12_clicking_backup_software_sources](https://i-blog.csdnimg.cn/blog_migrate/4715ef008f081959c64bce2d8e9a6b80.png)
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。
![13_selecting_all_software_sources 13_selecting_all_software_sources](https://i-blog.csdnimg.cn/blog_migrate/4237b963d307153d5c4b68216533c795.png)
Click “Backup” to begin the backup process.
单击“备份”开始备份过程。
![14_clicking_backup_for_all_software_sources 14_clicking_backup_for_all_software_sources](https://i-blog.csdnimg.cn/blog_migrate/c7fa3f6ed48322873e7fd129c7017882.png)
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”的文件。
![15_closing_finished_dialog_software_sources 15_closing_finished_dialog_software_sources](https://i-blog.csdnimg.cn/blog_migrate/435991659e5665bdd0e02facf0727279.png)
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”目录中,并且在备份完成后将显示一个对话框,指示软件包已成功复制。
![16_downloaded_packages_backed_up 16_downloaded_packages_backed_up](https://i-blog.csdnimg.cn/blog_migrate/35f00c78274e6158424709a52e7d6a6a.png)
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.
注意:依赖性程序包不包括在此备份中。
![18_clicking_backup_for_software_selections 18_clicking_backup_for_software_selections](https://i-blog.csdnimg.cn/blog_migrate/015cfdf5da6f8a6e4f0ccde0395618ae.png)
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”文件还列出了所有软件包,但指出了选择了哪些软件包。
![19_software_selections_backed_up 19_software_selections_backed_up](https://i-blog.csdnimg.cn/blog_migrate/e325ade20b21409a26a0f069e9a5c5c6.png)
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.
注意:如果要备份所有应用程序设置,请单击“全选”按钮。
![20_backing_up_app_settings 20_backing_up_app_settings](https://i-blog.csdnimg.cn/blog_migrate/4ad141c33c1f6f6c23760ee9508f2062.png)
The selected settings files are zipped into a file called “app-settings.tar.gz”.
所选设置文件被压缩到名为“ app-settings.tar.gz”的文件中。
![21_zipping_settings_files 21_zipping_settings_files](https://i-blog.csdnimg.cn/blog_migrate/af51b190ca07fc5b827800065c87a183.png)
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.
压缩完成后,将压缩文件复制到备份目录,并显示一个对话框,告诉您备份已成功创建。 单击“确定”关闭对话框。
![22_app_settings_backed_up 22_app_settings_backed_up](https://i-blog.csdnimg.cn/blog_migrate/95c266b626a63d3a4f9b6fbdd2023b79.png)
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”目录中的图标。 为此,请单击“主题和图标”右侧的“备份”按钮。 将显示“备份主题”对话框,默认情况下将选中所有主题和图标。 取消选择您不想备份的任何主题或图标,然后单击“备份”。
![22a_backing_up_themes_and_icons 22a_backing_up_themes_and_icons](https://i-blog.csdnimg.cn/blog_migrate/440a7cc56dcfca28337dfd1b03073495.png)
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”目录。 出现一个对话框,告诉您备份已成功创建。 单击“确定”关闭对话框。
![22b_themes_and_icons_backed_up 22b_themes_and_icons_backed_up](https://i-blog.csdnimg.cn/blog_migrate/8276cebf11bc9b709ba7f7a2506136ba.png)
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。
![23_closing_aptik 23_closing_aptik](https://i-blog.csdnimg.cn/blog_migrate/73bdc990847b2698e7c8017e6150a303.png)
Your backup files are available in the backup directory you chose.
您的备份文件位于您选择的备份目录中。
![24_backup_files_in_directory 24_backup_files_in_directory](https://i-blog.csdnimg.cn/blog_migrate/cad5f6b2bf565105f8814fc3c9a45164.png)
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系统备份和还原