Redhat 7配置yum源
2016-10-26 18:01
351 查看
1、前提
由于redhat系统不再期官网注册,系统安装完成之后无法正常使用期yun源,因此更改redhat的yum源为CentOS的源
#系统环境
root@linuxprobe[06:22:13]:~$cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)
2、删除redhat自带的yum源
rpm -aq|grep yum|xargs rpm -e --nodeps3、从阿里云下载yum相关安装包
wget http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm wget http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm wget http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm4、rpm安装下载的yum包,按顺序执行下面命令 rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh yum-3.4.3-132.el7.centos.0.1.noarch.rpm yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
5、创建文件/etc/yum.repos.d/aliyun.repo并写入
vim /etc/yum.repos.d/aliyun.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.aliyun.com/centos/7.2.1511/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.aliyun.com/centos/7.2.1511/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.aliyun.com/centos/7.2.1511/extras//$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.aliyun.com/centos/7.2.1511/centosplus//$basearch/
gpgcheck=1
enabled=06、创建aliyun前记得把redhat自带的源一走或者删除
yum clean all && yum makecache
7、测试源
yum update -y --skip-broken
#能看到已经能够成功的通过yum安装相关软件包
如果报错:
wget http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
rpm –import RPM-GPG-KEY-CentOS-7
由于redhat系统不再期官网注册,系统安装完成之后无法正常使用期yun源,因此更改redhat的yum源为CentOS的源
#系统环境
root@linuxprobe[06:22:13]:~$cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)
2、删除redhat自带的yum源
rpm -aq|grep yum|xargs rpm -e --nodeps3、从阿里云下载yum相关安装包
wget http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm wget http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm wget http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm4、rpm安装下载的yum包,按顺序执行下面命令 rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh yum-3.4.3-132.el7.centos.0.1.noarch.rpm yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
5、创建文件/etc/yum.repos.d/aliyun.repo并写入
vim /etc/yum.repos.d/aliyun.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.aliyun.com/centos/7.2.1511/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.aliyun.com/centos/7.2.1511/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.aliyun.com/centos/7.2.1511/extras//$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.aliyun.com/centos/7.2.1511/centosplus//$basearch/
gpgcheck=1
enabled=06、创建aliyun前记得把redhat自带的源一走或者删除
yum clean all && yum makecache
7、测试源
yum update -y --skip-broken
#能看到已经能够成功的通过yum安装相关软件包
如果报错:
wget http://mirrors.aliyun.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
rpm –import RPM-GPG-KEY-CentOS-7
相关文章推荐
- redhat6.5下配置安装yum源
- redhat6.5 配置使用centos的yum源
- redhat6.5 配置使用centos的yum源
- 【推荐】在RedHat Server 5.4上安装YUM【利用网易免费yum源,配置和更新yum】
- 本地YUM源配置-Redhat Enterprise 5.9 推荐
- redhat7 配置使用centos的yum源
- RedHat6.5 三步配置本地yum源
- 本地YUM源配置Redhat Enterprise 5.9
- 给redhat 6.0配置yum源
- 在RedHat Server 5.4上安装YUM【利用网易免费yum源,配置和更新yum】
- redhat6.5 配置使用centos的yum源
- Redhat 6.0 配置yum源
- redhat配置本地yum源
- redhat 安装图形化界 和配置ios挂载yum源
- Redhat 5.8 配置yum源
- Redhat 6.3配置免费yum源(测试平台使用)
- redhat5和redhat6 配置yum源
- redhat6.3安装中文输入法和上下键,配置yum源
- RedHat 网络yum源的配置
- RedHat 7配置yum源