1. 程式人生 > >在red hat中安裝yum

在red hat中安裝yum

1、首先檢視redhat 7.0系統本身所安裝的那些yum 軟體包: 
[[email protected] ~]# rpm -qa | grep yum 

2、解除安裝原始的yum  在檢視
[[email protected] ~]# rpm -qa|grep yum|xargs rpm -e --nodeps
[[email protected] ~]# rpm -qa | grep yum 

3、保證本機電腦能上網; 
[[email protected] ~]# ping www.baidu.com 

4、下載安裝包
連結:http://rpm.pbone.net/
不報錯版本安裝包:
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

5、講下載的安裝包上傳到linux中

6、執行安裝命令
[[email protected]

~]# rpm -ivh yum-*    

7、新建repo 配置檔案;
[[email protected] ~]# vim /etc/yum.repos.d/CentOS-Base.repo
內容如下

#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、清除快取:
[[email protected] ~]# yum clean all

9、測試安裝是否正常;
[[email protected] ~]# yum -y install lftp