The use of yum command and software installation

提示:以下是本篇文章正文内容,下面案例可供参考

First, the advantages of the yum command

  • The yum command can automatically resolve all dependencies and install all dependent rpm packages, solving the problem of deep dependency and circular dependency in installing software with the rpm command.
  • The yum command can replace the rpm command to perform operations such as installing, querying, and deleting rpm packages.
  • The biggest advantage of the yum command is that when the Linux system is connected to the Internet, you can directly use the yum command to download the required rpm package using the yum source on the Internet. If there is no network, it can be solved by making the local CD into a yum source.

Two, the usage of yum command

  • yum help: will display the usage of each command.
  • yum list: List which rpm packages are installed and which are not. Pipelines and grep can be used for further precise queries.
  • yum search Related keywords: search for rpm packages.
  • yum update rpm package name: upgrade the rpm package.
  • The name of the yum install rpm package: install the rpm package.
  • The name of the yum erase rpm package: delete the rpm package.
  • yum grouplist: List package groups.
  • yum groupinstall "package group name": install the package group.
  • yum groupremove "package group name": delete the package group.

3. Use the local disc to make yum source

1. What is yum source

  • The yum repository refers to a file with the extension .repo in the /etc/yum.repos.d/ directory .
  • This file needs to be created, the file name can be arbitrary, but must be added with the extension .repo . For example: aaa.repo.
    -The premise of configuring the yum source is to mount the CD-ROM. This article has mounted the CD-ROM in /etc/media. Specific mounting method: https://blog.csdn.net/ATTAIN__/article/details/124714346 or see the steps below.

2. Specific production method

insert image description here
insert image description here

如果/etc/yum.repos.d下的.repo文件过多,建议先将yum.repos.d文件备份并改名,然后将原文件夹下的文件全都删除。
For example: # cp -r /etc/yum.repos.d /etc/yum.repos.d_bak
#rm -rf /etc/yum.repos.d/*

insert image description here
insert image description here
insert image description here


4. Some examples of installing software

insert image description here
insert image description here
insert image description here

5. The rpm package can be downloaded with the yum tool

Sometimes we only need to download the rpm package but not install it, but to copy it to other machines. The yum command introduced above downloads and installs the rpm package in one go. The following describes the commands that only download but not install.

在下载之前首先要恢复之前的yum源,对于手动配置yum源操作来说,恢复原来的/etc/yum.repos.d,然后使用yun list命令生成缓存,方便下次使用。

yum install -y package name --downloadonly

  • This command downloads the rpm package to the Packages under the directory mounted on the CD-ROM by default.

yum install -y package name --downloadonly --downloaddir=/usr/local/src

  • Specify to download the rpm package to the /usr/local/src directory

If the downloaded package has already been installed, just use yum reinstall -y package name --downloadonly without uninstalling.

Guess you like

Origin blog.csdn.net/ATTAIN__/article/details/124370525
Recommended