Redhat linux本地yum源的配置教程 |
本文标签:redhat,配置,yum源 相信对RedHat Linux或CentOS比较熟悉的人,应该是比较了解yum源的,它比普通的rpm包安装,要方便的多,为何呢?因为它能顺利的解决rpm包之间的依赖关系 。你要是根据rpm包之间的依赖关系,一个一个的安装,我也是很佩服的,我实在难以做到,有时安装安装的软件需要几十个rpm包,实在是太烦了啊....... 复制代码 代码如下:[root@localhost RPMS]# cd /RPMS/ [root@localhost RPMS]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 Preparing... ########################################### [100%] 1:createrepo ########################################### [100%] [root@localhost RPMS]# cp /mnt/cdrom /RPMS/ [root@localhost RPMS]# createrepo -p /RPMS/ 2292/2292 - libXt-1.0.2-3.1.fc6.i386.rpm Saving Primary metadata Saving file lists metadata Saving other metadata 配置rhel-debuginfo.repo 复制代码 代码如下:[root@localhost /]# cd /etc/yum.repos.d/ [root@localhost yum.repos.d]# ls rhel-debuginfo.repo [root@localhost yum.repos.d]# 复制代码 代码如下:[rhel-debuginfo] name=Red Hat Enterprise Linux $releasever - $basearch - Debug baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 复制代码 代码如下:[rhel-debuginfo] name=Red Hat Enterprise Linux $releasever - $basearch - Debug baseurl=file:///RPMS/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 更新软件包 复制代码 代码如下:[root@localhost RPMS]# yum update Loaded plugins: rhnplugin, security This system is not registered with RHN. RHN support will be disabled. rhel-debuginfo | 951 B 00:00 rhel-debuginfo/primary | 829 kB 00:00 rhel-debuginfo 2292/2292 Skipping security plugin, no data Setting up Update Process No Packages marked for Update [root@localhost RPMS]# 这样应该就可以了,你可以检验一下[以gcc为例]: 复制代码 代码如下:[root@localhost RPMS]# yum install gcc Loaded plugins: rhnplugin, security This system is not registered with RHN. RHN support will be disabled. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package gcc.i386 0:4.1.2-46.el5 set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================================================== Package Arch Version Repository Size ============================================================================================== Installing: gcc i386 4.1.2-46.el5 rhel-debuginfo 5.2 M Transaction Summary ============================================================================================== Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 5.2 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : gcc 1/1 Installed: gcc.i386 0:4.1.2-46.el5 Complete! [root@localhost RPMS]# 这样基本上就解决了,RedHat Linux本地yum 源的配置了,不用再为文件之间的依赖关系而烦神了......哈哈 。 |