记录一下,便于后面再次安装。
更改yum为阿里云源
官方页面:https://developer.aliyun.com/mirror/centos
配置方法
1. 备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2. 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
CentOS 6
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
CentOS 8
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
3. 运行 yum makecache 生成缓存
4. 其他
非阿里云ECS用户会出现 Couldn't resolve host 'mirrors.cloud.aliyuncs.com' 信息,不影响使用。用户也可自行修改相关配置: eg:
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
安装wget
yum install wget -y
安装web环境
安装jdk1.8
1.下载
https://www.oracle.com/java/technologies/downloads/#java8
2.解压
tar -zxvf jdk-8u301-linux-x64.tar.gz
3.移动
mv jdk1.8.0_301/ /usr/local/
4.设置环境变量
vim /etc/profile
改为你的真实路径
#java environment
export JAVA_HOME=/usr/local/jdk1.8.0_301
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
扫码在手机查看
您没有登录或者此篇文章不允许评论哟~~
暂无评论