Centos7 Yum command Daquan

Time:2019-12-2

Yum common commands

  • 1. List all updatable software inventory commands: Yum check update
  • 2. Update all software commands: Yum update
  • 3. Install only the specified software command: Yum install < package [name >
  • 4. Update only the specified software command: Yum update < package [name >
  • 5. List all installable software commands: Yum list
  • 6. Delete package command: Yum remove < package ﹐ name >
  • 7. Find package command: Yum search < keyword >
  • 8. Clear cache command:
    Yum clean packages: clear packages under cache directory
    Yum clean headers: clear the headers under the cache directory
    Yum clean oldheaders: clear the old headers in the cache directory
    Yum clean, yum clean all (= Yum clean packages; Yum clean oldheads): clear the packages and old headers under the cache directory
    1. View Yum transaction history: Yum history

After sorting out, no problem was found. The difference between using Yum installation and manual installation is that manual compilation and installation can customize the directory. Not in command on. Yum installation will be installed in different directories according to the Linux standard installation method. There is no professional linxu operation experience, so it is more difficult to find files.

Yum specified directory installation

  • Yum – y install nginx: – y auto answer, no user interaction confirmation is required when executing Yum operation
  • yum -c /etc/my.cnf –installroot=/usr/local/mysql –releasever=/ -y install mysql-server

The command is simply interpreted as follows:

-C / etc / yum.conf means to specify the address of the yum configuration file

–Installroot = / usr / local means to specify a custom installation directory

–Releaser = / specifies the current mirror cache lookup

Yum and new image source

sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

Update Yum cache:

sudo yum makecache fast

Domestic Yum source

Sohu open source image station: http://mirrors.sohu.com
Alicloud image: http://mirrors.aliyun.com
Netease image: http://mirrors.163.com/

systemctl

Systemctl enable docker join boot

Systemctl start docker start

Systemctl stop docker stop

Systemctl status docker view status