当前位置:   article > 正文

在red hat中安装yum_redhat安装yum命令

redhat安装yum命令

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镜像使用帮助

  1. #entOS-Base.repo
  2. #
  3. # The mirror system uses the connecting IP address of the client and the
  4. # update status of each mirror to pick mirrors that are updated to and
  5. # geographically close to the client.  You should use this for CentOS updates
  6. # unless you are manually picking other mirrors.
  7. #
  8. # If the mirrorlist= does not work for you, as a fall back you can try the
  9. # remarked out baseurl= line instead.
  10. #
  11. #
  12. [base]
  13. name=CentOS-$7 - Base - 163.com
  14. #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os
  15. baseurl=http://mirrors.163.com/centos/7/os/$basearch/
  16. gpgcheck=1
  17. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
  18. #released updates
  19. [updates]
  20. name=CentOS-$7 - Updates - 163.com
  21. #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates
  22. baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
  23. gpgcheck=1
  24. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
  25. #additional packages that may be useful
  26. [extras]
  27. name=CentOS-$7 - Extras - 163.com
  28. #mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras
  29. baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
  30. gpgcheck=1
  31. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
  32. #additional packages that extend functionality of existing packages
  33. [centosplus]
  34. name=CentOS-$7 - Plus - 163.com
  35. baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
  36. gpgcheck=1
  37. enabled=0
  38. 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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/168829
推荐阅读
相关标签
  

闽ICP备14008679号