7.1 Three Ways to install packages:
RPM Tools
The RPM command is a management tool for RPM packages. RPM was originally a red Hat Linux distribution program designed to manage Linux packages and is popular because it follows GPL rules and is powerful and convenient. is gradually being adopted by other distributions. The advent of RPM suite management means that Linux is easy to install and upgrade, which indirectly increases the applicability of Linux.
2.yum Tools
Yum (full name Yellow dog Updater, Modified) is a in Fedora and Redhat and CentOS Shell Front-end package manager. Based on rpm package management, the ability to automatically download RPM packages from specified servers and install them automatically handles dependency relationships and installs all dependent packages at once, without the hassle of downloading and installing them over and over again.
3. Source code Package
Source package is open source, directly find the official website address, on the system directly link installation to the specified directory, is generally/usr/local/src/plus file name.
7.2 RPM Package Description:
1, in the Virtual Machine Connection system installation package, the device status needs to be connected.
650) this.width=650; "Src=" Https://s4.51cto.com/oss/201711/13/0e6403684489eb5c1906ba2546aa79b4.png-wh_500x0-wm_3 -wmp_4-s_1645864242.png "title=" 1.png "alt=" 0e6403684489eb5c1906ba2546aa79b4.png-wh_ "/>
2. Use the mount command to mount the mirror disk to the/mnt/directory.
[[email protected] ~]# mount /dev/cdrom /mnt/ // Mount mount: /dev/sr0 write protection, will be mounted in read-only mode [[email protected]-01 ~]# cd /mnt //into the/mnt directory [[email protected] mnt ]# ls //View the contents of the Mount in the directory (the file used when installing the system, one of the packages files is a RPM package.) centos_buildtag efi eula gpl images isolinux LiveOS Packages repodata RPM-GPG-KEY-CentOS-7 Rpm-gpg-key-centos-testing-7 trans. Tbl[[email protected] mnt]# cd paCkages/[[email protected] packages]# lsatchdog-5.13-11.el7.x86_64.rpmwavpack-4.60.1-9.el7.x86_ 64.rpmwebkitgtk3-2.4.9-6.el7.x86_64.rpmwebrtc-audio-processing-0.1-5.el7.x86_64.rpmwget-1.14-13.el7.x86_64. Rpmwhich-2.20-7.el7.x86_64.rpmwhois-5.1.1-2.el7.x86_64.rpmwireshark-1.10.14-10.el7.x86_64. rpmwireshark-gnome-1.10.14-10.el7.x86_64.rpmzenity-3.8.0-5.el7.x86_64.rpm ..... The above examples are listed, not and these.
Read the characteristics of RPM package file name:
Example file: wireshark-1.10.14-10.el7.x86_64.rpm
Wireshark: Package Name
1.10.14: Version number
10.EL7: Release version number
X86_64: Platform
. RPM: Suffix name
7.3 RPM Tool Usage:
RPM-IVH RPM Package File//Installation
RPM-UVH RPM Package File//Upgrade
RPM-E Package name//Uninstall
RPM-QA//Query installed packages
RPM-Q Package Name//query Specifies whether the package is installed
RPM-QI Package name//Query Specify package information
RPM-QL Package name//list package installed files
RPM-QF file Absolute path//view which package the file was installed by
Expand Knowledge Points:
[[email protected] packages]# RPM-QF ' which CD '//When you do not know the absolute path of the file using the need to query the installation package command to use to see which package is installed
Bash-4.2.46-20.el7_2.x86_64
7.4 Yum Tool Usage:
Yum list//list available RPM packages
ls/etc/yum.repos.d///View Yum configuration file
Yum Search vim (package name)//Search Package
Yum install [-y] Package name//Use the Yum installation package, plus-y is not asked to install directly
Yum grouplist//List of groups that can be installed
Yum Groupinstall [-y] Group name//install group inside package, plus-y is not asked to install directly
Yum remove [-y] Package name//Uninstall installation package (will unload dependent packages)
Yum update [-y] Package name//upgrade installation package (if the package name is not added, the system RPM package will be upgraded to the latest, including the system)
Yum provides "/*/vim"//when the system does not have this command, you do not know the installation package, you can search through the command to see what the installation package, if the system does not have this command.
Expand Knowledge Points:
In the following example, grep is a tool that filters the specified string, and the function of | is to filter the VIM package name by the result of the Yum list output.
[[email protected] packages]# yum list |grep ' Vim ' vim-common.x86_64 2:7.4.160-2.el7 @basevim-enhanced.x86_64 2:7.4.160-2.el7 @basevim-filesystem.x86_64 2:7.4.160-2.el7 @ basevim-minimal.x86_64 2:7.4.160-1.el7 @anacondaprotobuf-vim.x86_64 2.5.0-8.el7 basevim-x11.x86_64 2:7.4.160-2.el7 basevim-minimal.x86_64 2:7.4.160-2.el7 base
7.5 Yum to build a local warehouse:
The action Steps command is as follows:
Mount the image to the/MNT directory
Cp-r/etc/yum.repos.d/etc/yum.repos.d.bak
Rm-f/etc/yum.repos.d/*
Vim/etc/yum.repos.d/dvd.repo//content is as follows
[DVD]
Name=install DVD
Baseurl=file:///mnt
Enable=1
Gpgcheck=0
Yum Clean All
Yum List
The experimental steps are as follows:
[[email protected] ~]# cp-r/etc/yum.repos.d/etc/yum.repos.d.bak//To ensure that deleted files are not lost, first make a backup, copy the directory [[email protected] ~]# cd/e Tc/yum.repos.d[[email protected] yum.repos.d]# Lscentos-base.repo Centos-cr.repo Centos-debuginfo.repo Centos-fasttrack.repo Centos-media.repo Centos-sources.repo ce[[email protected] yum.repos.d]# RM-RF./*//Put all repo All files are deleted [[email protected] yum.repos.d]# VI Dvd.repo//Create a Dvd.repo file, enter the following configuration information into this file, save exit.
650) this.width=650; "Src=" Https://s2.51cto.com/oss/201711/13/378ec47c090a2feb5ac591df7365e227.png-wh_500x0-wm_3 -wmp_4-s_2718490714.png "title=" 2.png "alt=" 378ec47c090a2feb5ac591df7365e227.png-wh_ "/>
[[email protected] yum.repos.d]# Yum Clean all//cleanup cache loaded plugin before: Fastestmirror is cleaning up the software source: dvdcleaning up Everythingcleanin G up list of fastest mirrors[[email protected] yum.repos.d]# Yum list
650) this.width=650; "Src=" Https://s1.51cto.com/oss/201711/13/b13821c82572d96e9bcf69c7ed5f9db7.png-wh_500x0-wm_3 -wmp_4-s_1929468369.png "title=" 3.png "alt=" B13821c82572d96e9bcf69c7ed5f9db7.png-wh_ "/>
Delete Dvd.repo This file, copy the file back.
[[email protected] yum.repos.d]# lsdvd.repo[[email protected] yum.repos.d]# rm-f dvd.repo[[email protected] Yum.repos.d ]# CP. /yum.repos.d.bak/*. [Email protected] yum.repos.d]# Lscentos-base.repo Centos-debuginfo.repo Centos-media.repo centos-vault.repocentos- Cr.repo Centos-fasttrack.repo Centos-sources.repo
Role: The use of local CD-ROM as a storage can be very convenient to install some dependent packages, if you do not install Yum, using RPM package installation will have a lot of dependent packages, a depends on b\b dependency C, this will be very troublesome, using the Yum local warehouse installation will be very convenient, directly to help you install.
This article is from the "Gary Blog" blog, please be sure to keep this source http://taoxie.blog.51cto.com/10245493/1981419
Linux rpm, yum tool usage