Linux   发布时间:2022-04-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了redhat 7.2更新yum源时踩的坑大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

yum 1.检查是否安装yum包 查看RHel是否安装了yum,若是安装了,那么又有哪些yum包: [[email protected] yum.repos.d]# rpm -qa |grep yum yum-3.4.3-118.el7.noarch yum-utils-1.1.31-24.el7.noarch yum-rhn-plugin-2.0.1-4.el7.noarch PackageKi

yum

1.检查是否安装yum包

查看RHel是否安装了yum,若是安装了,那么又有哪些yum包:

[[email protected] yum.repos.d]# rpm -qa |grep yum
yum-3.4.3-118.el7.noarch
yum-utils-1.1.31-24.el7.noarch
yum-rhn-plugin-2.0.1-4.el7.noarch
PackageKit-yum-0.8.9-11.el7.x86_64
yum-langpacks-0.4.2-3.el7.noarch
yum-Metadata-parser-1.1.4-10.el7.x86_64

2 删除redhat自带的yum包

卸载上面显示的所有yum包:

[[email protected] ~]# rpm -qa|grep yum|xargs rpm -e --nodeps(不检查依赖,直接删除rpm包)

再用

[[email protected] ~]# rpm -qa |grep yum

[[email protected] ~]#

查看,无信息显示表示已经卸载完成。

3.安装yum
rpm -ivh yum-* --nodeps
rpm -Uvh rpm-4.11.3-35.el7.x86_64.rpm --nodeps
rpm -Uvh python-urlgrabber-3.10-9.el7.noarch.rpm --nodeps


4.vim /etc/yum.repos.d/CentOs-Base.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-$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


5.清除yum缓存
yum clean all
yum makecache
yum update -y

 

6.安装必要软件
yum install vim net-tools sshd ntp wget lrzsz -y

 

7.调整时间sudo systemctl enable ntpdsudo systemctl start ntpddate 查看时间netdate asia.pool.ntp.org 调整时间

大佬总结

以上是大佬教程为你收集整理的redhat 7.2更新yum源时踩的坑全部内容,希望文章能够帮你解决redhat 7.2更新yum源时踩的坑所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。