RPM Package Management
Rpm
function: Manage rpm package safety loading and unloading
Grammar : rpm [ options ] package name
Mounting discs
Mount:mount Point/nt does not exist
[Email protected] ~]# mount/dev/sr0/mnt
Mount:block Device/dev/sr0 is write-protected, mounting read-only
[Email protected] ~]# ls/mnt
Centos_buildtag Isolinux rpm-gpg-key-centos-debug-6
EFI Packages rpm-gpg-key-centos-security-6
EULA release-notes-en-us.html rpm-gpg-key-centos-testing-6
GPL Repodata TRANS. TBL
Images rpm-gpg-key-centos-6
[Email protected] ~]# ls/mnt/packages/| Wc-l # wc-l count rows
3996
command rules for Linux packages
[Email protected] ~]# cd/mnt/packages/
[Email protected] packages]# lszsh-4.3.10-7.el6.x86_64.rpm
zsh-4.3.10-7.el6.x86_64.rpm
Zsh-4.3.10-4.1
Software name Major Version number Minor version number revision release(first release version)
x86 _64
number of system bits supported by the CPU Architecture System Platform
installing rpm Packages
[Email protected] packages]# rpm-ivh/mnt/packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm
Warning:/mnt/packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm:header V3 rsa/sha256signature, key ID C105b9de:nokey
Preparing ... ########################################### [100%]
packagelrzsz-0.12.20-27.1.el6.x86_64 is already installed the system is loaded with this package.
[Email protected] packages]# rpm-ivh/mnt/packages/zsh-4.3.10-7.el6.x86_64.rpm
Warning:/mnt/packages/zsh-4.3.10-7.el6.x86_64.rpm:header V3 rsa/sha1 Signature, key Idc105b9de:nokey
Preparing ... ###########################################[100%]
1:zsh ########################################### [100%]
RPM--HELP
-I install InstallPackage
-v verbose verbose provide moredetailed output
-H hash Print hash marks as packageinstalls printing hash mark number on installation #
Just remember these few options. These options are used by default when installing
during installation To resolve dependencies:
installing the MySQL database
[Email protected] packages]# rpm-ivh/mnt/packages/mysql-server-5.1.71-1.el6.x86_64.rpm
Warning:/mnt/packages/mysql-server-5.1.71-1.el6.x86_64.rpm:header V3 rsa/sha1 Signature, key ID C105b9de:nokey
error:failed dependencies:
MySQL = 5.1.71-1.el6 is needed by mysql-server-5.1.71-1.el6.x86_64
Perl (DBI) is needed by mysql-server-5.1.71-1.el6.x86_64
Perl-dbd-mysql is needed by mysql-server-5.1.71-1.el6.x86_64
PERL-DBI is needed by mysql-server-5.1.71-1.el6.x86_64
[Email protected] packages]# ls*perl-dbd-mysq*
perl-dbd-mysql-4.013-3.el6.x86_64.rpm
If you do not find the can be find some key words as
*dbd* *perl-dbd*
Method 2 on the rpm package related website to find
http://rpm.pbone.net/
http://rpmfind.net/
Http://www.rpmseek.com/index.html
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/7F/73/wKioL1cfNRngZX-bAACNPoTOTU8071.jpg "title=" 2.jpg " alt= "Wkiol1cfnrngzx-baacnpototu8071.jpg"/>
forced installation :( rarely used ) does not resolve dependencies Direct Installation
[Email protected] packages]# RPM-IVH--nodeps/mnt/packages/mysql-server-5.1.71-1.el6.x86_64.rpm
RPM Query function:
[Email protected] packages]# rpm-ivh/mnt/packages/zsh-4.3.10-7.el6.x86_64.rpm
[Email protected] packages]# Cat/etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/dash
/bin/tcsh
/bin/csh
/bin/zsh
What is zsh?
Zsh is a shell height-compatible bash under UNIX systems
Rpm-q zsh (check if zsh software is installed) If it is listed, it will be installed.
[Email protected] packages]# rpm-q zsh
Zsh-4.3.10-7.el6.x86_64
installing software with Yum
Yum automatically resolves dependencies and automatically downloads packages. Based on c/s mechanism.
S:
the directory where the root of the disc is directly used (/media/xxx or /mnt)
C: Configure the Yum source configuration file
[Email protected] ~]# Cat/etc/yum.repos.d/test.repo
[Name] # is used to differentiate between different Yum package libraries, where multiple yum sources are named to be unique
Name=test # used to describe the package library arbitrarily
Baseurl=file:///mnt ( the directory where repodata resides)#Repodata is used to resolve yum dependencies. If the network Yum source is also assigned to the directory where the Repodata directory is located
#baseurl =http://mirrors.ustc.edu.cn/centos/6.7/os/x86_64/
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7F/73/wKioL1cfNZjh-_PMAALLwU4Zwqs252.jpg "title=" Qq20160426172747.jpg "alt=" Wkiol1cfnzjh-_pmaallwu4zwqs252.jpg "/>
Enabled=1 # default = 1 means enable this yum source
Gpgcheck=0 # 1 use public key to verify rpm correctness 0 not detected
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release
Yum use
1 Mount Mount
Mount/dev/sr0/mnt
2 Yum Clean all clears the local cache
Yum list List of packages that can be installed
3 yum Install zsh # installation
Yum Grouplist
[Email protected]~]# Yum grouplist | grep dev*
Additional Development
Debugging Tools
Desktop
Desktop Debugging and Performance Tools
Desktop Platform
Generalpurpose Desktop
Desktop Platform Development
Development tools
KDE Desktop
Remote Desktop Clients
Server Platform Development
[[email protected] ~]# yum Groupinstall "Development tools" # Linux space represents the delimiter to use "" to represent a whole Linux Single quotation marks all strings in the original output are not translated. Double quotes will explain the meaning of special characters
Yum Query
[email protected] ~]# Yum Search zsh
Loaded Plugins:fastestmirror,refresh-packagekit, security
Loading mirror speeds from cached hostfile
=============================== n/smatched:zsh ===============================
Python-twisted-core-zsh.x86_64:tabcompletion for zsh and twisted core
Zsh-html.x86_64:zsh Shell Manual in Htmlformat
Zsh.x86_64:a Powerful Interactive shell
[[email protected] ~]# rpm-qpi/mnt/packages/zsh-4.3.10-7.el6.x86_64.rpm View the role of a package
# Unused packets -PQI installed with -qi
Yum Delete
Yum Remove zsh
[Email protected] ~]# rpm-q zsh
Package zsh are not installed
do not interactively install -y
Yum Install-y zsh
Source Code Compilation installation package
Prerequisites: system must be installed: Development tools Development Library.
Steps:
1 getting the source package
2 Decompression
TAR-ZXVF/-JXVF
3 Configuring The detection installation environment
./configure # Check if the installation environment meets your needs, and if no problem, generate the Makefile file
4 Compiling
make (reads the Makefile file at compile time )
5 Installation
Make install
6 Delete
Make Uninstall
[Email protected] ~]# tar-jxvfextundelete-0.2.4.tar.bz2
[Email protected] ~]# CD extundelete-0.2.4
[Email protected] Extundelete-0.2.4]#./configure
Configuring Extundelete 0.2.4
Configure:error:Can ' t find ext2fs Library
[email protected] packages]# Yum search *2fs*
Loaded Plugins:fastestmirror,refresh-packagekit, security
Loading mirror speeds from cached hostfile
Warning:no matches found for:e2fsprogs-1.41.12-18.el6.x86_64.rpm
Warning:no matches found for:e2fsprogs-devel-1.41.12-18.el6.i686.rpm
Warning:no matches found for:e2fsprogs-devel-1.41.12-18.el6.x86_64.rpm
Warning:no matches found for:e2fsprogs-libs-1.41.12-18.el6.i686.rpm
Warning:no matches found for:e2fsprogs-libs-1.41.12-18.el6.x86_64.rpm
[Email protected] packages]# rpm-ivhe2fsprogs-devel-1.41.12-18.el6.x86_64.rpm
[Email protected]]# rpm-ivh e2fsprogs-libs-1.41.12-18.el6.x86_64.rpm
D
[Email protected] extundelete-0.2.4]# ./configure
[[email protected] extundelete-0.2.4]# make
[[email protected] extundelete-0.2.4]# make install
Delete
[Email protected] extundelete-0.2.4]# pwd
/root/extundelete-0.2.4
[Email protected] extundelete-0.2.4]# Makeuninstall
sometimes afraid to delete dirty Add a --prefix parameter to the Configure step during installation . When you delete or back up, you can do this directly on the directory.
[[email protected] extundelete-0.2.4]# Makeclean Empty the file generated at the last compilation
[[email protected] extundelete-0.2.4]#./configure--prefix=/usr/local/extundelete Specify the installation path
[[email protected] extundelete-0.2.4]# make&& make install
[Email protected] ~]# cd/usr/local/
[[email protected] local]# RM-RF extundelete/ so it's clean .
Software Installation Method Features
Rpm+yum: Convenient , low software version. Good stability, management convenience performance slightly worse
Manual: Trouble, software version new. The stability is slightly poor, the management is slightly poor. Good performance
This article is from the "Linux small z" blog, please be sure to keep this source http://3179394.blog.51cto.com/3169394/1767978
Linux Package Management