redhat 7.2更新yum源时踩的坑
yum
1.检查是否安装yum包
查看RHEL是否安装了yum,若是安装了,那么又有哪些yum包:
[root@syq 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包:
[root@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps(不检查依赖,直接删除rpm包)
再用
[root@localhost ~]# rpm -qa |grep yum
[root@localhost ~]#
查看,无信息显示表示已经卸载完成。
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 ntpd
sudo systemctl start ntpd
date 查看时间
netdate asia.pool.ntp.org 调整时间
相关文章
- Unity3D热更新全书-PageZero
- GOT Online for Unreal 功能更新
- Word控件Spire.Doc更新至最新版v10.7,增强产品稳定性,修复老版本漏洞
- 抓取天涯文章的蜘蛛代码,刚经过更新(因为天涯页面HTML代码变化)
- 权限表管理之更新权限表数据
- stm32mp157教程之linux系统移植(总23讲,陆续更新)
- centos使用yum安装或者更新时总是提示被PackageKit占用
- Hibernate批处理操作优化 (批量插入、更新与删除)
- 三星未及时提供系统更新 荷兰消协把它告上法庭
- 华为商品管理系统批量更新商品时提示:请至少输入一组国家码和价格
- 【python】Windows 系统 chrome禁止更新