package manager yum

1. Basic Principles

yum is an rpm-based package manager that enables system administrators to interact and automate finer and more detailed management of RPM packages, automatically download and install RPM packages from specified servers, automatically handle dependencies, and install them once All dependent software packages do not need to be downloaded and installed again and again.
Basic parameters
yum install firefox.x86_64 Download Firefox browser
yum repolist List installation source information
yum remove firefox.x86_64 Remove Firefox browser
yum list firefox.x86_64 Check if Firefox browser exists
in the installation source yum list all List installation sources All software names in
yum list installed List all installed software names
yum list available List software that has no installation source but has not been installed
yum clean all This command performs the operation of clear sky cache when modifying the yum source point,
yum search firefox. x86_64 Search according to the keywords of all software information in the installation source
yum whatprovides */ls Find all software containing ls files in the installation source
yum update Update software
yum history Installation history
yum reinstall firefox. Delete, but use yum install software but report an error when it has already been installed, use
yum info firefox.x86_64 All information about the software, including version, size, etc.
yum groups list software group information
yum groups info softwaregroup View all software included in the software group
yum groups install softwaregroup Install components
package manager yum
package manager yum


Second, the physical machine to configure the installation source

Condition: The same image as the local version (how to check the version, cat /etc/redhat-release)
mount this image on the system or use a directory that I do not use frequently, because after the image is mounted, this directory cannot be Write and all the original files in the subdirectory will not be visible until the mirror is uninstalled.
1. Mount the mirror
mount /iso/rhel-server-7.0-x86_64-dvd.iso /var/www/html/rhel7.0/
2. Write the configuration file for installation in /etc/yum.repo.d/ In the directory, the file ending with .repo
vim /etc/yum.repo.d/yum.repo
[rhel_dvd]
name=rhel_dvd #The name does not matter, but for the convenience of future identification, try to be as clear as possible
baseurl=file:///var /www/html/rhel7.0/ #file:// is the format, followed by the place where the mirror is mounted
gpgcheck=0 #Setting to 0 means that third-party software can be installed in the system
3. Because yum has been configured source, so try to use yum clean all to clear the cache.
At this time, you can install all the software packages in the
mirror. 4. Uninstall the mirror after use
umount /var/www/html/rhel7.0


3. Configure the installation source for the virtual machine

Condition: Mirror, the physical machine has http service
1. Use the operation in the second part to download the http service in the physical machine. The default publishing directory of the http service is the /var/www/html directory, create a directory under this directory, Mount the image in this directory and start the httpd service
yum install httpd -y
mkdir /var/www/html/rhel7.0
mount /iso/rhel-server-7.0-x86_64-dvd.iso /var/www/html/ rhel7.0/
2. Perform the yum configuration file in the virtual machine
vim /etc/yum.repo.d/yum.repo
[rhel_dvd]
name=rhel_dvd #The name does not matter, but for the convenience of future identification, try to be as clear as possible
baseurl= http: ///rhel7.0/ #Compared to the virtual machine, mounting /var/www/html is equivalent to the root directory
gpgcheck=0 #Setting to 0 means that third-party software can be installed in the system
3, yum clean all operation, then the virtual machine can install the software


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324882078&siteId=291194637