
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系統備份和還原