Introduction to Linux software installation commands (2)

In order to avoid troublesome rpm installation dependencies, Linux provides yum method for software installation. There are two ways of yum, one depends on the yum source file in the network, and the second is to use the CD to build a yum file locally.

yum source file

[base] The name of the container must be placed in []
name  container name
mirrorlist Mirror site, can be commented out
baseurl The address of the yum source server, and one of mirrorlist
enabled Whether it is valid, if it is not written or written enabled=1, it will be valid, but if it is written enabled=0, it will not be valid
gpgcheck   Digital certificate verification, if it is 0, it is not enabled, it is recommended to enable it as much as possible, if the downloaded installation package is illegal, this verification will report a warning
gpgkey Storage location of digital certificate public key

Local CD build yum source

  1. mikdir /mnt/cdrom #Create a mount point
  2. mount/dev/cdrom /mnt/cdrom/ #mount CD
  3. Make the network yum source invalid, you can change the name, you can add enable=0
  4. Modify the location of the baseurl of yum that mounts the CD locally
  5. Modify enabled=1

Common yum commands

query class

  • yum list query available yum source files
  • yum search keywords to query the installation packages related to keywords on the server

Install

  • yum -y install installation package name

- install means install

- -y means automatic answer yes

You don’t need to write all the names when installing, because yum is preset on the server in advance

upgrade

  • yum -y update install package name

- update means upgrade

- -y means automatic answer yes

yum -y update means to upgrade all installation packages under Linux, including the kernel. Before 6.3, it will definitely cause the system to crash. Operate with caution

uninstall

  • yum -y remove installation package name

- remove means uninstall

- -y means automatic answer yes

Try not to uninstall the software, the installation and uninstallation have dependencies, the uninstalled software may be depended on by other software, causing the system to crash

Guess you like

Origin blog.csdn.net/hezhou876887962/article/details/129772331