The difference between Apt-get and Yum (RPM)

Source: Internet
Author: User
Tags gpg

Generally famous Linux systems are basically divided into two main categories: 1. Redhat series: Redhat, Centos, Fedora and other 2.Debian series: Debian, Ubuntu, etc.

RedHat Series
1 common installation package format RPM package, the command to install RPM package is "rpm-parameters" 2 package management tool Yum 3 support tar Package
Debian series
1 Common installation package format Deb package, the command to install the Deb package is the "dpkg-parameters" 2 package management tool Apt-get 3 Support tar package tar is just a compressed file format, so it only compresses the file package.
RPM is the equivalent of an installation file in Windows that automatically handles dependencies between packages. The pros and cons, RPM is generally pre-compiled files, it may have been bound to some kind of CPU or distribution above.
Tar generally includes compilation scripts, which you can compile in your environment, so it's universal. If your package does not want to open the source code, you can make rpm, if open source, with tar more convenient. Tar is usually the source of the software package, you need to unpack, and then install the trilogy,./configure, make, do install. To install the software. RPM is a software package management mechanism of Redhat company, which can be installed and deleted directly through RPM command, and the biggest advantage is that it automatically handles the possible dependencies of various packages within itself. --------------------------------*.rpm form of binary package [CentOS] Installation: RPM-IVH *.rpm Uninstall: rpm-e packgename rpm-q Nginx to see if an upgrade has been installed: R PM-UVH XXX Query:
To query all installed packages: RPM-QA
Query a package: RPM-QA | grep xxx
Rpm-qi xxx
The installation path of the query software: RPM-QL XXX
RPM-QC xxx
Querying a file is the RPM package generated: rpm-qf/etc/yum.conf
Rpm-qpi xxx rpm-qa|grep php to view installed RMP packages
Installation: Rpm-ivh XXX
Removal: rpm-e XXX
Upgrade: RPM-UVH XXX query:
To query all installed packages: RPM-QA
Query a package: RPM-QA | grep xxx
Rpm-qi xxx
The installation path of the query software: RPM-QL XXX
RPM-QC xxx
Querying a file is the RPM package generated: rpm-qf/etc/yum.conf
Rpm-qpi xxx
--------------------------------src.rpm Source code distribution package installation and uninstallation of the Linux software source code distribution is to provide the software all the program sources of the release form, requires users to compile their own executable binary code and installation  , the advantages are flexible configuration, can be arbitrarily removed or retained certain functions/modules, adapt to a variety of hardware/operating system platform and compilation environment, the disadvantage is difficult, generally not suitable for beginners to use. 1, *.src.rpm form of the source code package installation: Rpm-rebuild *.src.rpm Cd/usr/src/dist/rpms rpm-ivh *.rpm Uninstall: rpm-e packgename Description: Rpm–reb The uild *.src.rpm command compiles the source code and generates a binary RPM package under/usr/src/dist/rpms, and then installs the binary package.  Packgename as mentioned earlier. --------------------------------dpkg "Ubuntu" dpkg-l | grep ' php ' uses dpkg-l to see which software is already installed dpkg is a shorthand for the debian[. A suite management system specifically developed for Debian to facilitate the installation, updating and removal of software. All Linux distributions originating from Debian use dpkg, such as Ubuntu, Knoppix, and so on.
Here are some common uses of Dpkg:
1. Dpkg-i <package.deb>
Install a Debian package, such as files you have manually downloaded.
2. Dpkg-c <package.deb>
List the contents of <package.deb>.
3. Dpkg-i <package.deb>
Extract package information from <package.deb>.
4, Dpkg-r <package> 5, Dpkg-p <package>
Completely clears an installed package. Unlike remove, remove just deletes the data and executable files, and purge also removes all the configuration files.
6. Dpkg-l <package>
List all files that are <package> installed. Also see Dpkg-c to check the contents of a. deb file.
7. Dpkg-s <package>
Displays information about the packages that have been installed. Also see Apt-cache displays the package information in the Debian archive, as well as dpkg-i to display the package information extracted from a. deb file.
8. Dpkg-reconfigure <package>
Reconfigure an already installed package if it is using debconf (debconf provides a unified configuration interface for package installation). --------------------------------use Yum and Apt-get. Upgrade of software management methods. Yum configuration file is/etc/yum.conf
1. Let's start with the Redhat Yum's advanced package management. Yum install GCC [centos] Update: Yum update
Installation: Yum Install xxx
Remove: Yum Remove xxx
Clear files that have already been installed (/var/cache/yum/): Yum Clean all
Search: Yum Search xxx
List all files: Yum list
Query Archive message: Yum info xxx #sudo-S
#LANG =c
#yum-y install gcc gcc-c autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel L IBXML2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel Curl Curl -devel Installing packages with Yum
Yum-y <package_name>
Command: Yum install <package_name> delete package with Yum
Command: Yum remove <package_name> yum-y remove httpd*
Command: Yum search <keyword> List all installable packages
Command: Yum list Yum list php* list all updatable packages
Command: Yum list updates lists all installed packages
Command: Yum list installed lists all packages installed but not in Yum Repository
Command: Yum list Extras lists the specified packages
Command: Yum list <package_name> yum = Yellow dog Updater, Modified
The main function is more convenient to add/remove/update RPM packages. It's easy to manage a lot of system update problems Yum features
Multiple repositories can be configured at the same time (Repository)
Concise configuration file (/etc/yum.conf
Automatic resolution of dependency issues encountered when adding or removing RPM packages maintain consistency with RPM database Yum installation
CentOS comes with (yum-*.noarch.rpm)
#rpm-IVH yum-*.noarch.rpm
Before you first enable Yum, you first need to import the system's Rpm-gpg-key:
#rpm--import/usr/share/doc/centos-release-3 (4)/rpm-gpg-key-centos-3 (4) Yum instructions
Note: When using the Yum or Yum repositories for the first time, Yum will automatically download all required headers placed in the/var/cache/yum directory, which may take a long time. Update of RPM packages
Check for updatable RPM packages
#yum check-update
Update all RPM Packages
#yum Update
Update specified RPM packages, such as update kernel and kernel source
#yum Update Kernel Kernel-source
A large-scale version upgrade, unlike Yum Update, even the old obsolete package is upgraded
#yum Upgrade RPM package installation and removal
Install RPM packages, such as Xmms-mp3
#yum Install Xmms-mp3
Remove RPM packages, including packages that are dependent on the package
#yum Remove Licq
Note: You will also be prompted to delete the relevant parameters for the Licq-gnome,licq-qt,licq-text yum staging (/var/cache/yum/)
Clear the Staging RPM package file
#yum Clean Packages
Purge the RPM header files in the staging
#yum Clearn Headers
Clear the old RPM header files in the staging
#yum Clean Oldheaders
Purge old RPM header files and package files in staging
#yum Clearn or #yum clearn all
Note: the equivalent of yum clean packages + Yum Clean oldheaders Package list
List all RPM packages that can be installed or updated in the repository
#yum List
Lists the specific RPM packages that can be installed or updated and installed in the repository
#yum list Mozilla#yum list mozilla*
Note: You can use a match in the RPM package name, such as listing all RPM packages that start with Mozilla
List all RPM packages that can be updated in the repository
#yum list Updates
List all RPM packages that have been installed
#yum List installed
List RPM packages that have been installed but are not included in the repository
#yum List Extras
Note: Download and install RPM package information display (info parameter with list) from other website
List all the RPM packages that can be installed or updated in the repository
#yum Info
Lists the specific information in the repository that can be installed or updated and the RPM packages that have been installed
#yum Info Mozilla#yum Info mozilla*
Note: You can use a match in the RPM package name, such as listing all the RPM packages that start with Mozilla
List information about all RPM packages that can be updated in the repository
#yum Info Updates
List all the RPM packages that have been installed
#yum Info installed
Lists information about the RPM packages that have been installed but are not included in the repository
#yum Info Extras
Note: Search RPM packages for information on downloaded RPM packages installed through other websites
Search for RPM packages that match specific characters
#yum search Mozilla
Note: Search in RPM Package name, package description, etc.
Search for RPM packages with a specific file name
#yum provides realplay add a resource pool
Example: Add as a resource library
Install RPMs GPG key
#rpm--import Http://
Check GPG Key
# Rpm-qa gpg-pubkey*
Display key Information
#rpm-qi Gpg-pubkey-a109b1ec-3f6e28d5
(Note: If you want to remove key, use #rpm-e gpg-pubkey-a109b1ec-3f6e28d5) Yum Common command # yum install xxx install XXX software # yum info xxx view xxx software information # yum remove XXX Delete Package # Yum List Package # Yum clean clear buffer and on package # YUM provides xxx with XXX for keyword search package (information provided as keyword) # yum search xxx searching package (with name keyword) # yum gr oupupdate xxx # yum grouplist xxx # yum Groupremove xxx These three are a group of upgrades for the list and delete operations: For example, "Mysql Database" is a group that will operate all related packages simultaneously; # Yum update system upgrade # Yum list available lists all packages on the upgrade source; # Yum list updates lists all the update packages on the upgrade source; # Y The UM list installed lists the packages that have already been installed; # Yun update kernel upgrade kernel; Yum Common source 1) automatically selects the fastest source because the mirror speed in Yum is very slow, if Yum chooses this mirror, This time Yum will be very slow, in this, you can download the Fastestmirror plugin, it will automatically select the fastest mirror: #yum install yum-fastestmirror configuration file: (generally do not move)/etc/yum/ Pluginconf.d/fastestmirror.conf your yum image Speed Test log file:/var/cache/yum/timedhosts.txt (2) Yum using graphical interface if you feel that the command line Yum is inconvenient, Then you can use the graphical Yumex, which looks more convenient because you are free to choose a repository: #yum install Yumex and then you can see Yum extender in the system tools. In fact, the system comes with the "Add/Remove Programs" can also achieve graphical software installation, but some Yumex features it does not. 2. Talk about advanced package management methods in Ubuntu Apt-get
Configuration file/etc/apt/sources.list
For the server edition, it is recommended to use aptitude to view, install, remove the Deb package
sudo apt-get install aptitude
Then execute sudo aptitude into management or you can use the command:
Aptitude update updates the list of available packages
Aptitude Upgrade Upgrade Available packages
Aptitude Dist-upgrade Upgrade the system to a new release
Aptitude Install Pkgname installation package
Aptitude Remove Pkgname Delete Package
Aptitude Purge Pkgname Delete package and its configuration file
Aptitude search String Searching package
Aptitude show Pkgname shows the details of the package
Aptitude Clean Delete the downloaded package file
Aptitude AutoClean Only Delete expired package files considering the compatibility of the system, and the above are large, do not find the latest version, directly installed with Apt-get install XXX. Because our Ubuntu is dailybulid, So the content of the disc is basically up-to-date and does not need to be re-downloaded. Be sure to update your software's repository with the Apt-get update first, and then Apt-get install.
Common apt Command parameters: Apt-cache Search Package Apt-cache Show packages get information about package, such as description, size, version, etc. sudo apt-get install package sudo apt -get Install package--Reinstall Reinstall packages sudo apt-get-f install repair installs "-f =--fix-missing" sudo apt-get remove package to remove packages su Do apt-get Remove Packages--purge delete package, including delete profile etc sudo apt-get update update source sudo apt-get upgrade update installed package sudo apt-get DIST-UPGR Ade Upgrade System sudo apt-get dselect-upgrade use Dselect upgrade Apt-cache depends package to understand the use of dependency Apt-cache Rdepends package is to see which packages are dependent on Su Do apt-get BUILD-DEP Packages installation-related compilation environment Apt-get source package Download the source code for the bundle sudo apt-get clean && sudo apt-get autoclean Clean up the useless package sudo apt-get check to see if there is a corrupted dependency

Yum and Apt-get

RPM Packages and Deb packages are the most common format for installation packages under two Linux systems, and they are unavoidable when installing some software or services. RPM package is mainly used in the Redhat series of Linux systems, including the release version of Fedora, the Deb package is mainly applied to the Debian series, including the more popular version of Ubuntu, such as the current release.

We know that if you want to install both of these packages, the command to install the RPM package is "rpm-parameters" and the command to install the Deb package is "dpkg-parameters". And the Linux system is very convenient and humane point is a lot of software or services do not need us to download, direct use of the corresponding commands can be managed, the occasional said, I think is very "cloud" concept.

Yum can be used to operate RPM packages, such as management of a software on Fedora systems: Installation: Yum install <package_name> Uninstall: Yum remove <package_name> update: Yum Update <package_name> Apt-get can be used to operate a deb package, such as managing a software on an Ubuntu system: Installation: Apt-get install <package_name> Uninstall: Apt-get Remove <package_name> updates: Apt-get update <package_name>

First, redhat install yum

In Linux Redhat 9.0Using YumServer to manage rpmSuite Upgrade Method

Because of the RedhatThe company has already stopped the Linux Redhat 9.0The maintenance,
So our users must find another way to upgrade the suite,
Use Yum at this timeServer to manage rpmKit upgrade,Because it avoids package dependencies and installation failure.
To connect YumThe server must first install the following program:

This file is available to the website,
This one file,And then to "Terminal Machine "Inside the SUand then you root.The password,
Enter rootAfterThen enter the following instructions:


server to manage Rpm Kit upgrade
Yum Update

> your rpm Kit, plus apt-get install
Yum install kit Yum clean Yum Remove remove your Rpm Kit.

Second, the use of Yum 1. Redhat's Yum Advanced package management1). Install and remove software with yum Install the system add and remove software is common, Yum is also qualified for this task, as long as the software is rpm installed. Install the command is, yum install Xxx,yum will query the database, there is no such package, if any, then check its dependency conflict, if there is no conflict-dependent, then it is best to download the installation, if there is, will be prompted to ask whether you want to install dependencies at the same time, or delete conflicting packages, You can make your own judgments. Delete the command is, yum remove xxx, as with the installation, Yum will also query the database, giving a hint to resolve the dependency. 2). Install the package with Yum command: Yum install <package_name>3). Remove the package with Yum command: Yum remove <package_name> query software information with YumWe often encounter this situation, want to install a software, only know that it is related to a certain aspect, but do not know exactly its name. This is when Yum's query function works. You can use the Yum search keyword command to search, such as we want to install a instant Messenger, but do not know exactly what, it may be possible to use the Yum search Messenger, such as the search for a command, Yum searches all available rpm descriptions, lists all the RPM packages that are described in the Messeger, so we may get gaim,kopete and so on and choose from them. Sometimes we have a package installed, but we do not know its purpose, we can use Yum Info packagename This command to get information. 1). use yum to find packages Order: Yum Search <keyword>2). list all packages that can be installed command:yum list 3). List all updatable packages command:yum list updates 4). List all installed packages command:yum list installed 5). List all packages installed but not in Yum repository command:yum list Extras 6). list The specified packages command: Yum list <package_name>Third,Use of Apt-get2. The advanced package management method in Ubuntu Apt-getIn addition to the convenience of apt, Apt-get's great advantage is that it greatly reduces the probability of the so-called dependency nightmare (Dependency hell), even if it is caught in dependency Hell,apt-get also provides a good aid to help you escape from Morgul. Usually, apt-get are haunted by compressed packets on the Internet, downloaded or installed from the Web. There are more than 200 official Debian images around the world, as well as a wide range of unofficial software packages to provide websites. Unlike the D-Ebian release you are using, the repositories you use may need to be manually selected or automatically set up. You can get a full list of images from the official Debian website. And many unofficial websites offer unofficial packages for a variety of special purposes, and of course there are more risks to using unofficial packages. packages are prepared for a basic Debian release (from unstable to stable) and divided into different categories (such as main contrib nonfree), which is based on the Debian Free software program ( That is often said DFSG), because the United States restricts the export of encryption software, there is a non-us category. 3. Common APT Command parametersApt-cache Search PackageSearch PackagesApt-cache Show Packageget information about a package, such as description, size, version, and moresudo apt-get install packageInstall packagesudo apt-get Install package--Reinstall reinstall packagessudo apt-get-f Install repair Installation "-F =--fix-missing"sudo apt-get Remove packagesudo apt-get Remove package--purge delete packages, including deletion of configuration files, etc.sudo apt-get update sourcesudo apt-get upgrade update installed packagessudo apt-get dist-upgrade upgrade systemsudo apt-get dselect-upgrade using Dselect upgradeApt-cache depends package learn about using dependenciesApt-cache Rdepends package is to see which packages are dependent onsudo apt-get BUILD-DEP package Installation-related compilation environmentApt-get Source Package downloads The source code for the bundlesudo apt-get clean && sudo apt-get autoclean cleanup of useless packagessudo apt-get Check to see if there is a corrupted dependency

The difference between Apt-get and Yum (RPM)

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.