rhel 4/oracle linux 4/centos linux 4 配置本地yum资源库

简介:

     最近在rhel4上面安装oracle 9i的时候,发现gcc没有安装,于是手动rpm去安装,报多个包的依赖,无赖啊。安装rhel5的方式,配置了yum资源库,不能使用,才发现rhel4下面没有repodata相关的文件,在rhel5后面,光盘中自带有这些目录与文件,所以我们需要手动去创建相关的文件。

      repodate目录下面有以下文件:

 
  1. [root@i repodata]# ls -lrt 
  2. total 9564 
  3. -rw-r--r--  1 root root     951 Dec 22 04:18 repomd.xml 
  4. -rw-r--r--  1 root root  578572 Dec 22 04:18 primary.xml.gz 
  5. -rw-r--r--  1 root root 7023387 Dec 22 04:18 other.xml.gz 
  6. -rw-r--r--  1 root root 2161684 Dec 22 04:18 filelists.xml.gz 

     手动创建repodate目录,需要用到createrepo这个命令,在rhel4光盘中默认是没有这个包,我们需要手动去下载,这个包我随后会上传上来。

     下面是创建的过程。

1,安装createrepo包

 
  1. [root@i soft]# ls 
  2. createrepo-0.4.6-1.el4.rf.noarch.rpm 
  3. [root@i soft]# rpm -ivh *.rpm 
  4. warning: createrepo-0.4.6-1.el4.rf.noarch.rpm: V3 DSA signature: NOKEY, key ID 1aa78495 
  5. Preparing...                ########################################### [100%] 
  6.    1:createrepo             ########################################### [100%] 

2,手动mount光盘到目录

 
  1. [root@i ~]# mkdir /media/rhel4 
  2. [root@i ~]# mount /dev/cdrom /media/rhel4 
  3. mount: block device /dev/cdrom is write-protected, mounting read-only 

3,创建repodate

 
  1. [root@i ~]# cd /media 
  2. [root@i media]# createrepo ./ 
  3. 1871/1871 - rhel4/SRPMS/comps-4AS-0.20090520.src.rpm                            .x86_64.rpm6_64.rpmm 
  4. Saving Primary metadata 
  5. Saving file lists metadata 
  6. Saving other metadata 

4,配置本地repo文件

 
  1. [root@i repodata]# cd /etc/yum.repos.d/ 
  2. [root@i yum.repos.d]# ls 
  3. [root@i yum.repos.d]# vi local.repo 
  4. [rhel4.8] 
  5. name=rhel4.9 
  6. baseurl=file:///media/ 
  7. enabled=1 
  8. gpgcheck=0 
  9. [root@i yum.repos.d]# yum list 
  10. Setting up repositories 
  11. rhel4.8                   100% |=========================|  951 B    00:00      
  12. Reading repository metadata in from local files 
  13. primary.xml.gz            100% |=========================| 565 kB    00:00      
  14. rhel4.8   : ################################################## 1871/1871 
  15. Added 1871 new packages, deleted 0 old in 5.44 seconds 
  16. Installed Packages 
  17. 4Suite.x86_64                            1.0-3                  installed        
  18. Canna-libs.i386                          3.7p3-9.el4            installed        
  19. FreeWnn-libs.i386                        1:1.10pl020-6.el4      installed        
  20. GConf2.i386                              2.8.1-2.el4            installed        
  21. GConf2.x86_64                            2.8.1-2.el4            installed   

5,yum的命令

 
  1. [root@i yum.repos.d]# yum -help 
  2. usage: yum [options] < update | install | info | remove | list | 
  3.     clean | provides | search | check-update | groupinstall |  
  4.     groupupdate | grouplist | groupinfo | groupremove | 
  5.     makecache | localinstall | erase | upgrade | whatprovides | 
  6.     localupdate | resolvedep | shell | deplist > 
  7.  
  8. options: 
  9.   -h, --help            show this help message and exit 
  10.   -t, --tolerant        be tolerant of errors 
  11.   -C                    run entirely from cache, don't update cache 
  12.   -c [config file]      config file location 
  13.   -R [minutes]          maximum command wait time 
  14.   -d [debug level]      debugging output level 
  15.   -e [error level]      error output level 
  16.   -y                    answer yes for all questions 
  17.   --version             show Yum version and exit 
  18.   --installroot=[path]  set install root 
  19.   --enablerepo=[repo]   enable one or more repositories (wildcards allowed) 
  20.   --disablerepo=[repo]  disable one or more repositories (wildcards allowed) 
  21.   --exclude=[package]   exclude package(s) by name or glob 
  22.   --obsoletes           enable obsoletes processing during updates 
  23.   --noplugins           disable Yum plugins 

