After Ubuntu is installed, we usually need to first apt-getupdate and then apt-getupgrade to keep our system up to date. The downloaded software package is generally stored in the/var/cache/apt/archives/directory. After an update, several hundred MB of temporary files are generated. However, if you need to reinstall the system for some reason, do you need to download so many files again? If you encounter a snail like speed. As mentioned earlier,/var/
After Ubuntu is installed, we usually need to first apt-get update and then apt-get upgrade to keep our system up to date.
The downloaded software package is generally stored in the/var/cache/apt/archives/directory. After an update, several hundred MB of temporary files are generated.
However, if you need to reinstall the system for some reason, do you need to download so many files again? If you encounter a snail like speed. As mentioned earlier, the/var/cache/apt/archives/directory stores the software package for ubuntu update and download. You can back up all the deb files in this directory, you do not need to download the system again later.
Before you reinstall the Ubuntu system, copy the/var/cache/apt/archives/directory to another non-system partition (win fat partition is also acceptable), such as/media/hda5/archives, after the reinstallation, first Delete the archives directory under the/var/cache/apt/directory, and then directly create a soft connection archives under/var/cache/apt/to point to the backup just made, for example,/media/hda5/archives!
The software package will be directly called from the backup directory when the update is completed after the next reinstallation. If the Backup Directory does not exist, it will be downloaded from the Internet, which greatly saves time.
Deb file backup method
Sudo cp/var/cache/apt/archives/*. deb/backup/deb
/Backup is a partition of my computer
After you reinstall the system, enter the following command on the terminal:
Cd/backup/deb/enter the backup directory on the terminal
Sudo cp *. deb/var/cache/apt/archives/copy all files to the/var/cache/apt/archives/directory
Sudo apt-get update