大家好,又见面了,我是你们的朋友全栈君。
Redhat的yum配置
Redhat Linux是免费的操作系统,但是里面的yum服务是收费的,有的时候我们安装软件必须从yum上面安装。虽然Redhat的yum是收费的,但我们可以使用CentOS的yum代替Redhat的yum,下面我们就要讲解一下如何安装。
1.检查系统是否安装了yum包
rpm -qa |grep yum
2.删除自带的yum包
rpm -qa|grep yum|xargs rpm -e --nodeps
因为一些包之间可能会有依赖关系,所以我们需要加上参数 –nodeps 无视依赖关系。
3.下载yum包
下载地址:http://mirrors.163.com/centos/
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
如果报错,请自行去开源网站下载
4.解压yum包
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
这里注意的是yum-3.2.29-73.el6.centos.noarch.rpm和yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm相互依赖,缺一不可,安装的时候必须同时安装才能
5.替换yum源
下载yum源,这里使用的是163的yum源
cd /etc/yum.repos.d/ 进入目录 wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 下载到这个目录 vi CentOS6-Base-163.repo 编辑这个文件
如果是提前下载好CentOS6-Base,直接移动到/etc/yum.repos.d/就行
mv rhel-source.repo rhel-source.repo.bak mv CentOS6-Base-163.repo rhel-source.repo
6. 编辑替换后的rhel-source.repo。
#rhel-source.repo # # 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-6 - Base - 163.com baseurl=http://mirrors.163.com/centos/6/os/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-6 - Updates - 163.com baseurl=http://mirrors.163.com/centos/6/updates/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-6 - Extras - 163.com baseurl=http://mirrors.163.com/centos/6/extras/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
7. 清理并重建缓存
yum clean all yum makecache
8. 更新yum
yum update
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/154915.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...