安装wegt、vim
yum -y install wget
yum -y install vim
换源
备份源文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载更改源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
清空yum缓存并生存cache文件
yum clean all
yum makecache
尝试更新系统
yum -y update
安装jdk
rpm -qa | grep jdk ##抓取关键字
tar -zxvf xxxx.tar.gz ##解压命令
vim /etc/profile
jdk1.8
export JAVA_HOME=/usr/local/java/jdk1.8.0_251
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
使配置生效
source /etc/profile