Ubuntu uses apt for package management

Source: Internet
Author: User
Introduction

First, if .tar.gz. users want to use these software in their own GNU/Linux systems, they must compile each project. The birth of Debian gave people the reason to believe that the system had a way to manage packages that could be installed on machines. This system is called dpkg. The package was introduced to GNU/Linux for the first time, and the Red Hat's own 'rp' system is still brewing.

A new challenge is blocked by the GNU/Linux designers. They need a fast, efficient, and efficient way to install these installation packages and want them to automatically and independently configure these files during the upgrade. Here, we reiterate that Debian directly led to the birth of APT, that is, the advanced packaging tool. Since then, it has been used together with rpm in conectiva, and it has also been used by many other distributed systems.

How to Use Debian apt

Available commands

All these commands require sudo!

  • Apt-Get Update-run after/etc/APT/sources. List or/etc/APT/preferences is changed. You should also run it regularly to ensure that your source list is up to date.

  • Apt-Get install packagename-install a new installation package (see the following aptitude line)

  • Apt-Get remove packagename-remove an installed package (configfiles will remain after running)

  • Apt-Get -- purge remove packagename-remove an installed package (configfiles will be deleted after running)

  • Apt-Get upgrade-update all installed packages

  • Apt-Get dist-upgrade-update the entire system to an updated release version

  • Apt-cache search string-search strings in a series of known installation packages

  • Dpkg-l package-name-pattern-list installation packages in matching mode

  • Aptitude-view installation packages that have been installed or can be used in detail. Aptitude can be used in a command line similar to Apt-get, but only some commands are available-the most common installation and removal commands. However, because aptitude retains more tracking information than apt-get, it performs better when installing and removing the system.

  • Apt-Cache showpkg pkgs-displays the package installation information.

  • Apt-Cache dumpavail-print a list of available installation packages.

  • Apt-Cache show pkgs-displays the installation package records, similar to dpkg-print-avail.

  • Apt-Cache pkgnames-quickly lists each installation package in the system.

  • Dpkg-s file-which installed installation package contains this file.

  • Dpkg-l package-list all files in this package.

  • Apt-file search filename-find the installation package that contains the file name (if it is already installed, it is not required ). Apt-file is an installation package containing itself. You must first install apt-Get install and then run apt-file update. If apt-file search filename displays too much content at a time, use apt-file search filename | grep-W filename (this will only display content containing the file name) or use apt-file search filename | grep/bin/files in a fixed folder, such as/bin or/usr/bin. If you are looking for a special execution file, this will be very helpful ).

  • Apt-Get autoclean-run this command regularly to clear the. Deb folder in the installation package that is no longer in your system. In this way, you can obtain a lot of disk space again. If you have an avid demand for disk space, Apt-Get clean is radical, and it will even remove the. Deb files in the installed packages. However, you do not need to. Debs most of the time, so if you feel overwhelmed by disk space, it is worth running.

Other installation packages

Deborphan and debfoster are good tools to find installation packages that can be removed that are useless.

Note:

You can call up a different library by editing/etc/APT/sources. List. The specific method is to replace the 'stable' with 'unstable' (or other text) and then run/apt-Get update. However, this method is an old method, and the update method is pinning ). The following is an example of an unstable configuration file.

Use the command line to accelerate our work. ^ _ ^

The command line is very effective, but the typing is too slow, so make your command smaller. You 'd better enter the following content *~ /. Bashrc *

    alias acs='apt-cache search'
alias agu='sudo apt-get update'
alias agg='sudo apt-get upgrade'
alias agd='sudo apt-get dist-upgrade'
alias agi='sudo apt-get install'
alias agr='sudo apt-get remove'

But looking at the above introduction to aptitude, we have reason to use alias AgI = 'sudo aptitude install' to replace alias AgI = 'sudo apt-Get install'

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.