The difference between Apt-get and Yum

Source: Internet
Author: User

Generally famous Linux systems are basically divided into two main categories:

    1. Redhat series: Redhat, CentOS, fedora, etc.
    2. Debian series: Debian, Ubuntu, etc.

RedHat Series

1 common installation package format RPM package, the command to install RPM package is "rpm-parameter"

2 Package management Tools Yum

3 Support for TAR packages

Debian series

1 Common installation package format Deb package, the command to install the Deb package is "dpkg-parameters"

2 Package Management Tools Apt-get

3 Support for TAR packages

Tar is only a compressed file format, so it just packs the files. 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 packaged software, need to unpack their own, and then install the trilogy, "./configure, make, made 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.

--------------------------------binary packages in *.rpm form [CentOS]

Installation: Rpm-ivh *.rpm

Uninstall: rpm-e packgename rpm-q Nginx

To see if an upgrade has been installed: 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 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 installation and uninstallation of source code distribution packages

The distribution of the source code of the Linux software refers to the release form of all the program sources of the software, which requires the user to compile the executable binary code and install it, the advantage is that the configuration is flexible, can remove or retain certain functions/modules, adapt to a variety of hardware/operating system platform and compiling environment, the disadvantage is difficult , generally not suitable for beginners to use.

1, *.src.rpm form of source code package

Installation: Rpm-rebuild *.src.rpm Cd/usr/src/dist/rpms RPM-IVH *.rpm

Uninstall: Rpm-e Packgename

state: Rpm–rebuild *.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 debian[, a package management system specifically developed for Debian, which facilitates 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 rpm.livna.org as a resource library
Install livna.org RPMs GPG key
#rpm--import Http://rpm.livna.org/RPM-LIVNA-GPG-KEY
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 g roupupdate 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 list all updates available on all upgrade sources; Yum list installed lists installed packages; # 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

The difference between Apt-get and 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.