Linux Package Management

Source: Internet
Author: User


The software management mechanisms commonly used under Linux systems are in the form of source code and the rpm (Redhat Package Manager) packet management mechanism, in which we will explain the two software management mechanisms.

RPM Package Management

RPM (Redhat Package Manager) is designed to facilitate software management using a set of open source software formats that have the following design goals:

① using the RPM command to complete the RPM software installation

② in single package format (. rpm file) We can see that the RPM package has only one file in. RPM (RPM package management mechanism requires that the package must end with. rpm)

③ upgradeable RPM Package can be upgraded, for example, I downloaded a new version of the RPM software, we only need to use the Rpm-u command to upgrade

The ④ tracking dependency RPM package management mechanism tracks dependencies between software, which makes it easy to install

⑤ Saving the Software basic information

⑥ Software Verification Features

⑦ Multi-platform support, multi-platform support is not to say that a RPM software can run on multiple operating system platforms, but that the software will release different RPM packages for multiple platforms


Basic commands for RPM:

RPM-Q Package Name Query whether the specified package is installed

Rpm-qa to query all packages that have been installed

Rpm-qa | grep [[email protected] packages]# Rpm-qa | grep "^z" zd1211-firmware-1.4-4.el6.noarchzlib-1.2.3-27.el6.x86_64zsh-4.3.10-5.el6.x86_64

RPM-QI Package Name: Querying information for a specified package

[Email protected] packages]# Rpm-qi zsh

RPM-QL Package Name query Specifies the list of files that are generated after the package is installed

[Email protected] packages]# RPM-QL zsh

Rpm-qf/path/to/somefile: The specified file for the query was installed by that RPM package

[Email protected] packages]# rpm-qf/bin/lscoreutils-8.4-19.el6.x86_64



RPM-QC Package Name query Specifies the configuration file for file installation

RPM-QD Package Name query Specifies the file installation Help file

RPM-Q--scripts Package Name query specifies the script for package installation


Query for packages that are not installed:

RPM-QPI Package Full Name

[Email protected] packages]# Rpm-qpi zip-3.0-1.el6.x86_64.rpm RPM-QPL

Upgrade: RPM-UVH

--oldpackage: Downgrade

Uninstalling RPM-E

Verifying the RPM-V package name

Rpm-k verifying the integrity of the package


Yum sources and warehouses:

Yum's features include the following points:

① Automatic resolution of dependencies

② can group RPMs and install operations based on groups

③ introduces the concept of warehouse and supports multiple warehouses

The repository can be either local or Internet, using centralized, unified network warehouses in the form of HTTP, FTP, or NFS.


Warehouse Construction:

Server ip:192.168.1.112

[[email protected] ~]# Yum install httpd service iptables stop service httpd start CKHC Onfig httpd on

Set up folder Yum and its subfolders under the Appache root directory centos, copy all contents of the CentOS folder in the CD to the/var/www/html/yum/centos directory

Mkdir-p/var/www/html/yummkdir-p/var/www/html/yum/centoscp-prf/media/centos/*/var/www/html/yum/CentOS/

Installing Createrepo

Rpm-ivh Createrepo ..... Create a yum repository (with dependencies)

[Email protected] centos]# RM-RF repodata #先删除元数据 [[email protected] Centos] # createrepo/var/www/html/yum/centos/#把 This directory was created as a Yum source, a bit long spawning worker 0 with 4184 pkgsworkers finishedgathering worker resultssaving Primary metadatasaving fil E lists metadatasaving other metadatagenerating sqlite dbssqlite DBs complete

[[email protected] centos]# ls      CentOS_BuildTag  isolinux                   RPM-GPG-KEY-CentOS-Debug-6EFI               Packages                   RPM-GPG-KEY-CentOS-Security-6EULA              RELEASE-NOTES-en-US.html   rpm-gpg-key-centos-testing-6gpl               repodata                   trans. tblimages           rpm-gpg-key-centos-6.bak# Repodata automatically generates 

Configure Client Yum Client ip:192.168.1.113

[[email protected] ~]# cd/etc/yum.repos.d/[[email protected] yum.repos.d]# ls centos-base.repo.bak CENTOS-FASTTRACK.R The EPO Centos.repocentos-debuginfo.repo Centos-media.repo centos-vault.repo# First Centos-base.repo Backup into Centos-base.repo.bak
#编辑centos. repo[yangbb] name=base repo on 172.16.0.1 baseurl=http://192.168.1.112/yum/centos # Source Path (http://ftp://file :////Intranet or extranet address can be gpgcheck=1 #是否验证 gpgkey=http://mirrors.ustc.edu.cn/centos/rpm-gpg-key-centos-6 #验证地址, can be a warehouse or inter NET Address
[[email protected] ~]# yum -y install bablloaded plugins:  fastestmirror, refresh-packagekit, securitysetting up install processloading  mirror speeds from cached hostfileresolving dependencies--> running  Transaction check---> Package babl.x86_64 0:0.1.2-4.el6 will be  installed--> finished dependency resolutiondependencies resolved======================= ==================================================================== package            Arch                 Version                    Repository            size===========================================================================================installing: babl               x86_64               0.1.2-4.el6                yangbb                83 ktransaction summary===================================================== ====================================
Install       1 package (s) total download size: 83  kinstalled size: 256 kdownloading packages:babl-0.1.2-4.el6.x86_64.rpm                                            |  83 kb     00:00     running  rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning  transactioninstalling : babl-0.1.2-4.el6.x86_64                                                    1/1&nbsp verifying  : babl-0.1.2-4.el6.x86_64                                                    1/1

At this point, the Yum source and the warehouse can be used normally


Yum's command :

Repolist: Lists all the available Yum repo

Clean all: Clear all caches

List: List RPM packages

NFO Package Name: View package Information

Grouplist: List Package groups

GroupInfo "package group name": Display package Group information

Install package ... : Install package-y

Reinstall Package Name: Reinstall the specified packages

Ckeck-update: Check for upgrades

Update package: Upgrade the specified packages

Erase/remove: Uninstalling packages (including dependent packages)

Whatprovides|provides/path/to/somefile: Who provided the query package?

Downgrade Package: Downgrade

Groupinstall "package Group": Install package Group

Install package name--nogpgcheck: Manual Disable check source and integrity


Two advantages of source installation:

1, the software according to the needs of users to be customized;

2, two times development; note: To be based on the license certificate Agreement of the software, developer license two times to develop;

Installation steps:

#./configure

#make

#make Install


Take the installation of http2.2 as an example:

[[Email protected] ~]# service httpd stop #关闭自动的http [[email protected] ~]# tar XF httpd-2.2.13.tar.bz2 [email protected] ~]# CD Httpd-2.2.13[[email protected] ~]#/configure--prefix=/usr/local/apache [[email protected] ~]# make && ma Ke install[[email protected] ~]# vim/etc/profile.d/apache.sh path= $PATH:/usr/local/apache/binexport PATH

[Email protected] httpd-2.2.13]# ln-sv/usr/local/apache/include/usr/include/http #给头文件创建软连接

Library file output:

[[email protected] ld.so.conf.d]# cd/etc/ld.so.conf.d/[[email protected] ld.so.conf.d]# vim httpd.conf input in file:/usr/ Local/apache/lib[[email protected] ld.so.conf.d]# ldconfig-v | Grep-v "[[: Space:]]"/usr/local/apache/lib:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib64/xulrunner:/lib:/ LIB64:/USR/LIB:/USR/LIB64:



Linux Package Management

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.