1. Usually, the deb packages downloaded when apt-get or the new software is installed in Ubuntu9.04 are stored in/var/cache/apt/archives. Run the cp command to the target directory, for example, $ sudocp/var/cache/apt/archives /*. deb/media/TOOL_BACKUP/Ubuntu9.042. go to the upper-level directory of Ubuntu9.04, that is,/media/TOOL_BACKUP $ c.
1. In Ubuntu 9.04, the deb packages downloaded when apt-get or the new software is installed are stored in/var/cache/apt/archives. Cp it to the target directory, such:
$ Sudo cp/var/cache/apt/archives/*. deb/media/TOOL_BACKUP/Ubuntu9.04
2. Go to the upper-level directory of Ubuntu9.04, that is,/media/TOOL_BACKUP.
$ Cd/media/TOOL_BACKUP
3. Run the following command:
$ Sudo dpkg-scanpackages Ubuntu9.04/dev/null | gzip> Ubuntu9.04/Packages.gz
If dpkg-scanpackages cannot be run, install dpkg-dev.
4. Add the source in/etc/apt/sources. list:
$ Deb file: // media/TOOL_BACKUP/Ubuntu9.04/
Note/Ubuntu9.04 is followed by a space slash.
5. If apache2 is installed, open the source as follows:
$ Sudo ln-s/media/TOOL_BACKUP/Ubuntu9.04/var/www/ubuntu-local
$ Gksu gedit/etc/apt/sources. list
Add deb http: // 127.0.0.1/ubuntu-local/to the source
Change 127.0.0.1 to your IP address or domain name
6. When you manually back up the software package, there is often another problem, the http://ubuntuone.cn is the repetition of the new and old software packages. Placing them in the same backup folder not only wastes disk space, but also generates a lot of annoying warning information when dpkg-scanpackages are used to generate a source of cost. Run the following script after update to automatically back up the software package, delete the old package, and add the new software to the local source.
#! /Bin/sh
SOURCE =/var/cache/apt/archives
DEST =/media/TOOL_BOCKUP/Ubuntu9.04/Packages
Cd $ SOURCE
For name in $ (ls *. deb );
Do
Cd $ DEST
Rm $ (dpkg -- info $ SOURCE/$ name | grep Package: | sed's/Package ://')_*
Mv $ SOURCE/$ name $ DEST/
Cd $ SOURCE
Done
Cd $ DEST
Cd ..
Dpkg-scanpackages Ubuntu9.04/dev/null | gzip> Ubuntu9.04/Packages.gz