How to add a local software library to Ubuntu

Source: Internet
Author: User
Ubuntu uses a local software package as the installation source-to 2007-04-2619: 47 new users have a high probability of restarting the system, every time we reinstall the system, we have to go through the long apt-getinstall to install the software we need, but the software that we don't have on the system installation CD is really a pain. Method 1: The software packages downloaded by the system during each install, including the packages that each software depends on, are stored in the/var/cache/apt/archives/directory, selecting to use a local software package as the installation source through Ubuntu on the Internet at a time is very likely to be transferred to the system at a.m, every time we reinstall the system, we have to go through the long apt-get install to install the software we need, but it is really painful to install the software that is not available on the system installation CD.

Method 1:

The software packages downloaded by the system during each install, including the packages on which each software depends, are stored in the/var/cache/apt/archives/directory, after installing all the software commonly used by you through the network, copy all the files in the folder to an unformatted partition, as the local source for later system reinstallation, it can save time and effort.

The following is the operation process. For verification, the system is reinstalled once with no language.

1. Create a directory under your own root directory to store all downloaded software packages. The directory name is as you like. We recommend that you perform the following operations under your root directory, to avoid Operation permission problems.

Mkdir ~ /Packs

2. copy the file to the packs folder. The directory varies depending on the individual.

Sudo cp/var/cache/apt/archives /*~ /Packs

The packages.gz package will be created in step 3, which records the software package information under the packs folder, including the dependency information.

Dpkg-scanpackages packs/dev/null | gzip> packs/Packages.gz

After this operation, copy the packs folder to a partition that is not often formatted for long-term use. For example, if I put it on a fat32 partition, path:/media/hda6/linux/soft/packs

4. Add local source

Sudo gedit/etc/apt/sources. list

Add deb file: // media/hda6/linux/soft/packs/edgy main. Note that this is only the path on my computer. Modify it according to your actual location. edgy is my ubuntu version (7.04's version feisty), and the main is not fixed. You can also use restricted, etc, the structure of the Created directory is different in the operations in step 5. Here, we only use the main example. If you are interested, you can add a try. The system prompts that folder settings are displayed.

5. Set the directory structure under the packs directory

Create such a structure under the packs directory

Packs/dists/edgy/main/binary-i386/

Packs/# That is, create another packs under packs

The above two directories are used to place different types of packages. According to the prompts during the test on my computer, it seems that the binary-386 directory is under the installation packages of various software, the packs/directory contains dependent packages and system update packages, which basically start with lib. The safest way is to copy all packages to these two folders.

6. configuration complete

After completing the above settings and copying files, you can start to use the local source normally and use the source on the network.

Sudo apt-get update

Sudo apt-get dist-upgrade

Sudo apt-get install XXX

Method 2:

After the first directory structure, put the packages.gz package under the binary-i386 folder, and then copy all the deb packages to/var/cache/apt/archives.

It is estimated that the apt-get install's work is like this. First, read the Software List and package dependency information from the packages.gz package. First, scan the local archieves directory when installing a software. If you can find the corresponding package, start the installation, otherwise, download the package from the source.

In fact, my idea of implementing these operations is very simple.

1. Backup of existing software packages

2. Create the Software List and dependency packages.gz

3. Create a directory structure. add keywords such as main and restricted to the local source address at will, and then apt-get update. An error message is displayed, it contains the directory structure corresponding to each keyword,

4. Add the local source deb file: // dir /......

We recommend that you carefully check the system prompts when encountering system errors. linux system error prompts are not as nonsense as Mr. Bill does.

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.