redhat6.0 yum问题解决法 设置为centos的yum源
2011-10-01 02:10
447 查看
由于 redhat的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,需将redhat的yum卸载后,重启安装,再配置其他源,以下为详细过程:
(此处使用为64位版本,使用32位版本的必须更改相应的软件包名称)
1.删除redhat原有的yum
rpm -aq|grep yum|xargs rpm -e --nodeps
2.下载yum安装文件
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
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 yum-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=http://mirrors.163.com/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#packages used/produced in the build but not released
#[addons]
#name=CentOS-$releasever - Addons
#baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/
#gpgcheck=1
#gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
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镜像中的文件名
(此处使用为64位版本,使用32位版本的必须更改相应的软件包名称)
1.删除redhat原有的yum
rpm -aq|grep yum|xargs rpm -e --nodeps
2.下载yum安装文件
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
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 yum-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=http://mirrors.163.com/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#packages used/produced in the build but not released
#[addons]
#name=CentOS-$releasever - Addons
#baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/
#gpgcheck=1
#gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
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镜像中的文件名
相关文章推荐
- gedit 没有preference项,使preference回归,并用命令行设置行号,解决centos7下中文乱码,text wrapping等问题
- CentOS7下 解决yum install mysql-server没有可用包的问题
- 解决CentOS的yum无法安装https来源的epel问题
- VMware虚拟机下的CentOS 设置静态IP【解决设置静态IP后不能上网的问题】
- CentOS7下解决yum install mysql-server没有可用包的问题
- centos设置静态ip及出现的问题解决
- CentOS6.5下Mysql 未设置query_cache_size 导致CPU占用率高的问题解决方法_20160119_莫小贝
- CentOS7下解决yum install mysql-server没有可用包的问题
- 解决 CentOS 6.4 yum不能更新升级的问题
- CentOS设置静态IP,以及解决设置静态IP过程中,修改DNS配置后重启网络nameserver被删除的问题
- CentOS 5.5通过yum安装 Memcached的步骤、问题、及解决办法
- CentOS使用YUM更新常见问题解决
- 解决centos没有IP问题,可不设置静态ip
- 解决 Vmware 克隆 Centos 虚拟机时,网卡需要重新设置的问题
- CentOS6.5下Mysql 未设置query_cache_size 导致CPU占用率高的问题解决方法_20160119_莫小贝
- CentOS7下解决yum install mysql-server没有可用包的问题
- 解决CentOs7.2.1511下mysql5.6.38版本max_connections设置失败的问题
- 解决Redhat Linux AS使用yum时出现This system is not registered with RHN的问题(改用CentOS的yum)
- 巧妙设置yum软件库轻松解决软件包安装问题
- Centos中使用yum安装java时,没有jps的问题的解决。