CentOS 5.11 yum通过iso镜像安装软件

2017-09-23

CentOS 5.11已经EOL,不在被支持,为了安装软件,我们可以访问vault.centos.org或archive.kernel.org/centos-vault或准备iso镜像文件。

1、下载
#wget -c http://archive.kernel.org/centos-vault/5.11/isos/x86_64/CentOS-5.11-x86_64-bin-DVD-1of2.iso -P /opt
2、Mount
mount -o loop /opt/CentOS-5.11-x86_64-bin-DVD-1of2.iso /media
3、刷新repos,生成缓存
yum clean all
yum makecache
4、修改/etc/yum.repos.d/CentOS-Media.repo
more CentOS-Media.repo
[c5-media]
name=CentOS-$releasever - Media
baseurl=file:///media/
gpgcheck=0
enabled=1
gpgkey=file:///media/RPM-GPG-KEY-CentOS-5
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
gpgkey=http://archive.kernel.org/centos-vault/RPM-GPG-KEY-CentOS-5

5、ll /media/CentOS/zip-2.31-2.el5.x86_64.rpm
yum install zip
yum --enablerepo=c5-media reinstall screen
6、$releasever的定义可以查看 /etc/yum.conf 文件的事distroverpkg=value行
distroverpkg=redhat-release
rpm -qi centos-release

$basearch是我们的系统硬件架构
arch

7、实例archive.kernel.org/centos-vault
[c5-base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://archive.kernel.org/centos-vault/5.11/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://archive.kernel.org/centos-vault/5.11/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://archive.kernel.org/centos-vault/5.11/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://archive.kernel.org/centos-vault/5.11/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
baseurl=http://archive.kernel.org/centos-vault/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

8、yum更新源优先级设置
安装 yum-priorities
yum install yum-priorities
priorities的配置文件是/etc/yum/pluginconf.d/priorities.conf,确认其是否存在。
其内容为:
[main]
enabled=1 # 0禁用 1启用
编辑 /etc/yum.repos.d/目录下的*.repo 文件来设置优先级。

参数为:
priority=N # N的值为1-99

分类:Linux | 标签: |

相关日志

评论被关闭!