Redhat多版本通用的yum配置
来源:互联网 发布:慢跑穿什么衣服知乎 编辑:程序博客网 时间:2024/04/29 18:17
这是我整理的Redhat多版本通用的yum配置, 复制以下全文并粘贴到Shell中执行即可, 相当方便
#1.删除RHEL插件
rpm -q yum-rhn-plugin >/dev/null && rpm -e --nodeps yum-rhn-plugin#2.编辑新配置文件
cat > /etc/yum.conf.new << EOF
[main]
cachedir=/var/cache/yum/\$basearch/\$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
#metadata_expire=1800
[base]
name=CentOS - Base
mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-\$releasever
[updates]
name=CentOS - Updates
mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-\$releasever
[extras]
name=CentOS - Extras
mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-\$releasever
[centosplus]
name=CentOS - Plus
mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=centosplus
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-\$releasever
enabled=0
[contrib]
name=CentOS - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=contrib
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-\$releasever
enabled=0
EOF
#3.替换配置文件
/bin/mv /etc/yum.conf /etc/yum.conf.$(date +%s)
/bin/mv /etc/yum.conf.new /etc/yum.conf
test -e /etc/yum.repos.d && /bin/mv /etc/yum.repos.d /etc/yum.repos.d.$(date +%s)
#4.写入大版本号
test ! -e /etc/yum/vars && mkdir -p /etc/yum/vars
lsb_release -r | awk -F "[ \t.]*" '{print $2}' > /etc/yum/vars/releasever
#如果没有lsb_release命令, 那么手工写入版本号也可以. 比如Redhat6.4, 需要这么做: echo 6 > /etc/yum/vars/releasever
0 0
- Redhat多版本通用的yum配置
- redhat 的 yum 配置
- redhat本地yum的配置
- RedHat Linux Enterprise 5 yum的配置
- redhat配置免费YUM的方法
- redhat网易yum源的配置
- RedHat Linux 本地yum源的配置
- redhat 6.3 yum本地源的配置
- Redhat配置使用centos的yum源
- redhat yum配置CentOS的源
- redhat 系统 配置 CentOS的yum源
- RedHat配置CentOs的yum源
- redhat yum 源配置
- RedHat yum 源配置
- redhat 配置yum源
- redhat 6配置yum
- RedHat yum 源配置
- Redhat 5.2 Yum 配置
- 习近平会晤奥巴马:感谢美国参与马航搜救
- 有用的UI效果
- java.lang.ClassFormatError: Illegal UTF8 string in constant pool in class file Server/Request
- C# 接口(一)
- 深入理解JavaScript系列(15):函数(Functions)
- Redhat多版本通用的yum配置
- 深入理解JavaScript系列(16):闭包(Closures)
- C# 接口(二)
- 给定一个字符串如何判断该字符串中某一字符出现的频率并找出出现频率最高的字符和频率
- 新人报道
- Java中中文MD5加密结果不一致
- Java 8新特性探究(八)精简的JRE详解
- 位运算及其应用
- 深入理解JavaScript系列(17):面向对象编程之一般理论