Thursday, 16 December 2010

如何让yum使用RHEL5.5光盘安装软件?

插入RHEL5光盘
登录为root
[root@localhost ~]# mkdir dvd
[root@localhost ~]# cd /media/RHEL-5.5\ i386\ DVD/Server/
[root@localhost Server]# rpm -i createrepo-0.4.11-3.el5.noarch.rpm
[root@localhost Server]# cd /root/dvd
[root@localhost dvd]# createrepo -vpo . /media/RHEL-5.5\ i386\ DVD/
[root@localhost dvd]# ln -s /media/RHEL-5.5\ i386\ DVD/Server/ Server
[root@localhost dvd]# vi /etc/yum.repos.d/DVD.repo 并加入下述内容:
    [dvd]
    name=RHEL5 DVD
    baseurl=file:///root/dvd
    enabled=1
    gpgcheck=0
      [root@localhost dvd]# yum clean all
      [root@localhost dvd]# yum update

      例如,安装PostgreSQL
      [root@localhost ~]# yum install postgresql84 postgresql84-server postgresql84-contrib postgresql84-devel postgresql84-docs postgresql84-test
      [root@localhost ~]# chkconfig postgresql on
      [root@localhost ~]# service postgresql initdb
      [root@localhost ~]# service postgresql start


      Update 1: I found this URL is more comprehensive.

      Update 2: Here is another way, which is much simpler:

      copy the ISO image, e.g. rhel-server-6.5-x86_64-dvd.iso, to the server under /root;

      mount -o loop -t iso9660 /root/rhel-server-6.5-x86_64-dvd.iso /mnt/

      vi /etc/yum.repos.d/dvd.repo and add following content:

      [dvd]
      name=DVD
      baseurl=file:///mnt/Server
      enabled=1
      gpgcheck=0


      No comments:

      Post a Comment

      Note: only a member of this blog may post a comment.