wangjie-fourth 的个人博客

may be just need work hard

目录
linux简单软件安装
/  

linux简单软件安装

初始化操作

1、更新yum

# 进入目录
cd /etc/yum.repos.d/
# 安装wget
yum install wget
# 下载CentOS6-Base-163.repo,若wget不可用或者无法下载,请在本地下载好后上传至/etc/yum.repos.d/文件
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
# 替换CentOS6-Base-163.repo文件中的内容
sed -i 's#$releasever#6#g' CentOS6-Base-163.repo

# 更新yum
yum clean all
yum makecache
yum -y update
yum install -y gcc-c++ 
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
yum install -y sudo
yum install -y vim

不知道为什么这么做~可能就更新把

JDK下载与安装

1、普通安装

# 下载JDK
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3a%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk8-downloads-2133151.html; oraclelicense=accept-securebackup-cookie;" "https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz"

# 解压
tar -zxvf jdk-8u191-linux-x64.tar.gz -C /data/hzero/java

# 配置环境变量
vim /etc/profile.d/java.sh

# 输入
#set java environment
if [ -z "$JAVA_HOME" ]; then
JAVA_HOME=/data/hzero/java/jdk1.8.0_191
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
fi

# 初始化环境变量
source /etc/profile

# 验证
java -version

2、rpm安装

# 下载JDK
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm

# 添加执行权限
`chmod 755 jdk-8u131-linux-x64.rpm` 

# 执行rpm命令安装
`rpm -ivh jdk-8u131-linux-x64.rpm`

# 查看是否安装成功
`java -version`

https://www.jianshu.com/p/92ac63dd5c2e并不需要设置JAVA_HOME

maven下载与安装

# 下载
wget http://mirror.cc.columbia.edu/pub/software/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz

# 解压 
tar -zxvf apache-maven-3.6.3-bin.tar.gz -C /data/hzero/maven

# 配置环境变量
cd /etc/profile.d
vi maven.sh

# 输入
#set maven environment
if [ -z "$MAVEN_HOME" ]; then
MAVEN_HOME=/data/hzero/maven/
PATH=$MAVEN_HOME/bin:$PATH
export MAVEN_HOME PATH
fi

# 初始化环境变量
source /etc/profile

# 验证
mvn -v

Git下载与安装

# 下载
yum install git-all

# 验证
git --version

Docker安装

# 移除原版本
yum remove docker docker-common docker-selinux
# 安装依赖
yum install -y yum-utils device-mapper-persistent-data
# 配置repo
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# 安装指定docker版本:18.09.0-3.el7,其他版本请使用yum list docker-ce --showduplicates | sort -r查看可安装的docker版本
yum install -y docker-ce-18.06.0.ce-3.el7 docker-ce-cli-18.06.0.ce-3.el7 containerd.io
# 启动docker并设置为开机自启动
systemctl start docker
systemctl enable docker
# 查看版本
docker -v

tomcat安装

 wget https://mirrors.cnnic.cn/apache/tomcat/tomcat-8/v8.5.53/bin/apache-tomcat-8.5.53.tar.gz

https://mirrors.cnnic.cn/apache/tomcat/tomcat-8/v8.5.53/bin/


标题:linux简单软件安装
作者:wangjie-fourth
地址:https://wangjie.natappvip.cc/articles/2020/04/09/1586431284200.html

评论