Three ways to install a software package
Three ways to install a software package
Rpm tool
Yum tool
Source code packet
Rpm installation and uninstallation
First mount the optical drive device
Mount / dev/cdrom / mnt/
Install a rpm package
Rpm-ivh + package full name
"- I": the meaning of installation
"- v": visualization
"- h": shows the progress of installation
Rpm-ivh-- force + package full name
Rpm-ivh-- nodeps + package full name
-nodeps: when the rpm package to be installed depends on other packages, install this package even if the other packages are not installed
-- force: force installation, even if files belonging to other packages are overwritten
Upgrade a rpm package
Rpm-Uvh package name
"- U": it means to upgrade
Uninstall a rpm package
Rpm-e package name
"- e": uninstall means rpm query
Rpm query
Query whether a package is installed
Rpm-Q rpm package name
Query all installed rpm packages on the current system
Rpm-qa package name
Get information about an installed RPM package
Rpm-qi package name
List a file installed by the rpm package
Rpm-ql package name
List which rpm package a file belongs to
Rpm-absolute path to the qf file
# detailed explanation of yum tool
List all available rpm packages
Yum list
List all available yum resource suites
Yum grouplist
LANG=en switches the language to English LANG=zh_CN.UTF-8 switches the language to Chinese
Search for a rpm package
Yum package name (containing related keywords)
Install a rpm package
Yum install-y package name. Rpm
-y do not ask to install the associated package
Uninstall a rpm package
Yum remove-y package name. Rpm
Upgrade a rpm package
Yum update-y package name. Rpm
Install according to yum Resource Kit
Yum groupinstall Resource Suite name
Uninstall according to yum Resource Suite
Yum groupremove Resource Suite name
Build a local yum warehouse
Mount the CD
Mount / dev/cdrom / mnt
Delete all repo files in the / etc/yum.repos.d directory
[root@ruirui etc] # cd / etc/ [root@ruirui etc] # cp-r yum.repos.d/ yum.repos.d.back [root@ruirui etc] # cd yum.repos.d [root@ruirui yum.repos.d] # lsCentOS-Base.repo CentOS-Media.repo epel.repoCentOS-Debuginfo.repo CentOS-Vault.repo epel-testing.repo [root@ruirui yum.repos.d] # rm-rf CentOS-Base.repo [root@ruirui yum.repos.d] # vim CentOS -Media.repo# is modified to [local_carom] name=CDbaseurl= file:///mnt/gpgcheck=1enabled=0#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Yum clean all
Yum changes domestic sources
Cd / etc/yum.repos.d
Rm-f dvd.repo
Wet http://mirrors.163.com/.help/CentOS7-Base-163.repo
Or
Curl-O http://mirrors.163.com/.help/CentOS7-Base-163.repo
Yum list
# download rpm package from yum
Install the extended source epel
Yum install-y epel-release
Yum list | grep epel
Yum downloads the rpm package
Yum install-y package name-- downloadonly
-- download downloadonly but not install it
Download in / var/cache/yum/x86_64/7/ file
Yum install-y package name-- downloadonly-- downloaddir= path
Yum reinstall-y package name-- downloadonly-- downloaddir= path
Source package installation
Cd / usr/local/src/
Wget http://mirrors.cnnic/apache/httpd/httpd-2.2.32.tar.gz
Tsr zxvf httpd-2.2.32.tar.gz
Cd httpd-2.2.32
. / configure-- prefix=/usr/loacal/apache2
Make
Make install
To uninstall is to delete the installed files.