mount /dev/cdrom /mnt
redhat yum配置
发表于 由
将ISO挂载到/mnt。
修改配置文件:
[root@inode1 ~]# cat /etc/yum.repos.d/rhel-source.repo
[rhel-source]
name=Red Hat Enterprise Linux $releasever – $basearch – Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta – $basearch – Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-source]
name=Red Hat Enterprise Linux $releasever – $basearch – Source
baseurl=file:///mnt/Server/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
即可使用yum
yum search glibc
yum install glibc.i686
20120915更新:Redhat 6.3配置
文件/etc/yum.repos.d/rhel-source.repo
修改:
[rhel_6_iso]
name=local iso
baseurl=file:///public/redhalt6.3/
gpgcheck=1
gpgkey=file:///public/redhalt6.3/RPM-GPG-KEY-redhat-release
由于
redhat的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,需将redhat的yum卸载后,重启
安装,再配置其他源,以下为详细过程:
1.删除redhat原有的yum
rpm -aq|grep yum|xargs rpm -e --nodeps
2.下载yum安装文件
wget
wget
wget
wget
3.进行安装yum
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
rpm -ivh yum-3.2.27-14.el6.centos.noarch.rpm um-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
注意最后两个包必需同时安装,否则会相互依赖
4.更新repo文件
mv /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.repo.bak
vi /etc/yum.repos.d/rhel-debuginfo.repo
内容为:
[base]
name=CentOS-$releasever - Base
baseurl=
gpgcheck=1
gpgkey=
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=
gpgcheck=1
gpgkey=
#packages used/produced in the build but not released
#[addons]
#name=CentOS-$releasever - Addons
#baseurl=
#gpgcheck=1
#gpgkey=
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=
gpgcheck=1
gpgkey=
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=
gpgcheck=1
enabled=0
5、yum clean all
6、yum install vim #测试一下可不可以用
【设置本地镜像作为yum源】
1、mkdir /mnt/cdrom
2 mount /dev/cdrom /mnt/cdrom #挂着镜像,光盘
3 mkdir /home/redhat-iso
4 cp -Rf /mnt/cdrom/* /home/redhat-iso #将光盘内的内容copy到某个路径下
5 vi /etc/yum.repos.d/rhel-debuginfo.repo #编辑repo文件
添加一下内容:
[rhel_6_iso]
name=local iso
baseurl=file:///home/redhat-iso/
gpgcheck=1
gpgkey=file:///home/redhat-iso/RPM-GPG-KEY-CentOS-6 #该处的gpgkey文件应该改成iso镜像中的文件名
阅读(1128) | 评论(0) | 转发(0) |