Management of Linux system software packages
First, RPM tools
RPM Redhat Package Manager, the design concept is open, not only on the Redhat platform, but also on SuSE can be used.
RPM Package name composition consists of-and. Divided into parts, such as abrt-cli-2.0.8-15.el6.centos.i686.rpm,
ABRT-CLI: is the package name
2.0.8-15: is the version number
El6: Refers to Redhat Enterprise Edition 6
CentOS: Refers to this is used on CentOS
i686: Refers to the platform type
Some RPM packages do not write specific platforms but Noarch, which means that the RPM package does not have a hardware platform limit.
Mount Optical Drive
[Email protected] ~]# Mount/dev/cdrom/mnt/mount:block device/dev/sr0 is write-protected, mounting read-only
Write-protected: Write protection
1. Install a Package
[Email protected] mnt]# rpm-ivh/mnt/packages/libjpeg-turbo-devel-1.2.1-1.el6.i686.rpm
-I: Indicates installation
-V: Visualize
-H: Show installation progress
--force: Mandatory installation, even if overwriting files belonging to other packages is installed
--nodeps: Install this package when the RPM package to be installed depends on other packages, even if no other packages are installed
[Email protected] mnt]# RPM-IVH--nodeps/mnt/packages/libjpeg-turbo-devel-1.2.1-1.el6.i686.rpmpreparing ... ########################################### [100%] 1:libjpeg-turbo-devel ######################################## # # [100%]
Upgrade: RPM-UVH filename.rpm
-U is the meaning of upgrade
[Email protected] mnt]# echo $?0
Check that the previous step is installed correctly, if the number 0 is displayed correctly, if the other numbers are displayed incorrectly
2, RPM Uninstall:
RPM-E filename #这里的filename是通过rpm的查询功能所查询到的
Query Package Name
[Email protected] mnt]# Rpm-qa |grep libjlibjpeg-turbo-1.2.1-3.el6_5.x86_64libjpeg-turbo-devel-1.2.1-1.el6.i686
Here LIBJ is not the full name of the package, just probably remember, similar to the function of fuzzy search, so the query can be all
The packages that start with LIBJ are all displayed, and then find the one you need to uninstall
Uninstalling packages
[Email protected] mnt]# rpm-e libjpeg-turbo-devel
Query whether a package is installed
RPM-Q package name (without platform information and suffix name)
[Email protected] mnt]# rpm-q libjpeg-turbo-develpackage libjpeg-turbo-devel is not installed
Query the current system for all installed RPM packages
Rpm-qa
[[email protected] mnt]# rpm-qawdaemon-0.17-5.el6.x86_64gnome-python2-bonobo-2.28.0-3.el6.x86_64 ... omitted, too much.
Find information about RPM packages:
RPM-QI Package Name
[[email protected] mnt]# rpm -qi libjpeg-turbo-develname : libjpeg-turbo-devel relocations: (not relocatable) version : 1.2.1 vendor: centosrelease : 1.el6 build date: 2013 February 22 Friday 06:49 08 sec install date: 2015 March 29 Sunday 21 23 minutes 29 seconds build host: c6b9.bsys.dev.centos.orggroup : development/ libraries source rpm: libjpeg-turbo-1.2.1-1.el6.src.rpmsize : 321085 License: wxwidgetssignature : rsa/sha1, 2013 February 24 Sunday 01 53 minutes, 55 seconds, key id 0946fca2c105b9depackager : centos buildsystem
List the files that are installed by RPM:
RPM-QL Package name (as if not written version number is also possible)
[Email protected] mnt]# RPM-QL libjpeg-turbo-devel/usr/include/jconfig.h/usr/include/jerror.h/usr/include/ jmorecfg.h/usr/include/jpeglib.h/usr/lib/libjpeg.so/usr/share/doc/libjpeg-turbo-devel-1.2.1/usr/share/doc/ libjpeg-turbo-devel-1.2.1/coderules.txt/usr/share/doc/libjpeg-turbo-devel-1.2.1/example.c/usr/share/doc/ libjpeg-turbo-devel-1.2.1/jconfig.txt/usr/share/doc/libjpeg-turbo-devel-1.2.1/libjpeg.txt/usr/share/doc/ Libjpeg-turbo-devel-1.2.1/structure.txt
Query which rpm package a file belongs to
RPM-QF filename #这里可以结合反引号一起使用, such as RPM-QF ' which Yum '
FileName Here are two ways to do this:
The first type:
Use which yum to derive the absolute path of Yum
[email protected] mnt]# which yum/usr/bin/yum[[email protected] mnt]# rpm-qf/usr/bin/ Yumyum-3.2.29-60.el6.centos.noarch
The second type:
Direct use of the anti-quote step to get it.
[Email protected] mnt]# rpm-qf ' which yum ' Yum-3.2.29-60.el6.centos.noarch
The function of the anti-quote is to put the result of the command in the quotation marks in that position.
Second, yum Tools
List all available RPM package resources
Yum List
[email protected] ~]# Yum list
Search for a package
Yum Search [keywords]
[email protected] ~]# Yum search vim
Use grep to filter a package
Yum list |grep ' keywords '
[[email protected] ~]# yum list |grep ' Vim ' vim-common.x86_64 2:7.2.411-1.8.el6 @base vim-enhanced.x86_64 2:7.2.411-1.8.el6 @base vim-minimal.x86 _64 2:7.2.411-1.8.el6 @anaconda-centos-201311272149.x86_64/6.5vim-x11.x86_64 2:7.2.411-1.8.el6 base
@: Indicates a package that has already been installed
Yum installation package
Yum install-y filename (package name)
[[email protected] ~]# yum-y install vim
-y: Omit the swap with the user, that is, ask if you want to install or uninstall
Yum Uninstall Package:
Yum remove-y filename (package name)
[email protected] ~]# Yum remove-y vim
When uninstalling the package, it is important to note that it is best not to use-y, in case you uninstall other useful packages, do not know
Yum Upgrade Pack:
Yum update-y filename (package name)
[email protected] ~]# Yum update-y vim
Yum Find a command that was installed by that package
Yum provides "*/vim"
[email protected] ~]# Yum provides ' */vim '
List all the packages
Yum Grouplist
[email protected] ~]# Yum grouplist
Mounting kit
Yum Groupinstall
Uninstall Kit
Yum Groupremove
Iii. creating a local Yum source
Yum configuration file directory:/ETC/YUM.REOS.D
1. Mount the disc
[Email protected] ~]# mount/dev/cdrom/mnt
2, repair in the Yum configuration file, but before you fix it, back up the/ETC/YUM.REPOS.D directory
[Email protected] ~]# cp-r/etc/yum.repos.d//etc/yum.repos.d_back
-r: Parameters for backup directories
3. Delete all files under the/ETC/YUM.REPOS.D directory
[Email protected] yum.repos.d]# RM-RF *
4. Use Vim to edit a Dvd.reo file
It is important to note that the. Repo is a fixed format that cannot be changed.
[Email protected] yum.repos.d]# vim Dvd.repo #加入如下内容: [DVD] #yum源的名字, feel free to play Name=install DVD #yum源的描述信息baseu rl=file:///mnt# The Mount directory where the disc is located, that is, the path of the disc enabled=1 #这里指的是yum源的开始或者关闭, 1 means start, 0 means close gpgcheck=0 #不进行gpg检测
Exit Save
See if there's a DVD logo appearing
Yum List
[[email protected] yum.repos.d]# yum list |tailyum-presto.noarch 0.6.2-1.el6 dvd yum-updateonboot.noarch 1.1.30-14.el6 dvd yum-utils.noarch 1.1.30-14.el6 dvd zip.x86_64 3.0-1.el6 dvd zlib.i686 1.2.3-29.el6 dvd zlib-devel.i686 1.2.3-29.el6 dvd zlib-devel.x86_64 1.2.3-29.el6 dvd zlib-static.x86_64 1.2.3-29.el6 dvd zsh.x86_64 4.3.10-7.el6 dvd zsh-html.x86_64 4.3.10-7.el6 dvd
Installing the Yum extension source
[Email protected] yum.repos.d]# RPM-IVF http://www.lishiming.net/data/attachment/forum/epel-release-6-8_32.noarch.rpm
Other address http://www.aminglinux.com/bbs/thread-6721-1-1.html)
Iv. downloading a RPM package with Yum
1, install a plug-in to support only download does not install
Search Plugin
[email protected] ~]# Yum list |grep downloadonly
Installing plugins
[email protected] ~]# Yum install-y yum-plugin-downloadonly.noarch 1.1.30-14.el6
Download an RPM package without installing
Yum Install package name-y--downloadonly #这样就已经下载, default in/var/cache/yum/base/packages/
Specify a download directory
Yum Install package name-y--downloadonly--downloaddir=/usr/local/src #指定一个下载目录
If the RPM package you have installed is not successful, you need to use reinstall:
Yum Reinstall package Name-y--downloadonly--downloaddir=/usr/local/src
Five, the source package installation
Source package is open source self-changing package, mostly with C voice development, can not be used directly, need to compile into binary executable file
Compile the source package must have GCC support, if there is no need to install Yum install-y gcc
Usually compiles three steps:./configure configure various compilation parameters; Make compiles according to the specified compilation parameters, and makes install to the specified directory
Instance:
1, download the source package to the specified directory
cd/usr/local/src/
2, install the wget, if already installed, you can skip this step
[email protected] src]# Yum instrall-y wget
3. Download Apache This package
[Email protected] src]# wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.27.tar.bz2
4. Decompression
[Email protected] src]# TAR-JXVF httpd-2.2.27.tar.bz2
5. Installing the GCC compiler
[email protected] httpd-2.2.27]# Yum install-y gcc
Specifies the compilation parameters./configure--help
6, configure the relevant options, and generate makefile
[Email protected] httpd-2.2.27]#/configure--prefix=/usr/local/apache2
--prefix=: followed by the installation location of the specified package
Verify success
[Email protected] httpd-2.2.27]# echo $?0
7. Compiling
[[email protected] httpd-2.2.27]# make
Verify success
[Email protected] httpd-2.2.27]# echo $?0
8. Installation
[[email protected] httpd-2.2.27]# make install
9. Check whether the installation is successful
[Email protected] httpd-2.2.27]# ls/usr/local/apache2/bin cgi-bin error icons lib man modulesbuild conf Htdocs include logs manual
Small white study notes, shortcomings also ask the big God to correct
Blog Address: http://www.aminglinux.com/bbs/thread-7688-1-1.html
This article is from the It Exchange Learning blog, so be sure to keep this source http://sxct168.blog.51cto.com/824373/1626618
Management of Linux system software packages March 30 Course