1.卸载redhat自带的yum组件
[root@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps
2.查看系统版本
[root@localhost ~]# lsb_release -a
显示为:Red Hat Enterprise Linux Server release 6.1 于是找对应的CentOS6.1 但是在http://mirrors.ustc.edu.cn/centos/6.0/readme看到
This directory (and version of CentOS) is depreciated. For normal users,
you should use /6/ and not /6.0/ in your path. Please see this FAQ
concerning the CentOS release scheme:
http://www.centos.org/modules/smartfaq/faq.php?faqid=34
If you know what you are doing, and absolutely want to remain at the 6.0
level, go to http://vault.centos.org/ for packages. Please keep in mind that 6.0 no longer gets any updateds
所以选择6版本
3.安装centos的yum包(64位对应于64位安装包)
wgethttp://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wgethttp://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm
wgethttp://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
安装顺序如下:
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
注意最后两个包必需同时安装,否则会相互依赖,我在这里纠结了很久
vi/etc/yum.repos.d/CentOS-Base.repo
#mv /etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.bak
然后把/etc/yum.repos.d/CentOS-Base.repo文件改为
# CentOS-Base.repo # # This file uses a new mirrorlist system developed by Lance Davis for CentOS. # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # #
[base] name=CentOS-$releasever - Base baseurl=http://mirrors.ustc.edu.cn/centos/6/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6
#released updates [updates] name=CentOS-$releasever - Updates baseurl=http://mirrors.ustc.edu.cn/centos/6/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6
#packages used/produced in the build but not released #[addons] #name=CentOS-$releasever - Addons #baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/addons/$basearch/ #gpgcheck=1 #gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras baseurl=http://mirrors.ustc.edu.cn/centos/6/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus baseurl=http://mirrors.ustc.edu.cn/centos/6/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6 |
更改一下源的路径就行了。现在可以更新Centos 6了。
下面是搜狐的:
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.sohu.com/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.sohu.com/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6
#packages used/produced in the build but not released
#[addons]
#name=CentOS-$releasever - Addons
#baseurl=http://mirrors.sohu.com/centos/$releasever/addons/$basearch/
#gpgcheck=1
#gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.sohu.com/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.sohu.com/centos/6/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-6
下面是网易163的源:
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[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
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
经过测试,教育网内用中科大的源很快。外网用网易的源非常快。
yum clean all
yum makecache
下面的测试
在站glibc.i686遇到很多问题,如下:出现这个问题的原因最后确定是因为我的一个文件搞错了,也就是上面写道CentOS-Base.repo,不过现在全部搞定。
yum install glibc.i686
Loaded plugins: fastestmirror, product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package glibc.i686 0:2.5-81.el5_8.4 will be installed
--> Processing Dependency: glibc-common = 2.5-81.el5_8.4 for package: glibc-2.5-81.el5_8.4.i686
--> Finished Dependency Resolution
Error: Package: glibc-2.5-81.el5_8.4.i686 (update)
Requires: glibc-common = 2.5-81.el5_8.4
Installed: glibc-common-2.12-1.25.el6.x86_64 (@anaconda-RedHatEnterpriseLinux-201105101844.x86_64/6.1)
glibc-common = 2.12-1.25.el6
Available: glibc-common-2.5-81.x86_64 (base)
glibc-common = 2.5-81
Available: glibc-common-2.5-81.el5_8.1.x86_64 (update)
glibc-common = 2.5-81.el5_8.1
Available: glibc-common-2.5-81.el5_8.2.x86_64 (update)
glibc-common = 2.5-81.el5_8.2
Available: glibc-common-2.5-81.el5_8.4.x86_64 (update)
glibc-common = 2.5-81.el5_8.4
You could try using --skip-broken to work around the problem
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
PackageKit-0.5.8-19.el6.x86_64 has missing requires of PackageKit-yum = ('0', '0.5.8', '19.el6')
PackageKit-0.5.8-19.el6.x86_64 has missing requires of PackageKit-yum-plugin = ('0', '0.5.8', '19.el6')
下面就是为了解决这些问题
yum remove 'rhn-check-1.0.0-61.el6.noarch'
yum instal PackageKit-glib
yum install abrt-addon-ccpp
文章转载自http://www.cnblogs.com/zuiyirenjian/archive/2012/07/26/2609227.html
相关推荐
由于RHEL7的更新包仅对已注册用户开放,对于那些希望免费获得更新的用户来说,将RHEL7系统配置为使用CentOS的YUM源和安装包是一种常见的解决方案。以下我们将详细探讨如何进行这种转换以及涉及的知识点。 首先,...
之后,就可以使用`yum update`或`yum install`命令来更新系统或安装新的软件,此时使用的将是CentOS的仓库。 总的来说,这个博客附件提供的是一套完整的流程,包括了替换RHEL 7的yum源以及更新必要的yum相关组件,...
linux redhat yum 上海交大的CentOS更新源
- **下载新源文件**:下载到的压缩包"redhat换centos的yum源"应该包含了适用于RHEL 6的CentOS YUM源配置文件。 - **解压并替换文件**:将压缩包解压,并将解压出的`.repo`文件复制到`/etc/yum.repos.d`目录下,...
本主题将详细介绍如何将Red Hat Enterprise Linux(RHEL)7.3或7.4的YUM源更改为CentOS的YUM源,这是一个常见的操作,特别是对于那些希望使用免费软件仓库的用户。 首先,理解YUM源的重要性是必要的。YUM是一个包...
- 生成repodata:分别运行`createrepo /media/CentOS8/AppStream/`和`createrepo /media/CentOS8/BaseOS/`,这将自动生成repodata,方便YUM进行索引。 - 创建缓存:`yum makecache`,成功后会看到相关信息。 5. *...
这个yum安装包可用于将RedHat 6.4的收费yum转为CentOS的免费yum。 RedHat Enterprise Linux 6.4使用yum安装出现This system is not registered to Red Hat Subscription Management问题,但是发现激活Redhat的yum...
本篇将详细介绍如何在Red Hat和CentOS系统中修改yum源。 首先,我们为什么要修改yum源?默认的yum源通常位于国外,这可能导致网络延迟高、下载速度慢的问题,尤其是在中国。为了提升下载速度和稳定性,我们可以选择...
4. 确保`gpgcheck=1`,这意味着YUM将在下载RPM包之前检查其GPG签名。为了确保安全,你需要在RPM数据库中注册正确的GPG密钥,例如`gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release`。 5. 保存并关闭配置...
yum-3.2.29-40.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.i686.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm CentOS-Base.repo epel.repo
通用版redhat6或者centos6的yum源
`使用centos的yum替换redhat.txt`很可能是一个文本文件,包含了详细的步骤和说明,指导用户如何将`Redhat6.4`的`yum`源替换为`Centos6`的源。通常,这包括修改`/etc/yum.repos.d/`目录下的配置文件,将其中的`Redhat...
通过将这个仓库添加到`yum.repos.d`,用户可以利用163网易的高速镜像来下载RHEL的更新和软件,从而提高下载速度和稳定性。 `Centos-7-aliyun.repo` 文件则是指向阿里云的CentOS 7软件仓库配置。阿里云同样提供了...
阿里云镜像站是一个非常流行的镜像站点,提供了大量的软件包,这篇文章将指导你如何将 RedHat 7 的 Yum 源修改为阿里云镜像站。 第一步:查看已安装的 Yum 包 在 RedHat 7 中,可以使用以下命令来查看已安装的 Yum...
参考网上这篇文章,卸载redhad自带的yum组建,替代以centos的yum包。 安装之后仍然会提示有问题: /usr/lib/python2.4/site-packages/_sqlitecache.so: wrong ELF class: ELFCLASS32 python版本不兼容,懒得重新...
mv CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo ``` #### 四、更新yum资源库 最后一步,需要更新`yum`资源库,确保所有的软件仓库都是最新的状态。可以通过运行以下命令来完成: ```bash yum ...
### RedHat本地yum源配置及国内镜像源配置 #### 一、RedHat本地yum源配置 ##### 1. 环境准备与检查 **背景介绍:** Red Hat Enterprise Linux(RHEL)是一款广泛使用的Linux发行版,在企业级应用环境中非常受...