yum命令的使用,见man yum


     本文转自7343696 51CTO博客,原文链接:http://blog.51cto.com/luoping/1096764,如需转载请自行联系原作者



相关文章
|
8月前
|
安全 Linux iOS开发
Nessus Professional 10.10 Auto Installer for RHEL 10, AlmaLinux 10, Rocky Linux 10 - Nessus 自动化安装程序
Nessus Professional 10.10 Auto Installer for RHEL 10, AlmaLinux 10, Rocky Linux 10 - Nessus 自动化安装程序
603 6
Nessus Professional 10.10 Auto Installer for RHEL 10, AlmaLinux 10, Rocky Linux 10 - Nessus 自动化安装程序
|
11月前
|
NoSQL 安全 Linux
设置Redis在CentOS7上的自启动配置
这些步骤总结了在CentOS 7系统上设置Redis服务自启动的过程。这些命令提供了一个直接且明了的方式,确保Redis作为关键组件在系统启动时能自动运行,保障了依赖于Redis服务的应用的稳定性和可用性。
829 9
|
11月前
|
存储 Linux Apache
在CentOS上配置SVN至Web目录的自动同步
通过上述配置,每次当SVN仓库中提交新的更改时,`post-commit`钩子将被触发,SVN仓库的内容会自动同步到指定的Web目录,从而实现代码的连续部署。
321 16
|
Oracle 关系型数据库 Linux
Rocky Linux 9.6 正式版发布 - RHEL 100% 1:1 兼容免费发行版
Rocky Linux 9.6 正式版发布 - RHEL 100% 1:1 兼容免费发行版
1515 0
Rocky Linux 9.6 正式版发布 - RHEL 100% 1:1 兼容免费发行版
|
Oracle 关系型数据库 Linux
MyEMS开源系统安装之CentOS/RHEL/Rocky/AlmaLinux/Oracle Linux
本指南介绍如何在CentOS/RHEL/Rocky/AlmaLinux/Oracle Linux服务器上部署MyEMS开源能源管理系统。内容涵盖系统准备、数据库配置、多个MyEMS服务(如myems-api、myems-admin、myems-modbus-tcp等)的安装与配置,以及Nginx服务器设置和防火墙规则调整。通过完成所有步骤,您将能够访问MyEMS Admin UI和Web UI,默认端口分别为8001和80,初始登录凭据已提供。
871 0
|
Oracle Cloud Native 关系型数据库
Oracle Linux 9.6 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
Oracle Linux 9.6 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
578 0
Oracle Linux 9.6 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
|
Ubuntu 安全 Linux
CentOS与Ubuntu中防火墙配置命令集汇
有了这些,你就能遨游在 CentOS 和 Ubuntu 的海洋中,频繁地改变你的防火墙设置,快速地应对各种安全威胁,同时也能保证你的系统可以正常工作。出发吧,勇敢的编程者,随着这些命令集的涌动,扬帆起航,走向安全的网络世界!
458 5
|
人工智能 安全 Linux
Red Hat Enterprise Linux 10 正式版发布 - 红帽企业 Linux (RHEL)
Red Hat Enterprise Linux 10 正式版发布 - 红帽企业 Linux (RHEL)
1647 0
Red Hat Enterprise Linux 10 正式版发布 - 红帽企业 Linux (RHEL)
|
安全 Linux 数据安全/隐私保护
Red Hat Enterprise Linux 9.6 (x86_64, aarch64) - 红帽企业 Linux (RHEL)
Red Hat Enterprise Linux 9.6 (x86_64, aarch64) - 红帽企业 Linux (RHEL)
1466 36
Red Hat Enterprise Linux 9.6 (x86_64, aarch64) - 红帽企业 Linux (RHEL)