RHEL 6.4使用CentOS 6.4 yum源更新-x86_64的脚本
来源:互联网 发布:coreldraw x6破解软件 编辑:程序博客网 时间:2024/06/09 17:54
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script"
exit 1
fi
clear
echo "========================================================================="
echo "Replace Redhat Enterprise Yum to CentOS Yum and Repos, Written by Licess"
echo "========================================================================="
# uninstall rhel yum
echo "Uninstall Rhel Yum......"
rpm -qa|grep yum|xargs rpm -e --nodeps
# delete old rpm
echo "Clean old cache......"
rm -rf python-iniparse-0.3.1-2.1.el6.noarch.rpm
rm -rf yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rm -rf yum-3.2.29-40.el6.centos.noarch.rpm
rm -rf yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
# download CentOS Yum
echo "Download Python-iniparse......"
wget http://mirrors.163.com/centos/6.4/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
echo "Download yum-metadata-parse......"
wget http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
echo "Download yum......"
wget http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
echo "Download yum fastmirror......"
wget http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
# install CentOS Yum
echo "Installing......"
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
# replace repos
rm -rf /etc/yum.repos.d/CentOS-Base.repo
echo "[base]
name=CentOS-6.4 - Base - 163.com
baseurl=http://mirrors.163.com/centos/6.4/os/x86_64/
#mirrorlist=http://mirrors.163.com/?release=6.4&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-6.4 - Updates - 163.com
baseurl=http://mirrors.163.com/centos/6.4/updates/x86_64/
#mirrorlist=http://mirrors.163.com/?release=6.4&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-6.4 - Extras - 163.com
baseurl=http://mirrors.163.com/centos/6.4/extras/x86_64/
#mirrorlist=http://mirrors.163.com/?release=6.4&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.4 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/6.4/centosplus/x86_64/
#mirrorlist=http://mirrors.163.com/?release=6.4&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-6.4 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6.4/contrib/x86_64/
#mirrorlist=http://mirrors.163.com/?release=6.4&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6" >> /etc/yum.repos.d/CentOS-Base.repo
#####
yum clean all
yum makecache
yum update
echo "=========================================================================="
echo "You have successfully replace RedhatEnterprise Yum to CentOS yum and repos"
echo "=========================================================================="
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script"
exit 1
fi
clear
echo "========================================================================="
echo "Replace Redhat Enterprise Yum to CentOS Yum and Repos, Written by Licess"
echo "========================================================================="
# uninstall rhel yum
echo "Uninstall Rhel Yum......"
rpm -qa|grep yum|xargs rpm -e --nodeps
# delete old rpm
echo "Clean old cache......"
rm -rf python-iniparse-0.3.1-2.1.el6.noarch.rpm
rm -rf yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rm -rf yum-3.2.29-40.el6.centos.noarch.rpm
rm -rf yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
# download CentOS Yum
echo "Download Python-iniparse......"
wget http://mirrors.163.com/centos/6.4/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
echo "Download yum-metadata-parse......"
wget http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
echo "Download yum......"
wget http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
echo "Download yum fastmirror......"
wget http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
# install CentOS Yum
echo "Installing......"
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
# replace repos
rm -rf /etc/yum.repos.d/CentOS-Base.repo
echo "[base]
name=CentOS-6.4 - Base - 163.com
baseurl=http://mirrors.163.com/centos/6.4/os/x86_64/
#mirrorlist=http://mirrors.163.com/?release=6.4&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-6.4 - Updates - 163.com
baseurl=http://mirrors.163.com/centos/6.4/updates/x86_64/
#mirrorlist=http://mirrors.163.com/?release=6.4&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-6.4 - Extras - 163.com
baseurl=http://mirrors.163.com/centos/6.4/extras/x86_64/
#mirrorlist=http://mirrors.163.com/?release=6.4&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.4 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/6.4/centosplus/x86_64/
#mirrorlist=http://mirrors.163.com/?release=6.4&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-6.4 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6.4/contrib/x86_64/
#mirrorlist=http://mirrors.163.com/?release=6.4&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6" >> /etc/yum.repos.d/CentOS-Base.repo
#####
yum clean all
yum makecache
yum update
echo "=========================================================================="
echo "You have successfully replace RedhatEnterprise Yum to CentOS yum and repos"
echo "=========================================================================="
- RHEL 6.4使用CentOS 6.4 yum源更新-x86_64的脚本
- RHEL 6.4使用CentOS 6.4 yum源更新-i386的脚本
- RedHat RHEL 6.4使用CentOS yum源
- RHEL 6.8 x86_64 配置CentOS yum源
- RHEL 6.8 X86_64配置CentOS yum源
- RHEL X86_64 6.0使用CentOS6.0的yum源
- RHEL使用CentOS的yum源
- RHEL使用centos的yum源
- RHEL下使用CENTOS的YUM源
- 修改rhel的yum使用centos源
- RHEL6.2(X86_64)使用CentOS YUM源更新
- RHEL 6.4 x86_64 更换自带yum并安装配置163 yum源
- RHEL/CentOS下的yum的使用
- 配置RHEL使用CENTOS源来YUM
- RHEL 6.0使用CentOS yum源
- RHEL 5.3使用163 CentOS yum源
- RHEL 6.3使用CentOS yum源
- RHEL/CentOS安装EPEL的YUM源
- POJ 1985 Cow Marathon
- js使用div制作的select 输入框的下拉匹配控件
- Erlang学习:介绍Erlang里的Record
- RHEL 6.4使用CentOS 6.4 yum源更新-i386的脚本
- 再议:Erlang中的record与宏
- RHEL 6.4使用CentOS 6.4 yum源更新-x86_64的脚本
- asp.net(C#)html无限分类树 可新增 删除 修改
- 判断是不是ios7
- Oracle序列
- 关于rmmod: chdir(3.1.0): No such file or directory错误
- 超链接打开应用程序
- redhat 6.1上purescale 10.1安装手册
- python第三天_网络爬虫
- JobTracker和TaskTracker概述