Debian package management system

Source: Internet
Author: User
The Debian package management system has only the .tar.gz package file at the beginning. you must compile each software that he wants to run on GNU/Linux. Users generally think that it is necessary for the system to provide a way to manage these software packages installed on machines. when Debian was born, such a management tool should... the Debian package management system contains only .tar.gz package files. you must compile each software that he wants to run on GNU/Linux. Users generally think that it is necessary for the system to provide a way to manage these software packages installed on machines. when Debian was born, such a management tool came into being and was named dpkg. So the famous "package" concept first appeared in the GNU/Linux system. later, RedHat decided to develop its own "rpm" package management system. soon encountered a new problem that caused the GNU/Linux creators to need a fast, practical, and efficient method to install the software package. when the software package is updated, this Tool should be able to automatically manage associated files and maintain existing configuration files. once again, Debian was the first to solve this problem, and APT (Advanced Packaging Tool) was born. APT was later transformed by Conectiva to manage rpm and used by other Linux releases as their software package management tools. As part of the operating system, the apt command uses a file to list the image site of the available software package. This file is/etc/apt/sources. list. The file content format is as follows: 1deb Distribution section1 secion22deb-src The first column of distribution section1 secion2 describes the file type, whether it is deb type or deb-src type, deb is a compiled binary software package, and deb-src is the source code package, the second column is the image address used. apt can use multiple types of addresses, such as http, ftp, and file. Run the apt-get update command to update the source list every time you modify the list file. The package management system uses a private database to track the status of software packages in the list: installed or not installed, apt-get uses this database to determine how to install the software packages you want and their associated packages. Use apt-get update to update the database list. this command checks the configuration of the list file. Install the software package apt-get install name apt scan the database to find the latest software package, and then download the software package from the image site specified in the list to the local device. Apt will automatically check the associated package and automatically download it to the local device. During the installation process, the system prompts that iF Package A is dependent on package B and Package B is not specified in the command line, the system prompts to install package B, if Package B is specified to be installed on the command line, this package is not displayed. apt only prompts to confirm that no package is specified in the command line. Apt will download the package for releasing the image site to the local/var/cache/apt/archives Directory and install it later. A command can be followed by multiple software packages. Delete a package apt-get remove filename apt will pay attention to which packages are dependent on the deleted packages. deleting a package with apt will delete the packages that are dependent on the package. However, if you want to delete the configuration file of the software package together with the configuration file, you can use the -- purge parameter. Update the software package apt-get upgrade. you can use this command to update the software package from the released version with the same version number. of course, you can also update the software package from the released version of the new version number, use the apt-get dist-upgrade command. When apt-get upgrade is used, the-u parameter displays the complete list of updatable software packages. Apt downloads the latest version of each software package and installs it in a proper order. When you use apt-get to install the software package, the software package will be downloaded to the local device on the release site of the list. as the package increases, it will occupy a lot of space, sometimes it is necessary to clear the software package. you can use the apt-get clean and apt-get autoclean commands. Clean clears all files in/var/cache/apt/archives and/var/cache/apt/archives/partial, except the locked files. Autoclean only clears objects that do not need to be downloaded again. Below are some frequently used package management commands: apt-get update -- run this command after modifying/etc/apt/sources. list or/etc/apt/preferences. Apt-get install packagename -- install a new software package apt-get remove packagename -- uninstall an installed software package (keep the configuration file) apt-get -- purge remove packagename -- uninstall an installed software package (delete configuration file) apt-get clean -- this command also deletes the backup of the installed software, however, this will not affect the use of the software. Apt-get upgrade -- update all installed software packages apt-get dist-upgrade -- upgrade the system to the new version apt-cache search packagename. you can search for related software packages apt-cache show packagename to display the packagename. apt-cache depends packagename lists the packages associated with this package dpkg-l -- lists all the packages. Dpkg-L package -- list all files in the package. Dpkg-S file -- find out which package the file belongs and find all packages that contain the file. if you use the absolute path of the file, find the corresponding package file. Apt-file search filename -- search for software packages containing specific files (not necessarily installed). the file names contain specified strings. Note: apt-file is an independent software package. Install apt-get install first, and then run apt-file update. The following parameters are frequently used when apt-get is used: -- no-install-recommends does not consider installing the recommended package -- install-suggests install the recommended package-d, -- download-only downloads the package-m, -- ignore-missing, -- fix-missing ignores the lost package -- no-downloadDisables downloading of packages-y, -- yes, -- assume-yes automatically answers yes -- assume-no during installation, -- show-upgraded: indicates which packages will be upgraded. -- reinstall: reinstalls the installed package -- purgeremove and deletes the configuration file -- allow-unauthenticated: ignores the authentication mechanism of the package.
Related Article

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: 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.