CentOS7 configuration Alibaba Cloud yum source method code

CentOS7 configuration Alibaba Cloud yum source method code

Open the centos yum folder

Enter the command cd /etc/yum.repos.d/

Download the repo file with wget

Enter the command wget http://mirrors.aliyun.com/repo/Centos-7.repo

If the wget command does not work, it means that the wget tool has not been installed. Enter yum -y install wget and press Enter to install it.

The current directory is /etc/yum.repos.d/, and the Centos-7.repo just downloaded is also in this directory

Backup

[root@bogon ~]# cd /etc/yum.repos.d/
[root@bogon yum.repos.d]# mkdir repo_bak
[root@bogon yum.repos.d]# mv *.repo repo_bak/
[root@bogon yum.repos.d]# ls
repo_bak

Download the new CentOS-Base.repo to /etc/yum.repos.d/

wget -O /etc/yum.repos.d/CentOS-Base.repo
[root@bogon yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
--2018-02-09 16:33:46-- http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 124.14.2.234, 124.14.2.235, 124.14.2.217, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|124.14.2.234|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2573 (2.5K) [application/octet-stream]
Saving to: '/etc/yum.repos.d/CentOS-Base.repo'

100%[===========================================================================================>] 2,573 --.-K/s in 0s   

2018-02-09 16:33:47 (182 MB/s) - '/etc/yum.repos.d/CentOS-Base.repo' saved [2573/2573]

[root@bogon yum.repos.d]# ls
CentOS-Base.repo repo_bak

Then run yum clean all to clear the cache and run yum makecache to generate a new cache.

[root@bogon yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@bogon yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00   
extras | 3.4 kB 00:00:00   
updates | 3.4 kB 00:00:00   
(1/12): base/7/x86_64/group_gz | 156 kB 00:00:00   
(2/12): extras/7/x86_64/filelists_db | 636 kB 00:00:07   
(3/12): extras/7/x86_64/primary_db 

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of using yum source in CentOS7 Alibaba Cloud

<<:  MySQL 5.7.17 free installation version configuration method graphic tutorial (windows10)

>>:  Vue implements book management case

Recommend

WeChat applet custom tabbar component

This article shares the specific code of the WeCh...

How to view the network routing table in Ubuntu

What are Routing and Routing Table in Linux? The ...

The pitfall of MySQL numeric type auto-increment

When designing table structures, numeric types ar...

JS implements a detailed plan for the smooth version of the progress bar

The progress bar is not smooth I believe that mos...

Detailed analysis of mysql MDL metadata lock

Preface: When you execute a SQL statement in MySQ...

Shtml Concise Tutorial

Shtml and asp are similar. In files named shtml, s...

How to use Linux paste command

01. Command Overview The paste command will merge...

Tomcat8 uses cronolog to split Catalina.Out logs

background If the catalina.out log file generated...

JS operation object array to achieve add, delete, modify and query example code

1. Introduction Recently, I helped a friend to ma...

The past two years with user experience

<br />It has been no more than two years sin...

InnoDB engine redo file maintenance method

If you want to adjust the size and number of Inno...

How to mount a data disk on Tencent Cloud Server Centos

First, check whether the hard disk device has a d...