Usage of APT in Ubuntu and comparison with yum

Source: Internet
Author: User

Fedora and Red Hat have Yum installation software and Ubuntu has apt tool.

APT is simply a command to install software for Ubuntu.

1. APT Related Files
/Etc/APT/sources. List Set the source for obtaining the Software Package
/Etc/APT/apt. conf APT configuration file
/Etc/APT/apt. conf. d/ APT's fragmented configuration file
/Etc/APT/preferences Version Parameters
/Var/Cache/APT/archives/ Store downloaded software packages
/Var/Cache/APT/archives/partial Store the software package being downloaded
/Var/lib/APT/lists/ Store downloaded software package details
/Var/lib/APT/lists/partial/ Store the details of the software package being downloaded
Ii. subcommands of the apt-GET command
Update Update the package list
Upgrade Upgrade all software packages in the system
Install Install software package
Remove Uninstall Software Package
Autoremove Only remove software packages that do not need to be downloaded again
Purge Permanently delete the software package (including configuration files)
Source Download source code
Build-Dep Automatically download, install, and compile the required software package
Dist-Upgrade Upgrade the entire release
Dselect-Upgrade Select to install dselect for upgrade
Clean Delete all updates cached locally
Autoclean Delete unnecessary software packages in the local cache
Check Check for problematic Dependencies
Example: $ sudo apt-Get install php5-mysql apache2

$ Sudo apt-Get Update & sudo apt-Get upgrade

Iii. APT-Get Command Options
-D, -- download-only Download only, not install
-F, -- fix-broken Fix dependency issues (for the install and remove sub-commands)
-M, -- ignore-missing, -- fix-Missing Ignore missing software packages. When a software package cannot be downloaded, it is automatically ignored.
-- No-Download Download of software packages is prohibited. With-M, APT can only use the downloaded software package.
-Q, -- quiet Silent mode. The output information is suitable for logs.
-S, -- simulate, -- just-print Simulate the test and do not perform the actual operation or change the system.
-Y, -- yes, -- assume-Yes Yes automatically when the system asks a question
-U, -- show-upgraded Show upgraded software packages
-V, -- verbose-versions Displays the complete version number of installed and upgraded software packages.
-B, -- compile, -- Build Compile the source code package after it is downloaded.
-- Ignore-hold Ignore reserved software packages
-- No-Upgrade Do not upgrade the Software Package
-- Force-Yes Force answer yes
-- Print-Uris Only accept the package address, not install
-- Purge Thoroughly Delete, including configuration files
-- Reinstall Reinstall the Software Package

4. APT-Cache command

Function: search for a software package name or display details of a software package.
Search for MySQL software packages $ Apt-cache search MySQL
View the detailed version number of the SSH Software Package $ Apt-Cache show SSH
V. Operation comparison of Red Hat, fedora, and Ubuntu software packages
Task Red Hat, Fedora Ubuntu
Basic Information
Package suffix *. Rpm *. Deb
Software source configuration file /Etc/yum. conf /Etc/APT/sources. List
Install, delete, and upgrade software packages
Update the package list Automatic execution every time yum is run Apt-Get update
Install software from software warehouse Yum install package Apt-Get install package
Install a downloaded software package Yum install PKG. rpm

Rpm-I PKG. rpm

Dpkg-I PKG. Deb

PKG -- install PKG. Deb

Delete a software package Rpm-e package Apt-Get remove package
Software Package upgrade check/test Yum check-Update Apt-get-s upgrade

Apt-get-s dist-Upgrade

Upgrade Software Package Yum update

Rpm-uvh [ARGs]

Apt-Get upgrade
Upgrade the entire system Yum upgrade Apt-Get dist-Upgrade
Software Package Information
Obtains information about a software package. Yum search package Apt-Cache show package
Obtain information about all software packages Yum list available Apt-Cache dumpavail
Show all installed software Yum List Installed

Rpm-Qa

Dpkg-l

Dpkg -- list

Obtains information about an installed software package. Yum info package

Rpm-Qi package

Dpkg -- status package
List the files contained in an installed software package Rpm-QL package  
List documents contained in an installed software package Rpm-Qd package None
List the configuration files contained in an installed software package Rpm-QC package None
Displays the list of packages that a software package depends on. Rpm-QR package Apt-Cache depends package
Displays the reverse dependency of a software package. Rpm-Q-whatrequires [ARGs] Apt-Cache rdepends package
Package File Information
Obtains information about a software package. Rpm-qpi pkg. rpm Dpkg -- info PKG. Deb
Obtains the list of files contained in a software package. Rpm-qpl PKG. rpm Dpkg -- contents PKG. Deb
Obtain the documents contained in a software package file Rpm-qpd PKG. rpm None
Obtains the configuration file contained in a software package file. Rpm-qpc PKG. rpm None
Decompress the Software Package Rpm2cpio PKG. RPM | cpio-vid Dpkg-Deb -- extract PKG. Deb
Search which software package is used to install a file. Rpm-qf/file/Name Dpkg-S/file/Name

Dpkg -- search/file/Name

Search for all software packages that provide a file Yum provides/file/Name Apt-file search/file/Name
Miscellaneous
Displays the cache status of local software packages. None Apt-Cache stats
Verify all installed software packages Rpm-va Debsums
Delete all locally cached software packages Yum clean packages Apt-Get clean
Only remove outdated software packages in the local cache None Apt-Get autoclean
Delete all software package information Yum clean Headers Apt-file purge

Usage of APT in Ubuntu and comparison with yum

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.