Ubuntu software package management

Source: Internet
Author: User

Ubuntu is easy to use, and the most commendable is the way it installs software. A command: sudo apt-Get install xxx can help you solve almost all the software installation problems. But sometimes you may have such a requirement to check whether or not a software package is installed and where it is installed... Let's introduce the Ubuntu software package management method.

I. Ubuntu uses the Debian Package Manager dpkg to manage software packages. For example, all packages in the RPM. system are stored in/var/lib/dpkg/
Directory, its subdirectory/var/lib/dpkg/info is used to save the configuration file list of each software package:
(1). conffiles records the configuration file list of the software package.
(2). List stores the file list in the software package. You can find the specific installation location of the file in the software package from the. list information.
(3). The md5sums records the MD5 information of the software package. This information is used for package verification.
(4). the prerm script runs before the Debian package unpacks. The main function is to stop the service acting on the package to be upgraded until the package is installed or upgraded.
(5) The postinst script is used to complete the configuration after the Debian package is unwrapped. It is usually used to execute commands related to the Installed Package and restart the service.

The/var/lib/dpkg/available file contains the description of the software package, which includes all the software packages in the Debian installation source used by the current system,
These include installed and uninstalled software packages in the current system.

The/var/Cache/APT/archives directory is the temporary storage path of the software package when you use apt-Get install to install the software.

/Etc/APT/sources. list stores the software source site. When you execute sudo apt-Get install XXX, UBUNTU downloads the software package from these sites and installs it locally.

Ii. Example of related commands:
(1) view the installation content of a software package
Dpkg-l xxx

(2) find software packages in the software library
Apt-cache search Regular Expression

(3) display the statistics of the system installation package
Apt-Cache stats
 
(4) display the names of all available software packages of the system
Apt-Cache pkgnames

(5) display details of a software package
Apt-Cache show xxx

(6) Find the package of a file
Apt-file search xxx

(7) check which software packages have been installed
Dpkg-l

(8) query which software packages a software depends on
Apt-Cache depends xxx

(9) query which software packages depend on a software.
Apt-Cache rdepends xxx

(10) Add a CD Source
Sudo apt-CDROM add
Note: When installing the update package, you should first find the update package on the Ubuntu Cd (this will be very useful if you cannot install/update the software online, but have the Ubuntu dvd iso)

(11) system upgrade
Sudo apt-Get update

(12) Clear the remaining configuration files of all deleted software packages
Dpkg-L | grep ^ RC | awk '{print $2}' | sudo xargs dpkg-P

(13) automatic processing of H files is missing during compilation
Sudo auto-apt run./configure

(14) view the temporary storage directory of the software package downloaded during software installation
Ls/var/Cache/APT/Archives

(15) back up the list of all software packages installed on the current system
Dpkg -- Get-selections | grep-V deinstall> ~ /Somefile

(16) Restore all packages from the list file of the installation package backed up above
Dpkg -- Set-selections <~ /Somefile
Sudo dselect

(17) Clear old software caches
Sudo apt-Get autoclean

(18) Clear all software caches
Sudo apt-Get clean

(19) delete isolated software that is no longer used by the System
Sudo apt-Get autoremove

(20) view the address of the software package on the server
Apt-get-QQ -- print-Uris Install SSH | cut-d \ '-F2

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.