Linux Package Management
RPM Command Management
There are two ways to install 1 rpm 2 Yum
RPM Naming conventions and dependencies
httpd-2.2.15-15.eld.centos.1.i686.rpm//Package Full Name
HTTPD Package Name
2.2.15 software version
15 release Times
E16.centos for the Linux platform//noarch that's all right
i686 Suitable hardware platform//If it's x64, then it's X64.
RPM extension
RPM Package Dependent
Tree-dependent
Ring dependent
Module dependencies are prompts during the installation process. So. number end of file, then how to resolve
Www.rpmfind.net
Experiment 1
Mount after inserting the disc
1 Mkdir/mnt/cdrom
2mount/dev/sr0/mnt/cdrom
3 RPM-IVH a Package
2RPM Command Management
1 package full name and package name
If the package is not installed, then use the package full name
If it is an installed package, use the package name to store the package name in the var/lib/rpm
When installing and updating, use the package name when uninstalling and querying.
RPM-IVH Package Full Name
-I Installation
-V Show More information
-H Show Progress
Install an Apache server
Upgrade Rpm-u Package Full Name
RPM-E Uninstall
RPM Query
Queries can only be checked with RPM.
RPM-Q Package Name Query whether this package is installed
RPM-QA Querying all installed packages
Rpm-qa | grep httpd queries all httpd-related packages | Called Pipe character
Query Package Installation location query does not install package location
RPM-QL Package name RPM-QLP package name
RPM Checksum file extraction
Rpm-v Installed package Name
Can see if this RPM package has been modified
File extraction: If you delete it by mistake, you can extract it from the RPM.
1 Convert files to cpio file 2cpio extract
Rpm2cpio
For example, I have now removed the LS command, which is actually to cut away
1 query which rpm the LS belongs to
[Ro[email protected] packages]# Rpm-qf/bin/ls
Coreutils-8.4-31.el6_5.2.x86_64
2 Shear Away LS
[Email protected] packages]# mv/bin/ls/tmp
[Email protected] packages]#
[[email protected] packages]# ls
-bash:/bin/ls: No file or directory
3 [[email protected] packages]# rpm2cpio/mnt/cdrom/packages/coreutils-8.4-31.el6.x86_64.rpm | Cpio-idv./bin/ls
4 Cp/root/bin/ls/bin
3 Yum Online Management
Yum does not necessarily need to surf the Internet, the local CD source is also possible
1 IP address configuration and network Yum source
Setup is configured with a good address
Then enter the configuration file
[Email protected] packages]# Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Modify Onboot =yes
Then service network restart
Network Yum Source
Default: The Yum source of the official CentOS website
[Email protected] packages]# cd/etc/yum.repos.d/
[[email protected] yum.repos.d]# ls
Centos-base.repo Centos-media.repo
Centos-debuginfo.repo Centos-vault.rep
This is the default Yum source, which has a default of 4 yum sources
Yum Online Installation
1 Querying Installable files Yum List
2 Find Yum Search
3 Installing yum-y install httpd yum-y install GCC
4 Upgrade yum-y Update gcc
If yum-y update (discreet!!) Upgrade system)
5 Uninstalling Yum-y Remove gcc
Yum group installation, which is the installation of system functions
View installable system features Yum Grouplist
Installing the system features Yum Groupinstall "software name" NOTE: It's best to install it on a virtual machine, or it won't fit in Chinese.
Uninstall Yum Groupremove "Package"
SOURCE Package Installation
Before installation: The difference between concepts
The difference after installation: The difference between the installation location
RPM Package: Default location How to check location: RPM-QL httpd
1/ETC configuration File installation directory
2/ust/bin executable Command installation directory
3/usr/lib where the library of functions used by the program is saved
4/usr/share/doc Basic software User manual save location
5/usr/share/man Help File Save location
Source Package Installation Location:
Generally it is/usr/local/software name/
Due to the different installation location, the management methods brought by different
RPM Package services can be managed using the System command service
/ETC/RC.D/INIT.D/HTTPD start all systems are ready for use.
Service httpd start Red Hat series dedicated
The source package can only be accessed by an absolute path.
/usr/local/apache2/bin/apachectl start
Install the source package
1 Installing the GCC compiler
2 Download the source package take Apache as an example
http://mirror.bit.edu.cn/apache/httpd/
3 Source Package Save location:/usr/local/src/
Software Installation Location:/usr/local/
How to determine the installation process error: 1 Stop 2 errors appear
4 Download the source package to Windows, and then upload it via FTP to the Linux/root directory to
5 then unzip the TAR-ZXVF source package
6 See how big Do-sh extracted files
7 Entering the Unzip directory
1 views./config--Help directory
2 Setting the installation path
./config--Prefix =/usr/loval/apache2
3 Make compilation
Direct make
If an error occurs: Make clean
4 Male Install
If you uninstall
Delete files directly
Linux Package Management