Warning: Missing argument 2 for wp_widget() in /www/users/haoxm.net/wp-includes/widgets.php on line 76
孤独小客 » Blog Archive » CentOS5.2安装yum

CentOS5.2安装yum

实验环境:CentOS 5.2
实验目的:学会配置yum,并把系统更新到最新版CentOS 5.5
实验人:孤独小客

1、首先下载需要的软件下载列个文本
[root@RedHat soft]# wget http://www.haoxm.net/tools/down.txt
[root@RedHat soft]# ls
down.txt
这是我下载到/root/soft目录下。
2、下载所有会用到的软件
[root@RedHat soft]#wget -i down.txt
[root@RedHat soft]# ls
DenyHosts-2.6.tar.gz libmcrypt-2.5.8.tar.bz2 vnstat_php.tar.gz
down.txt mysql-5.0.91.tar.gz vsftpd-2.0.6.tar.gz
gd-2.0.32.tar.gz php-5.2.14.tar.gz yum_forAS4.tar.gz
httpd-2.2.4.tar.gz vnstat-1.10.tar.gz ZendOptimizer-3.2.2-

linux.tar.gz
3、查一下系统目前是否有安装过yum的rpm包。
[root@haoxm soft]# rpm -qa|grep yum
yum-metadata-parser-1.1.2-3.el5.centos
yum-fastestmirror-1.1.16-14.el5.centos.1
yum-3.2.22-26.el5.centos
4、删除系统自带的yum
[root@haoxm soft]# rpm -qa|grep yum|xargs rpm -e –nodeps
(|xargs 管道传递的意思,传递给rpm -e 命令)

5、安装yum
[root@haoxm soft]# rpm -Uvh

http://mirrors.163.com/centos/5/os/i386/CentOS/yum-3.2.22-

26.el5.centos.noarch.rpm

http://mirrors.163.com/centos/5/os/i386/CentOS/yum-metadata-parser-

1.1.2-3.el5.centos.i386.rpm

http://mirrors.163.com/centos/5/os/i386/CentOS/yum-fastestmirror-

1.1.16-14.el5.centos.1.noarch.rpm
(其实在这一步为何要装这3个软件,因为你要卸载之前我们有查过含yum的安装包

就是这3个,所以我们再次安装这3个rpm包,这3个是centos的安装包,不是

redhat的系统)

6、把我们自己站上编辑好的配置文件写入到本系统的配置文件
[root@haoxm soft]# wget http://www.haoxm.net/tools/CentOS-Base.repo -O

/etc/yum.repos.d/CentOS-Base.repo
–2010-12-05 15:32:09– http://www.haoxm.net/tools/CentOS-Base.repo
Resolving www.haoxm.net… 218.85.133.154
Connecting to www.haoxm.net|218.85.133.154|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 886 [text/plain]
Saving to: `/etc/yum.repos.d/CentOS-Base.repo’

100%[======================================>] 886 –.-K/s in

0s

2010-12-05 15:32:16 (110 MB/s) – `/etc/yum.repos.d/CentOS-Base.repo’

saved [886/886]

7、测试一下搜索:

[root@haoxm soft]# yum search kernel

基本大功告成

Leave a comment

Your comment