关闭

RedHat6.5网络yum配置

标签: redhatyum163源rpmcentos
85人阅读 评论(0) 收藏 举报
分类:

1.删除redhat原有的yum包

[root@zhusk Desktop]# rpm -qa|grep yum --检查系统中存在的yum包
yum-3.2.29-60.el6.centos.noarch
yum-metadata-parser-1.1.2-16.el6.x86_64
yum-plugin-fastestmirror-1.1.30-30.el6.noarch
[root@zhusk Desktop]# rpm -e yum-3.2.29-60.el6.centos.noarch --删除检查到的包,如提示依赖关系,则加上参数 --nodeps 进行强制删除

2.下载163源上的yum包

[root@zhusk Desktop]# wgat http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm

[root@zhusk Desktop]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm 
[root@zhusk Desktop]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm 
[root@zhusk Desktop]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

备注:最好能自己上163源上检查一下包时候存在,因为有时会更新版本,导致地址并不一定就是正确的,也可以自行上去下载到本地

3.安装下载的yum包

[root@zhusk Desktop]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm 

[root@zhusk Desktop]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm 

[root@zhusk Desktop]# rpm -ivh yum-3.2.29-60.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm 

备注:安装顺序如上,最后两个包一定要同时安装,以解决依存关系

4.配置更新repo文件

[root@zhusk Desktop]# mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.repo.bak --进行文件备份

[root@zhusk Desktop]# vi /etc/yum.repos.d/rhel-debuginfo.repo --开始编辑文件

配置如下:

[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/6.0/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#packages used/produced in the build but not released
#[addons]
#name=CentOS-$releasever - Addons
#baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/
#gpgcheck=1
#gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
gpgcheck=1
enabled=0

备注:baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/ --红色字体代表的是要下载的版本,必须是163源上有的,不然后报错

5.清除

[root@zhusk Desktop]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors

6.测试

[root@zhusk Desktop]# yum glibc
Loaded plugins: fastestmirror
No such command: glibc. Please use /usr/bin/yum --help
[root@zhusk Desktop]# yum install glibc
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package glibc.x86_64 0:2.12-1.80.el6 will be updated
--> Processing Dependency: glibc = 2.12-1.80.el6 for package: glibc-common-2.12-1.80.el6.x86_64
---> Package glibc.x86_64 0:2.12-1.149.el6_6.9 will be an update
--> Running transaction check
---> Package glibc-common.x86_64 0:2.12-1.80.el6 will be updated
---> Package glibc-common.x86_64 0:2.12-1.149.el6_6.9 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
 Package                       Arch                    Version                                Repository                Size
=============================================================================================================================
Updating:
 glibc                         x86_64                  2.12-1.149.el6_6.9                     updates                  3.8 M
Updating for dependencies:
 glibc-common                  x86_64                  2.12-1.149.el6_6.9                     updates                   14 M
Transaction Summary
=============================================================================================================================
Upgrade       2 Package(s)
Total download size: 18 M
Is this ok [y/N]: 

-------------------------------------------------------------------------------------------------------------------------------------------

好,至此配置163源就成功了!

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:87次
    • 积分:10
    • 等级:
    • 排名:千里之外
    • 原创:1篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条
    文章分类
    阅读排行
    评论排行