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,如需转载请自行联系原作者



相关文章
|
4月前
|
Ubuntu Linux 网络安全
Linux服务器之Ubuntu的安装与配置
Ubuntu Desktop是目前最成功、最流行的图形界面的Linux发行版;而Ubuntu Server也在服务器端市场占据了较大的份额。今天为大家详细介绍了Ubuntu Server的安装与配置,希望对你能有所帮助。关于VMware、VirtualBox等虚拟化软件的使用,朱哥还会在后续的文章中为大家详细介绍,敬请关注!
|
2月前
|
存储 Linux 开发工具
Linux环境下使用Buildroot配置软件包
使用Buildroot可以大大简化嵌入式Linux系统的开发和维护工作,但它需要对Linux系统和交叉编译有深入的理解。通过上述步骤,可以有效地配置和定制软件包,为特定的嵌入式应用构建高效、稳定的系统。
246 11
|
3月前
|
安全 关系型数据库 MySQL
CentOS 7 yum 安装 MySQL教程
在CentOS 7上安装MySQL 8,其实流程很清晰。首先通过官方Yum仓库来安装服务,然后启动并设为开机自启。最重要的环节是首次安全设置:需要先从日志里找到临时密码来登录,再修改成你自己的密码,并为远程连接创建用户和授权。最后,也别忘了在服务器防火墙上放行3306端口,这样远程才能连上。
617 16
|
5月前
|
Kubernetes Linux 网络安全
Rocky Linux 8.9配置Kubernetes集群详解,适用于CentOS环境
初始化成功后,记录下显示的 `kubeadm join`命令。
282 0
|
6月前
|
Linux 网络安全 开发工具
在Linux下配置gitee与Github的远程仓库
注意,git push后,是输入你的账号与密码。这个步骤可以通过特殊设置省去,但是一开始还是不要太省。
336 0
|
Oracle 关系型数据库 Linux
|
Oracle 关系型数据库 Linux