赞
踩
1、首先查看redhat 7.0系统本身所安装的那些yum 软件包:
[root@localhost ~]# rpm -qa | grep yum
2、卸载原始的yum 在查看
[root@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps
[root@localhost ~]# rpm -qa | grep yum
3、保证本机电脑能上网;
[root@localhost ~]# ping www.baidu.com
4、下载安装包
链接:http://rpm.pbone.net/
或者使用 http://mirrors.163.com/centos/7/os/x86_64/Packages/
不报错版本安装包: 这里需要根据不同的linux系统来下载不同的yum源
yum-3.4.3-132.el7.centos.0.1.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
yum-updateonboot-1.1.31-34.el7.noarch.rpm
yum-utils-1.1.31-34.el7.noarch.rpm
或者用
yum-plugin-fastestmirror-1.1.31-34.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-3.4.3-132.el7.centos.0.1.noarch
5、讲下载的安装包上传到linux中
6、执行安装命令
[root@localhost ~]# rpm -ivh yum-*
7、新建repo 配置文件; 新建之前将 /etc/yum.repos.d下面的文件全部删除,新建CentOS-Base.repo文件,设置网易的yum源或者阿里云的
[root@linuxidc ~]# vim /etc/yum.repos.d/CentOS-Base.repo
内容如下 这里也是需要考虑你自己是什么linux版本
这个是网易的yum源 CentOS镜像使用帮助
- #entOS-Base.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-$7 - Base - 163.com
- #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os
- baseurl=http://mirrors.163.com/centos/7/os/$basearch/
- gpgcheck=1
- gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
-
- #released updates
- [updates]
- name=CentOS-$7 - Updates - 163.com
- #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates
- baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
- gpgcheck=1
- gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
-
- #additional packages that may be useful
- [extras]
- name=CentOS-$7 - Extras - 163.com
- #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras
- baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
- gpgcheck=1
- gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
-
- #additional packages that extend functionality of existing packages
- [centosplus]
- name=CentOS-$7 - Plus - 163.com
- baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
- gpgcheck=1
- enabled=0
- gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
8、清除缓存:
[root@linuxidc ~]#
yum clean all yum makecache
9、测试安装是否正常;
[root@linuxidc ~]# yum -y install lftp
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。