Software package management tools under Linux
Linux Software installation can be done in two ways, one is directly with the package management tool installed, and another through the compilation of source installation.
1. Types of packages
Red Hat and Fedora: RedHat's earliest release of the personal version of Linux, since the release of Red Hat 9.0, RedHat Company no longer developed the desktop version of the Linux distribution Kit, Red Hat Linux stopped development, Instead, focus on the development of the server edition, the Red Hat Enterprise Linux Edition. Red Hat officially stopped supporting Red Hat version 9.0 on April 30, 2004, marking the official end of Red Hat Linux. The original desktop version of the Red Hat Linux distribution suite was merged with the Fedora program from the open source community to become the Fedora Core release. Red Hat is currently divided into two series: Red Hat Enterprise Linux (RHEL), which is powered by Red Hat and updated by the company, and the free Fedora Core developed by the community.
Features: For personal desktop applications, based on the Rpm/yum management package.
Rhel (Red Hat Enterprise Linux) and CentOS: Rhel is the Red Hat Enterprise Edition with commercial support. CentOS is re-compiled for Rhel, free and stable.
Features: For enterprise server use, security and stability, the use of Rpm/yum-based management software package.
Debian and Ubuntu: Debian is a model for community Linux and is by far the most GNU compliant. Ubuntu is based on the Debian distribution and the GNOME desktop environment. It uses bash as the base shell, so the difference between Ubuntu and CentOS is not obvious on many basic commands, and Ubuntu does better on the desktop interface, and similar Kunbuntu /xubuntu and so on.
Features: For desktop applications, using APT-GET/DPKG package management method.
There are two main:. Deb and. rpm
". Deb" package is a package developed by the Debian community, "RPM" is from Redhat
Package Type |
Linux distributions using this package |
Debian Style (. Deb) |
Debian, Ubuntu, Xandros, Linspire, etc. |
Red Hat Style (. rpm) |
Fedora, CentOS, Red Hat Enterprise Linux, etc. |
The management tools of the two packages are mainly divided into:
Linux distributions |
Underlying tools |
Upper Tool |
Debian.ubuntu |
Dpkg |
Apt-get, |
Fedora, Red Hat Enterprise Linux, CentOS |
Rpm |
Yum |
It is easy to see from the table that the Linux package management tool is divided into two levels, so here are some basic uses of the package management tool. Each has its own advantages, depending on the platform to determine which one to use.
2. Use of package management tools: Install, upgrade, query, uninstall
(1) Deb pack
A DEB package contains the set of compressed software files and the content information of the software (saved in the header file), typically shown as files ending with a. DEB extension, such as Package.deb. You need to use the dpkg command to manipulate it.
DPKG Command Common parameters
DPKG's general use method is DPKG-? Package (. rpm), where-? For installation parameters (for more information, see Help $man rpm):
-L Query the system for software content information --info in the system to query the software or query the content information of the specified RPM package -I install/ upgrade software in the system- r Uninstall the software in the system, do not delete the configuration file- p uninstall the software in the system and its configuration file
DPKG command parameters using the method to install the DEB Package command
sudo dpkg-i package.deb
Upgrade the DEB Package command
sudo dpkg-i package.deb (same as installation command)
Uninstalling the DEB Package command
sudo dpkg-sudo dpkg-p package.deb # unload configuration file
Query the file list commands included in the DEB package
sudo dpkg-deb-c package.deb
Query the Content Information command contained in the DEB package
$ dpkg--info package.deb
Querying all installed DEB packages in the system
$ dpkg-l Package
More user-friendly package management software-APTAPT
APT is all called Advanced packaging Tools. corresponding to YUM, it was first designed as a DPKG front-end software and now supports RPM management through apt-rpm. This section will introduce the use of APT as the DPKG front end. APT's main package management tool is apt-get, which satisfies the functionality requirements similar to the above YUM.
APT's software source definition is from the/etc/apt/sources.list file:
# See http://# Newer versions of the distribution. Deb http: //DEB-SRC http://Cn.archive.ubuntu.com/ubuntu/hardy main restricted
Note Each time you manually modify the above file, you need to use sudo apt-get update to update the source of the system so that the new source data is recognized by the current system.
The APT configuration file in UBUNTU is located in/etc/apt/apt.conf.d, where multiple profiles are categorized by function.
Generally in just installed Ubuntu system need to add the source, add the source of the region will be relatively fast, about this direct Baidu can.
APT Common Commands Update source index
sudo apt-get update #一般在安装软件和更新源之后需要执行这条命令.
Installing the specified software
sudo Install Package-name
Download the source file for the specified software
sudo apt-get source Package-name
Upgrade all software in the system to the latest version
sudo apt-get upgrade
Upgrade the operating system with all software to the latest version
sudo apt-get dist-upgrade
Uninstalling the specified software
sudo apt-get remove Package-name
For more information about APT, please refer to http://www.debian.org/doc/manuals/apt-howto/index.en.html.
(2) RPM package
RPM Package Installation/upgrade/query/Uninstall
A RPM package contains the set of compressed software files and the content information of the software (saved in the header file), usually shown as files ending with the. RPM extension, such as package.rpm. You need to use the RPM command to manipulate it. The parameters and how to use the RPM tool are described below, and are described in the example of the installation of the IBM Lotus Notes in RHEL 5.2.
RPM Command Common parameters
RPM is the usual way to use RPM-? PACKAGE.RPM, which--? For action parameters (for more information, see Help $man rpm):
-Q Query The system for the software or query the content information of the specified RPM package -i install the software in the system-youupgrade the software in the system-e in the system to uninstall software -H with the # (hash) character display rpm Installation process -v details the installation process -p indicates that the RPM packet is queried, usually in conjunction with other parameters, such as:-QLP queries the list of all files in a RPM package -QIP Query the content information of a RPM package
How to use RPM command parameters
Some of the above parameters need to be combined, such as rpm-h package.rpm is meaningless, but rpm-ih package.rpm means to install the package and display the installation progress with the # symbol.
Installing RPM Packages
# RPM-IVH package.rpm
Upgrade RPM Package Command
# RPM-UVH package.rpm
Uninstall RPM Package Command
# Rpm-ev Package
Query the file List command included in the RPM package
# RPM-QLP Package
Query the file List command included in the RPM package
# RPM-QLP Package
Query the Content Information command included in the RPM package
# RPM-QIP Package
Querying all installed RPM packages in the system
# RPM-QA
More user-friendly package management software-YumYum
Based on the RPM Package management tool, YUM can automatically download the target RPM package from the specified source space (server, local directory, etc.) and install it, automatically handle dependency relationships and download, install, without tedious manual download and installation of each required dependency package. In addition, another feature of YUM is to upgrade all software in the system. As mentioned above, the YUM RPM package is derived from the source space, specified in RHEL by the. Repo file configuration in the/etc/yum.repos.d/directory, such as the contents of Rhel-debuginfo.repo:
rhel-Debuginfo.repo[rhel-Debuginfo] Name=red Hat Enterprise Linux 5client-i386-Debug BaseURL=FTP://ftp.redhat.com/pub/redhat/linux/enterprise/5client/en/os/i386/debuginfo/Enabled=0Gpgcheck=1Gpgkey=file:///Etc/pki/rpm-gpg/rpm-gpg-key-redhat-releaseThe YUM system configuration file is located in/etc/Yum. conf, content such as: [Main] Cachedir=/var/cache/YumKeepcache=1DebugLevel=2Pkgpolicy=Newest LogFile=/var/log/Yum. Log distroverpkg=redhat-Release Tolerant=1Exactarch=1obsoletes=1Gpgcheck=1Plugins=1Exclude= Firefox gftp
Configuration files are used to define the yum behavior that users expect, such as Gpgcheck? Indicates that no GPG verification is performed during installation, and Exclued=firefox gftp indicates that Firefox and Gftp are not upgraded when the system is fully software upgraded.
YUM Common commands to install the specified software:
Yum Install Package-name
List installed software on the system
Yum List
List all software that can be upgraded in the system
Yum check-update
Upgrade all software that can be upgraded in the system
Yum Update
Upgrade specified software
Yum Update package-name
Receive all interactive questions during the upgrade process
Yum -y update
Uninstalling the specified software
Yum Remove Package-name
For more information on YUM, please refer to Http://fedoraproject.org/wiki/Tools/yum.
Reference Blog:Software package management on the Linux Platform for package management
Package management tools under "One day one Linux" Linux