Yum常用的一些配置

发表于 2019-06-09  2.06k 次阅读


安装epel

#6版本
rpm -ivh https://archives.fedoraproject.org/pub/archive/epel/6/x86_64/Packages/e/epel-release-6-8.noarch.rpm
#7版本
rpm -ivh https://mirrors.ustc.edu.cn/epel/7/x86_64/Packages/e/epel-release-7-13.noarch.rpm
#8版本
rpm -ivh https://mirrors.ustc.edu.cn/epel/8/Everything/x86_64/Packages/e/epel-release-8-19.el8.noarch.rpm

yum自动选择快速源配置

yum install yum-plugin-fastestmirror.noarch -y
vi /etc/yum.conf
plugins=1 #1为启用插件,启用yum-plugin-fastestmirror这个插件,0为不启用

yum多线程配置

#安装epel源
yum install yum-axelget
yum install yum-plugin-fastestmirror.noarch -y
vi /etc/yum.conf
plugins=1 #1为启用插件,启用yum-plugin-fastestmirror这个插件,0为不启用

yum缓存配置

vi /etc/yum.conf
keepcache=1 #1为启用缓存安装包时会缓存一份到本地,0为不启用也就是不保存(默认)
cachedir=/var/cache/yum #默认缓存目录,可自行更改

yum代理配置

vi /etc/yum.conf
proxy=http://210.45.72.XX:808
proxy_username=username
proxy_password=password
#临时方法:
export http_proxy=http://username:password@proxyip:proxyprot
export https_proxy=https://username:password@proxyip:proxyprot

yum禁止更新特定软件包

vi /etc/yum.conf
exclude=kernel*      #禁止kernel开头的包更新

常用yum源站

阿里巴巴镜像站:https://mirrors.aliyun.com
网易开源镜像站:http://mirrors.163.com/
centos镜像站:http://mirror.centos.org/
北京理工大学:http://mirror.bit.edu.cn/web/
清华大学:https://mirrors.tuna.tsinghua.edu.cn/
中国科学技术大学:http://mirrors.ustc.edu.cn/

本站文章基于国际协议BY-NA-SA 4.0协议共享;
如未特殊说明,本站文章皆为原创文章,请规范转载。

0

scanz个人博客