How Ubuntu Apt-get Works

Source: Internet
Author: User
Tags sha1

Let's start with a few directories related to Apt-get:

/var/lib/dpkg/available

/var/cache/apt/archives
directory is when installing software with Apt-get install , the temporary storage path for the package

/etc/apt/sources.list
store the software source site when you perform sudo apt-get When install XXX, Ubuntu will go to these sites to download packages locally and perform the installation

/var/lib/apt/lists
Use the apt-get Update command to download the list of software from the/etc/apt/sources.list and save it to that directory

How APT works:

Ubuntu uses a centralized software warehouse mechanism that organizes and manages a wide variety of software packages in a repository. The software warehouse is then placed in a large number of mirror servers and remains basically consistent. This allows all Ubuntu users to get the latest version of the installation package at any time. Therefore, for users, these mirror servers are their source of software (reposity).

However, because each user is in a different network environment, it is not possible to access each mirror site at will. To be able to selectively access, in the Ubuntu system, use the software source profile/etc/apt/sources.list to list the most appropriate mirror site addresses to access.

apt-get update process:
execute apt-get update
Program analysis/ETC/APT/SOURCES.LIST
auto-connect to find the corresponding packages/sources/in the list Release list file, if there is an update download, deposit/var/lib/apt/lists/directory
then Apt-get install the corresponding package, download and install.

Even so, the software source profile simply tells the address of the mirror site that the Ubuntu system can access, but it is unclear what software resources are specifically owned by those mirror sites. If you install a software package, it is very inefficient to look for it on the server. Thus, it is necessary to make a list of these software resources (indexing files) for the local host to query.

Apt-get install downloaded software is stored under/var/cache/apt/archives/.

At the same time, APT is able to check package dependencies on Ubuntu Linux systems, greatly simplifying the process of installing and uninstalling software packages for Ubuntu users.

Apt-get Install principle:
Deb Http://cn.archive.ubuntu.com/ubuntu/precise main restricted

Can be found through the browser

Apt-get reads This file every time, thereby obtaining information about the package. gets information about all packages from the packages.gz. The information contained in the packages.gz is:

package Name, priority, type, maintainer, schema, source file (Source), version number, dependency package, conflicting information, package size, File download path,Md5sum,SHA1, package description,xul-appid-ApplicationId,Bugsinformation,Origin,Supported

Example of a package information in packages:

Package: Abrowser
Priority: Optional
Section: Web
installed-size:153
maintainer:ubuntu Mozilla Team <[email protected]>
Architecture: AMD64
Source: Firefox
Version: 11.0+build1-0ubuntu4
Depends: Firefox (>= 9.0)
Filename: Pool/main/f/firefox/abrowser_11.0+build1-0ubuntu4_amd64.deb
Size: 8940
md5sum: E8781AF38A6DE76126D190FC10A14BF2
SHA1: 408abd5f960d4b02bc18581df348954eb7620772
SHA256: cdfad0e4435c035b3115bdec08d79ccfc68bf9480e89df9270b3b6befa348699
Description: Safe and easy Web browser from mozilla–transitional package
DESCRIPTION-MD5: e89058e4775caff7d26313fa8811675e
Bugs: Https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
supported: 18m

As you can see from this information section, the actual Deb package is placed in the pool/main/f/firefox/abrowser_11.0+build1-0ubuntu4_amd64.deb and can be found through the browser. You can also see the dependency requirements in depends.


from:http://kurenai.elastos.org/2013/05/02/ubuntu-apt-get%e5%b7%a5%e4%bd%9c%e5%8e%9f%e7%90%86/

How Ubuntu Apt-get Works

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.