linux centos 配置yum源步骤及操作方法

一、了解yum源是什么。
二、如何更换yum源。

一、yum源是什么?
linux下方便安装软件的优秀工具称之为yum工具,linux的二级制软件包一般为rpm包,类似于windows下的exe程序。通过yum工具安装,默认获取的rpm包的软件配置一般为国外centos官方源下载,所以安装软件会速度较慢,因此需要将默认rpm包的配置由国外官方源改为国内
二、如何更换yum源?
通过了解,我们已经知道了yum源是什么东西,但怎么更换呢?那么下面就让我们一步步开始更换
1、首先进入linux的 etc/yum.repos.d 目录下,将Centos-Base.repo进行备份

cd /etc/yum.repos.d
zip Centos-Base.repo.zip Centos-Base.repo

2、删除Centos-Base.repo

rm Centos-Base.repo

3、下载yum源到etc/yum.repos.d文件目录下

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

4、清理yum并生成缓存

yum clean all

这里替换的是阿里提供的yum源,我们也可以将自己的iso镜像或者光盘配置为yum源下面有其他yum源的地址

阿里:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
网易:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

原创文章 1 获赞 3 访问量 170

猜你喜欢

转载自blog.csdn.net/qq_40171348/article/details/105799425
今日推荐