First, the software installation:
1, compile and install: After compiling the source program to install on demand
Advantages: the installation process control, according to the real needs of the installation (the installation location, modules choose)
Cons: Installation process is very slow and complicated
2, rpm rpm to install a mounting :( suffix installation package rpm)
Pros: Very easy to install and uninstall process
Disadvantages: the installation process is not controllable (mounting position, mounting those functional modules)
Rpm package dependencies are complex
3, yum install
yum installation, in fact, the automatic analyzer rpm package dependencies, and sequentially in the order required to install
4, green installation:
After unpacking can be used without any operation
Two, rpm operation: (Redhat Package Manager)
rpm operation can be done:
install software
Uninstall software
Query software information
Upgrade, downgrade
test
Packager
1, the installation package rpm:
[Root @ ken ~] #rpm -ivh package names (① installation package in the current directory, ② package name ends with rpm)
Options:
-i: Install the software
-v: shows the installation process
- h: the installation progress represented by # (#% 2)
-vv: display detailed installation information
-vvv: display more detailed information of the installation procedure
2, uninstall the rpm package:
[Root @ ken ~] #rpm -e Software name
3, query rpm package installed:
[Root @ ken ~] #rpm -q Software name
Options:
-q: (query) query software is installed (inquiries rpm and yum to install packages, see compile and install the package)
-qa: query all software
-ql: See all the files generated by the software
-qf: View files rely on software
rpm -qa | wc -l to see how many installed packages
When you get up in the system:
Check the system log: tail / var / log / messages
Check your log files: rpm -ql
4. Review the file which is generated by the software
[Root @ ken ~] #rpm -qf / path (Which lookup)
rpm [root @ ken ~] # -qf `which cd` view cd command depends on which program
5. Upgrade Software
Options:
-U: upgrade or install software
-F: just upgrade
Using the format:
rpm -Fvh package names
rpm -Uvh package names
Three, yum:
1. Install the software
[Root @ ken ~] #yum -y install software Software 1 2 3 .... Software
2. Uninstall software
[Root @ ken ~] #yum -y remove Software Software 1 2 3 .... Software
3. Management Pack group
grouplist: View the system in all group packages
groupinfo package Group name: Displays the information packet group (group action package, including software)
groupinstall package group name: Install the specified package group
groupremove package group name: Uninstall the specified package group
CentOS7: Command Line Interface upgraded graphical interface
yum groupinstall "X Window System" -y
yum groupinstall "GNOME Desktop" "Graphical Administration Tools" -y
At this time, we can enter the command startx graphical interface, first entered will be relatively slow, please be patient. (You may need to restart the command to reboot)
4. The cache data management yum
clean [ packages | metadata | all ]
5. Review all installed and not yet installed rpm package
[Root @ ken ~] #yum list all or yum list list all packages
Yum list | grep "Redis"
The display can be installed, but not yet installed rpm package
[root@ken ~]#yum list available
The display package has been installed rpm
[root@ken ~]#yum list installed
(@: That is already installed rpm)
8. Review the information yum repository
[root@ken ~]#yum repolist
Four, yum works:
We need to create a yum repository (rpm package warehouses, depots)
1) warehouse is actually a directory
2) is stored in a warehouse rpm package
3) warehouse also stores a file repodata, file metadata recorded all the rpm package information repository
4) the metadata information comprises
Software name
Software version
Whether the software has been installed
Software dependencies
yum configuration file:
Local: The local directory made a yum repository, only the current system can
Network: The network will be a directory on the server as a yum repository, all hosts in the network can be used
Use yum warehouse way is to modify the yum configuration file
yum configuration file
Main: /etc/yum.conf
Sub: /etc/yum.repos.d / * repo.
[LocalRpm] <<< designated yum repository id, can easily write, but without spaces
name = xxx <<< specify the name of yum repository, you can easily write
enabled = 0 | 1 <<< specify whether to use the yum repository, 0 is not used; 1 indicates use
gpgcheck = 0 | 1 <<< specify whether to make the rpm package integrity verification and source of legitimacy, 0 means no verification; 1 represents a verification must be done
gpgkey = <<< specified public key file (if gpgcheck = 1, then this can be omitted)
baseurl = <<< designated yum repository url (repodata higher path, local file: // network http: //
cost = 1 <<< designated warehouse priority, the higher priority the smaller the value
Fifth, create a local yum repository
Rpm packages using the CD-ROM as a yum repository
The first step: mount the CD
[root@ken ~]# mount /dev/cdrom /wete
Step Two: Back up the configuration file that comes with yum
[root@ken ~]# cd /etc/yum.repos.d
[root@ken ~]# mkdir ww
[root@ken ~]# mv *.repo ww ( mv C* ww)
Step 3: Create yum configuration file, use the CD as a yum repository
[root@ken ~]# vim 1.repo
[myrepo]
name=my repo
enabled=1
gpgcheck=0(=1, gpgcheck=file:///mnt/RPM-KEY=CentOS-7)
baseurl = file: /// law (repodata)
cost=1
Step Four: Execute the command yum detection results
All data [root @ ken ~] # yum clean all <<< empty cache yum
[Root @ ken ~] # yum repolist <<< check yum repository how many rpm package available
Sixth, the use of network yum source
1. Domestic mainstream network yum repository address
mirrors.aliyun.com
mirrors.163.com
mirrors.sohu.com
The source rpm yum
centos provided
epel provided:
Examples: Use epel and centos aliyun source provided yum
cd /etc/yum.repos.d
mkdir zyp
mv *.repo zyp
vim new.repo
[warm]
name = warm
enabled = 1
gpgcheck = 0
baseurl = https: //mirrors.aliyun.com/epel/7/x86_64/
[Centos]
name=centos base
enabled=1
gpgcheck=0
baseurl = http: //mirrors.163.com/centos/7/os/x86_64/
2, create rpm Warehouse:
yum install -y createrepo rpm installation tool to create the library
Create a directory mkdir zyp
cp redis lib64 zyp rpm package into the directory
createrepo zyp library directory created as rpm (generates repodata)
vim after editing the configuration file save and exit /etc/yum.repos./*.zyp
yum clean all Clear Cache
yum repolist information listed warehouse
Yum install lrzsz -y: file transfer between windows and linux
rz: windows linux file upload
sz: linux to windows file upload
Operation in the shell