Note: Centos7 configure YUM

Please click here to enter image description

Yum (full name Yellow dog Updater, Modified) is a shell front-end package manager in Fedora and RedHat and CentOS. Based on RPM package management, it can automatically download and install RPM packages from a specified server, automatically handle dependencies, and install all dependent packages at one time, without having to download and install tediously again and again.


The YUM of CENTOS generally defaults to foreign sources. It is best to change to domestic sources such as Ali or 163 first. The following is to change to Ali.

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

yum makecache

Explanation of the above command

  1. backup first

  2. Download Ali's YUM package

  3. Update YUM cache

Please click here to enter image description


YUM is stored in

/etc/yum.repos.d/

View how

ll /etc/yum.repos.d/

Please click here to enter image description


You can manually edit the yum file yourself

open one of them

vim CentOS-Base.repo

Please click here to enter image description

simple explanation

cachedir=/var/cache/yum/$basearch/$releasever #yum cache directory after downloading keepcache=0 # Whether to cache, 0 is no cache, 1 is cache debuglevel=2 logfile=/var/log/yum.log # yum installation log exactarch=1 obsoletes=1 gpgcheck=1 # Whether to perform gpg check by default, 0 means no check, 1 check plugins=1 installonly_limit=5 bugtracker_url=https://bugs.centos.org/set_project. php?project_id=23&ref=https://bugs.centos.org/bug_report_page.php?category=yum distroverpkg=centos-release

Detailed description:

https://blog.csdn.net/qq_27754983/article/details/73693061


Check what software list is currently available on yum

yum list

can be filtered

yum list | grep php*

Some commonly used commands include:

Automatically search for the fastest mirror plugin: yum install yum-fastestmirror

Install the yum graphical window plugin: yum install yumex

See a list of possible batch installs: yum grouplist


Example 1, yum installs nginx

rpm package specified

yum install

rpm -ivh https://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.12.2-1.el7_4.ngx.x86_64.rpm

yum install nginx

check rmp -ql nginx


Example 2. YUM installs PHP7.2

yum -y remove php*

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-opcache php72w-pdo php72w-xml php72w-pear php72w-redis php72w-phpunit-PHPUnit php72w-bcmath

Command description:

  1. uninstall the original php

  2. update source

  3. Install a set


Finish


Guess you like

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