分享

配置RedHat使用163的yum源

 sum12 2016-10-19

配置redhat 使用163 or sohu 的yum 源 

1.#cp /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.bk 首先备份下redhat yum  的配置样例文件。

2.#wget http://mirrors.163.com/.help/CentOS-Base-163.repo 或者 #wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo 下载163或sohu提供的yum 配置文件

3.#vi CentOS-Base-163.repo 替换$releaserver 为5或者6[5/6为centos的版本] 

4.#yum makecache  第3部不修改则第4部会出现如下错误:“[root@localhost ~]# yum makecache
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
http://mirrors.163.com/centos/5Server/addons/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again”

5.#cd /etc/pki/rpm-gpg #wget http://mirror./centos/RPM-GPG-KEY-CentOS-5

#yum update 错误信息:warning:rpmts_hdrfromfdno:header v3 dsa signature:nokey,key id e823568 GPG key retrieval:[errno 5] oserror:[errno 2] no such file or directory:'/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5'

原因:localhost不存在指定的文件/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

6.#yum install yum-fastestmirror 安装fastestmirror插件可自动选择最快的yum 源

7.#yum install -y yumex 安装图形化界面的yum

yum 常用的命令 #yum install -y xxx   安装xxx软件 #yum info xxx           查看xxx软件的基本信息 #yum remove/erase xxx 卸载xxx软件 


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多