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



相关文章
|
1天前
|
Oracle Java 关系型数据库
Linux环境安装配置JDK11
Linux环境安装配置JDK11
16 0
|
1天前
|
Ubuntu Linux
Linux(Ubuntu)系统临时IP以及静态IP配置(关闭、启动网卡等操作)
请注意,以上步骤是在临时基础上进行配置的。如果要永久保存静态IP地址,通常还需要修改 `/etc/network/interfaces`文件,以便在系统重启后保持配置。同时,确保备份相关配置文件以防止出现问题。
12 1
|
3天前
|
人工智能 数据可视化 Linux
【linux基础(五)】Linux中的开发工具(上)---yum和vim
【linux基础(五)】Linux中的开发工具(上)---yum和vim
|
3天前
|
运维 网络协议 Linux
【运维系列】Centos7安装并配置PXE服务
PXE是Intel开发的预启动执行环境,允许工作站通过网络从远程服务器启动操作系统。它依赖DHCP分配IP,DNS服务分配主机名,TFTP提供引导程序,HTTP/FTP/NFS提供安装源。要部署PXE服务器,需关闭selinux和防火墙,安装dhcpd、httpd、tftp、xinetd及相关服务,配置引导文件和Centos7安装源。最后,通过syslinux安装引导文件,并创建pxelinux.cfg/default配置文件来定义启动参数。
15 0
|
3天前
|
运维 网络协议 Linux
【运维系列】Centos7安装并配置postfix服务
安装CentOS7的Postfix和Dovecot,配置Postfix的`main.cf`文件,包括修改完全域名、允许所有IP、启用邮箱等。然后,配置Dovecot的多个配置文件以启用auth服务和调整相关设置。重启Postfix和Dovecot,设置开机自启,并关闭防火墙进行测试。最后,创建邮箱账户并在Windows邮箱客户端中添加账户设置。
10 0
|
3天前
|
Linux 网络安全
Centos6.5安装并配置NFS服务
该内容描述了在Linux系统中设置NFS服务的步骤。首先挂载yum源,然后安装NFS服务,并编辑配置文件。接着,重启rpcbind和NFS服务,可能需要重复此过程以解决初始可能出现的问题。此外,关闭防火墙策略,并再次重启服务。最终,根目录被共享,特定IP网段被允许访问。
10 0
|
3天前
|
Ubuntu Linux 测试技术
Linux(32)Rockchip RK3568 Ubuntu22.04上部署 Docker: 详细配置与功能测试(下)
Linux(32)Rockchip RK3568 Ubuntu22.04上部署 Docker: 详细配置与功能测试
35 1
|
3天前
|
运维 网络协议 Linux
Linux(28) Linux双网卡配置为连接到Linux主机的PC提供外网访问
Linux(28) Linux双网卡配置为连接到Linux主机的PC提供外网访问
30 1
|
4天前
|
Ubuntu 网络协议 Linux
Linux(20) Ubuntu 20.04 网络接口自动切换路由配置
Linux(20) Ubuntu 20.04 网络接口自动切换路由配置
27 0
|
4天前
|
Linux
Linux(9)Debain EC25 quectel-CM usbnet0开机自动联网配置
Linux(9)Debain EC25 quectel-CM usbnet0开机自动联网配置
15 0