Redhat7.3安装wget及yum命令方法
之前讲过Redhat6.4安装yum命令方法,今天有折腾了一下Redhat7.3版本,记录一下。
Redhat6.4安装参考: VMware Workstation安装Redhat6.4全过程附图(二)
1、Wget安装
Redhat7.3最小安装wget命令也需要自己安装一下,wget下载地址:http://mirrors.163.com/centos/7/os/x86_64/Packages/wget-1.14-18.el7_6.1.x86_64.rpm
下载到/usr/local/soft目录后,执行rpm -ivh wget-1.14-18.el7_6.1.x86_64.rpm安装。
2、Yum必须的rpm文件下载
进入/usr/local目录,创建一个soft文件夹,将安装yum所需要的包下载到soft文件夹下。
wget https://vault.centos.org/7.3.1611/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm wget https://vault.centos.org/7.3.1611/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm wget https://vault.centos.org/7.3.1611/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm wget https://vault.centos.org/7.3.1611/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm wget https://vault.centos.org/7.3.1611/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm
3、卸载系统自带的yum相关安装
3.1 查看原来是否安装yum: rpm -qa | grep yum
3.2 直接卸载自带的yum: rpm -qa|grep yum|xargs rpm -e --nodeps
3.3 查看是否卸载干净: rpm -qa |grep yum
4、安装centos源yum
依次安装之前下载的5个rpm文件
rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm rpm -ivh python-urlgrabber-3.10-8.el7.noarch.rpm rpm -ivh yum-3.4.3-150.el7.centos.noarch.rpm --force --nodeps rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm rpm -ivh yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm --force --nodeps
5、rhel-source.repo配置
编辑rhel-source.repo文件
编辑命令:vi /etc/yum.repos.d/rhel-source.repo,将文件原内容清空,替换为下面的内容
# CentOS-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-$releasever - Base - 163.com baseurl=http://mirrors.163.com/centos/7/os/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
6、卸载subscription-manager
查看subscription-manager版本: rpm -qa | grep subscription-manager
卸载subscription-manager:rpm -e subscription-manager-1.1.23-1.el6.x86_64
7、yum验证
清除缓存: yum clean all
测试,再次安装rzsz命令:yum -y install lrzsz,执行成功。
建立元数据缓存:yum makecache