CentOS安装网络YUM源

1:删除自带的yum源

[root@localhost ~]# rpm -aq|grep yum|xargs rpm -e –nodeps

2:下载新的相关软件包,这四个软件包可能会升级,如果不能下载的话可以自己去http://mirrors.163.com/centos/5/os/i386/CentOS下载最近的rpm包。

[root@localhost ~]# wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm

[root@localhost ~]# wget http://mirrors.163.com/centos/5/os/i386/CentOS/python-iniparse-0.2.3-6.el5.noarch.rpm

[root@localhost ~]# wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.i386.rpm

[root@localhost ~]# wget http://mirrors.163.com/centos/5/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm

3:安装rpm(一定要按照顺序来)

安装python-iniparse-0.2.3-6.el5.noarch.rpm

[root@localhost ~]# rpm -ivh python-iniparse-0.2.3-6.el5.noarch.rpm
warning: python-iniparse-0.2.3-6.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing…                                                       : ########################################### [100%]
file /usr/lib/python2.4/site-packages/iniparse/compat.py from install of python-iniparse-0.2.3-6.el5.noarch conflicts with file from package python-iniparse-0.2.3-4.el5.noarch
file /usr/lib/python2.4/site-packages/iniparse/compat.pyc from install of python-iniparse-0.2.3-6.el5.noarch conflicts with file from package python-iniparse-0.2.3-4.el5.noarch
file /usr/lib/python2.4/site-packages/iniparse/compat.pyo from install of python-iniparse-0.2.3-6.el5.noarch conflicts with file from package python-iniparse-0.2.3-4.el5.noarch

安装yum-metadata-parser-1.1.2-4.el5.i386.rpm

[root@localhost ~]# rpm -ivh yum-metadata-parser-1.1.2-4.el5.i386.rpm
warning: yum-metadata-parser-1.1.2-4.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing…                                                        ########################################### [100%]
1:yum-metadata-parser                                            ########################################### [100%]

安装yum-3.2.22-40.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm,而且这两个包一定要一起安装,要不然会报错的。

[root@localhost ~]# rpm -ivh yum-3.2.22-40.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
warning: yum-3.2.22-40.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing…                                                        ########################################### [100%]
1:yum-fastestmirror                                              ########################################### [ 50%]
2:yum                                                            ########################################### [100%]

4:下载

[root@localhost yum.repos.d]# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
–2013-11-22 06:00:00–  http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
Resolving docs.linuxtone.org… 117.79.157.57
Connecting to docs.linuxtone.org|117.79.157.57|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 1426 (1.4K) [application/octet-stream]
Saving to: `CentOS-Base.repo’

100%[===========================>] 1,426       –.-K/s   in 0s

2014-10-15 08:00:01 (72.8 MB/s) – `CentOS-Base.repo’ saved [1426/1426]

[root@localhost yum.repos.d]# ls
CentOS-Base.repo  rhel-debuginfo.repo

执行 yum update  -y

执行完这一步之后就可以使用yum源了。

[root@localhost yum.repos.d]# yum list | more

网络yum源这样就已经配置好了。

6 Comments

  • Cary

    2016年4月8日 at 下午11:50 回复

    Hello everyone, it’s my first pay a quick visit at this web site, and piece of writing
    is in fact fruitful designed for me, keep up posting these types of articles or reviews.

  • Steve

    2016年4月29日 at 下午10:41 回复

    I’m not sure why but this web site is loading very slow for me.
    Is anyone else having this problem or is it a issue on my end?
    I’ll check back later on and see if the problem still exists.

  • Juliane

    2016年4月30日 at 上午4:16 回复

    This is really interesting, You are a very skilled blogger.
    I’ve joined your rss feed and look forward to seeking
    more of your magnificent post. Also, I’ve shared
    your site in my social networks!

  • Darwin

    2016年4月30日 at 下午9:53 回复

    Just desire to say your article is as astounding. The clearness on your post is simply cool and
    that i can suppose you are knowledgeable in this subject.
    Fine with your permission allow me to grasp your feed to keep updated with forthcoming post.
    Thanks 1,000,000 and please continue the gratifying work.

  • Delia

    2016年5月1日 at 上午5:51 回复

    Pretty nice post. I just stumbled upon your weblog and wanted to say that
    I have truly enjoyed surfing around your blog posts. After all I’ll be subscribing
    to your feed and I hope you write again soon!

  • https://penzu.com/p/e1a0b41a

    2016年5月1日 at 下午3:39 回复

    The other day, while I was at work, my sister stole my iphone and tested to see if it can survive a forty foot drop,
    just so she can be a youtube sensation. My iPad is now destroyed
    and she has 83 views. I know this is totally off topic but I had to share it with someone!

Post a Comment