yum
1.检查是否安装yum包
查看RHEL是否安装了yum,若是安装了,那么又有哪些yum包:
[root@syq yum.repos.d]# rpm -qa |grep yum
yum-3.4.3-118.el7.noarchyum-utils-1.1.31-24.el7.noarchyum-rhn-plugin-2.0.1-4.el7.noarchPackageKit-yum-0.8.9-11.el7.x86_64yum-langpacks-0.4.2-3.el7.noarchyum-metadata-parser-1.1.4-10.el7.x86_642 删除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-* --nodepsrpm -Uvh rpm-4.11.3-35.el7.x86_64.rpm --nodepsrpm -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=osbaseurl=http://mirrors.163.com/centos/7/os/$basearch/gpgcheck=1gpgkey=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=updatesbaseurl=http://mirrors.163.com/centos/7/updates/$basearch/gpgcheck=1gpgkey=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=extrasbaseurl=http://mirrors.163.com/centos/7/extras/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$7 - Plus - 163.combaseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 5.清除yum缓存yum clean allyum makecacheyum 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 调整时间