Ubuntu9.04 create local source

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.