RHEL5.4利用centos yum进行更新

[不指定 2010/06/11 22:18 | by admin ]
1.rhel5系统安装的时候其实已经有yum了,刚安装redhat就可以在终端敲入yum,只是会提示没有注册
This system is not registered with RHN.
RHN support will be disabled.
只是因为如果用官方的网站更新的话除非你是用钱买的rhel5.否则它会提示注册之类的。
当然用[root@localhost Desktop]#yum update当然也是不行的
因此,我试着在网上找一些方法来实现yum自动更新,有的网站说利用CentOS的yum更新源,但需要删掉RedHat 5本来的yum,我先利用rpm -qa | grep yum找到所有yum文件,然后又用rpm -e命令删除
rpm -e yum-metadata-parser-1.1.2-3.el5
rpm -e yum-3.2.22-20.el5
rpm -e yum-updatesd-0.9-2.el5
rpm -e yum-rhn-plugin-0.5.4-13.el5
rpm -e yum-security-1.1.16-13.el5
因为依赖性,实际删除的文件不止这么几个
于是再恢复安装RedHat 5本来的yum,于是在光盘里面找,于是将删掉的文件又重新安装上去了,主要是:
yum-3.2.22-20.el5
安装好以后在命令行敲入yum,终于有可以找到它了,呵呵
2. 修改源配置文件 #gedit /etc/yum.repos.d/CentOS-Base.repo
在其中加入以下内容
[base]
name=CentOS-5-Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#released updates
[update]
name=CentOS-5-Updates
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates
baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#packages used/produced in the build but not released
[addons]
name=CentOS-5-Addons
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons
baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#additional packages that may be useful
[extras]
name=CentOS-5-Extras
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras
baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5-Plus
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus
baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#contrib - packages by Centos Users
[contrib]
name=CentOS-5-Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib
baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
# vi dag.repo
[dag]
name=Dag RPM Repository for RHEL5
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/
enabled=1
gpgcheck=1
gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt
3. 导入key
#rpm --import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
4. 运行,测试
#yum list vsftpd
5.如果结果出现错误:
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
GPG key retrieval failed: [Errno 14] HTTP Error 404: Not Found
此时,将gpgcheck=1改成gpgcheck=0即可。
6. 运行,测试
#yum install vsftpd
能够正确安装上了,就是更新文件列表的速度相当慢。
Tags: ,

为redhat AS4安装yum

[不指定 2010/06/05 01:43 | by admin ]
        前天接了个环境lnmp的配置,原让其安装centos5.5的,没想对方机房装了其他版本的linux,因平时接触的版本也不多,所以,通过查看 cat   /proc/version 才得知系统为32位的redhat AS4。
     登录后发现没法使用yum,于是网上搜索,找到方法,以下为转贴:

    
       在标准的Redhat Enterprise Linux上,默认没有安装yum,需要单独下载并安装。
  此外,Redhat Enterprise Linux的更新是由Redhat提供的收费服务,但由于Redhat Enterprise Linux和CentOS是基本通用的,所以可用CentOS源来升级redhat。
  1. 首先安装yum和相关的rpm包
  注意:本安装包只提供给as4系统之用
         http://www.swsoft.com.cn/downloads/Prima/Tools/yum_forAS4.tar.gz
           或  http://www.haoxm.net/tools/yum_forAS4.tar.gz
  下载并解压缩yum包和升级文件
  rpm -ivh *.rpm

  2. 将解压缩后得到的CentOS-Base.repo复制到/etc/yum.repos.d/目录里边
  注意:本CentOS-Base.repo文件只提供给as4系统之用

  3. 执行如下命令导入GPG Key
          rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4
         或 rpm --import http://www.haoxm.net/tools/RPM-GPG-KEY-CentOS-4

  现在可以开始使用yum了。yum的主要参数包括search/install/upgrade/remove。
  
  注意:
  1. 使用yum的过程中,有些程序包是不能升级的。
  2. 如果使用yum对全部系统都进行升级,则会发现升级后系统版本将从redhat变成centos
  这是因为升级使用的是免费centos的yum源,所以升级最好有选择的执行

     yum update了一下,文件是下载了,但提示出错未安装,看来能否升为centos还有待再次试验,于是又搜来redhat 的源更换,源码如下:

    [base]

name=Red Hat Enterprise AS release 4 Updates

baseurl= http://apt.sw.be/redhat/el4/en/i386/dag/

         http://apt.sw.be/redhat/el4/en/i386/rpmforge/

         http://mirror.cpsc.ucalgary.ca/mirror/dag/redhat/el4/en/i386/dag/

         http://mirror.cpsc.ucalgary.ca/mirror/dag/redhat/el4/en/i386/rpmforge/
gpgcheck=0

yum后发现能更新,就是有用的包太少了。
Tags: , ,
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]