切换aliyun镜像
https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.503b1b11a0S7ma
切换后,需要更新
sudo apt update
安装
apt-get install openssh-server
准备docker环境
https://developer.aliyun.com/mirror/docker-ce?spm=a2c6h.13651102.0.0.503b1b11a0S7ma
将当前用户添加到docker组中
#1 添加docker用户组(一般安装docker时会自动添加)
sudo groupadd docker
#2 将指定用户添加到docker用户组
sudo gpasswd -a $USER docker
#3 重启docker服务
sudo systemctl restart docker
切换镜像源
https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
执行完毕后,最好重启下
Java 环境准备
openjdk
sudo apt-get install openjdk-8-jdk
openjdk-8-jdk/focal,now 8u252-b09-1ubuntu1 amd64 [已安装]
OpenJDK Development Kit (JDK)
oracle jdk
https://www.oracle.com/java/technologies/javase-downloads.html
sudo tar -xvzf jdk-8u251-linux-x64.tar.gz -C /usr/lib/jvm/
.jdk1.8.0_251.jinfo
name=jdk1.8.0_251
alias=oracle-jdk1.8
priority=1802
section=main
hl rmid /usr/lib/jvm/jdk1.8.0_251/jre/bin/rmid
hl java /usr/lib/jvm/jdk1.8.0_251/jre/bin/java
hl keytool /usr/lib/jvm/jdk1.8.0_251/jre/bin/keytool
hl pack200 /usr/lib/jvm/jdk1.8.0_251/jre/bin/pack200
hl rmiregistry /usr/lib/jvm/jdk1.8.0_251/jre/bin/rmiregistry
hl unpack200 /usr/lib/jvm/jdk1.8.0_251/jre/bin/unpack200
hl orbd /usr/lib/jvm/jdk1.8.0_251/jre/bin/orbd
hl servertool /usr/lib/jvm/jdk1.8.0_251/jre/bin/servertool
hl tnameserv /usr/lib/jvm/jdk1.8.0_251/jre/bin/tnameserv
hl jexec /usr/lib/jvm/jdk1.8.0_251/jre/lib/jexec
jre policytool /usr/lib/jvm/jdk1.8.0_251/jre/bin/policytool
jdk jconsole /usr/lib/jvm/jdk1.8.0_251/bin/jconsole
jdk wsimport /usr/lib/jvm/jdk1.8.0_251/bin/wsimport
jdk rmic /usr/lib/jvm/jdk1.8.0_251/bin/rmic
jdk jinfo /usr/lib/jvm/jdk1.8.0_251/bin/jinfo
jdk jsadebugd /usr/lib/jvm/jdk1.8.0_251/bin/jsadebugd
jdk native2ascii /usr/lib/jvm/jdk1.8.0_251/bin/native2ascii
jdk jstat /usr/lib/jvm/jdk1.8.0_251/bin/jstat
jdk javac /usr/lib/jvm/jdk1.8.0_251/bin/javac
jdk javah /usr/lib/jvm/jdk1.8.0_251/bin/javah
jdk idlj /usr/lib/jvm/jdk1.8.0_251/bin/idlj
jdk jstack /usr/lib/jvm/jdk1.8.0_251/bin/jstack
jdk jrunscript /usr/lib/jvm/jdk1.8.0_251/bin/jrunscript
jdk javadoc /usr/lib/jvm/jdk1.8.0_251/bin/javadoc
jdk javap /usr/lib/jvm/jdk1.8.0_251/bin/javap
jdk jar /usr/lib/jvm/jdk1.8.0_251/bin/jar
jdk extcheck /usr/lib/jvm/jdk1.8.0_251/bin/extcheck
jdk schemagen /usr/lib/jvm/jdk1.8.0_251/bin/schemagen
jdk jps /usr/lib/jvm/jdk1.8.0_251/bin/jps
jdk xjc /usr/lib/jvm/jdk1.8.0_251/bin/xjc
jdk jarsigner /usr/lib/jvm/jdk1.8.0_251/bin/jarsigner
jdk jmap /usr/lib/jvm/jdk1.8.0_251/bin/jmap
jdk appletviewer /usr/lib/jvm/jdk1.8.0_251/bin/appletviewer
jdk jstatd /usr/lib/jvm/jdk1.8.0_251/bin/jstatd
jdk jhat /usr/lib/jvm/jdk1.8.0_251/bin/jhat
jdk jdb /usr/lib/jvm/jdk1.8.0_251/bin/jdb
jdk serialver /usr/lib/jvm/jdk1.8.0_251/bin/serialver
jdk wsgen /usr/lib/jvm/jdk1.8.0_251/bin/wsgen
jdk jcmd /usr/lib/jvm/jdk1.8.0_251/bin/jcmd
jdk javafxpackager /usr/lib/jvm/jdk1.8.0_251/bin/javafxpackager
jdk javapackager /usr/lib/jvm/jdk1.8.0_251/bin/javapackager
jdk javaws /usr/lib/jvm/jdk1.8.0_251/bin/javaws
jdk jcontrol /usr/lib/jvm/jdk1.8.0_251/bin/jcontrol
jdk jdeps /usr/lib/jvm/jdk1.8.0_251/bin/jdeps
jdk jjs /usr/lib/jvm/jdk1.8.0_251/bin/jjs
jdk jmc /usr/lib/jvm/jdk1.8.0_251/bin/jmc
jdk jvisualvm /usr/lib/jvm/jdk1.8.0_251/bin/jvisualvm
准备 update-alternatives 环境
sudo update-alternatives --install /usr/bin/appletviewer appletviewer /usr/lib/jvm/jdk1.8.0_251/bin/appletviewer 1802
sudo update-alternatives --install /usr/bin/extcheck extcheck /usr/lib/jvm/jdk1.8.0_251/bin/extcheck 1802
sudo update-alternatives --install /usr/bin/idlj idlj /usr/lib/jvm/jdk1.8.0_251/bin/idlj 1802
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.8.0_251/bin/jar 1802
sudo update-alternatives --install /usr/bin/jarsigner jarsigner /usr/lib/jvm/jdk1.8.0_251/bin/jarsigner 1802
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_251/jre/bin/java 1802
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0_251/bin/javac 1802
sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.8.0_251/bin/javadoc 1802
sudo update-alternatives --install /usr/bin/javafxpackager javafxpackager /usr/lib/jvm/jdk1.8.0_251/bin/javafxpackager 1802
sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/jdk1.8.0_251/bin/javah 1802
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk1.8.0_251/bin/javap 1802
sudo update-alternatives --install /usr/bin/javapackager javapackager /usr/lib/jvm/jdk1.8.0_251/bin/javapackager 1802
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.8.0_251/bin/javaws 1802
sudo update-alternatives --install /usr/bin/jcmd jcmd /usr/lib/jvm/jdk1.8.0_251/bin/jcmd 1802
sudo update-alternatives --install /usr/bin/jconsole jconsole /usr/lib/jvm/jdk1.8.0_251/bin/jconsole 1802
sudo update-alternatives --install /usr/bin/jcontrol jcontrol /usr/lib/jvm/jdk1.8.0_251/bin/jcontrol 1802
sudo update-alternatives --install /usr/bin/jdb jdb /usr/lib/jvm/jdk1.8.0_251/bin/jdb 1802
sudo update-alternatives --install /usr/bin/jdeps jdeps /usr/lib/jvm/jdk1.8.0_251/bin/jdeps 1802
sudo update-alternatives --install /usr/bin/jexec jexec /usr/lib/jvm/jdk1.8.0_251/jre/lib/jexec 1802
sudo update-alternatives --install /usr/bin/jhat jhat /usr/lib/jvm/jdk1.8.0_251/bin/jhat 1802
sudo update-alternatives --install /usr/bin/jinfo jinfo /usr/lib/jvm/jdk1.8.0_251/bin/jinfo 1802
sudo update-alternatives --install /usr/bin/jjs jjs /usr/lib/jvm/jdk1.8.0_251/bin/jjs 1802
sudo update-alternatives --install /usr/bin/jmap jmap /usr/lib/jvm/jdk1.8.0_251/bin/jmap 1802
sudo update-alternatives --install /usr/bin/jmc jmc /usr/lib/jvm/jdk1.8.0_251/bin/jmc 1802
sudo update-alternatives --install /usr/bin/jps jps /usr/lib/jvm/jdk1.8.0_251/bin/jps 1802
sudo update-alternatives --install /usr/bin/jrunscript jrunscript /usr/lib/jvm/jdk1.8.0_251/bin/jrunscript 1802
sudo update-alternatives --install /usr/bin/jsadebugd jsadebugd /usr/lib/jvm/jdk1.8.0_251/bin/jsadebugd 1802
sudo update-alternatives --install /usr/bin/jstack jstack /usr/lib/jvm/jdk1.8.0_251/bin/jstack 1802
sudo update-alternatives --install /usr/bin/jstat jstat /usr/lib/jvm/jdk1.8.0_251/bin/jstat 1802
sudo update-alternatives --install /usr/bin/jstatd jstatd /usr/lib/jvm/jdk1.8.0_251/bin/jstatd 1802
sudo update-alternatives --install /usr/bin/jvisualvm jvisualvm /usr/lib/jvm/jdk1.8.0_251/bin/jvisualvm 1802
sudo update-alternatives --install /usr/bin/keytool keytool /usr/lib/jvm/jdk1.8.0_251/jre/bin/keytool 1802
sudo update-alternatives --install /usr/bin/native2ascii native2ascii /usr/lib/jvm/jdk1.8.0_251/bin/native2ascii 1802
sudo update-alternatives --install /usr/bin/orbd orbd /usr/lib/jvm/jdk1.8.0_251/jre/bin/orbd 1802
sudo update-alternatives --install /usr/bin/pack200 pack200 /usr/lib/jvm/jdk1.8.0_251/jre/bin/pack200 1802
sudo update-alternatives --install /usr/bin/policytool policytool /usr/lib/jvm/jdk1.8.0_251/jre/bin/policytool 1802
sudo update-alternatives --install /usr/bin/rmic rmic /usr/lib/jvm/jdk1.8.0_251/bin/rmic 1802
sudo update-alternatives --install /usr/bin/rmid rmid /usr/lib/jvm/jdk1.8.0_251/jre/bin/rmid 1802
sudo update-alternatives --install /usr/bin/rmiregistry rmiregistry /usr/lib/jvm/jdk1.8.0_251/jre/bin/rmiregistry 1802
sudo update-alternatives --install /usr/bin/schemagen schemagen /usr/lib/jvm/jdk1.8.0_251/bin/schemagen 1802
sudo update-alternatives --install /usr/bin/serialver serialver /usr/lib/jvm/jdk1.8.0_251/bin/serialver 1802
sudo update-alternatives --install /usr/bin/servertool servertool /usr/lib/jvm/jdk1.8.0_251/jre/bin/servertool 1802
sudo update-alternatives --install /usr/bin/tnameserv tnameserv /usr/lib/jvm/jdk1.8.0_251/jre/bin/tnameserv 1802
sudo update-alternatives --install /usr/bin/unpack200 unpack200 /usr/lib/jvm/jdk1.8.0_251/jre/bin/unpack200 1802
sudo update-alternatives --install /usr/bin/wsgen wsgen /usr/lib/jvm/jdk1.8.0_251/bin/wsgen 1802
sudo update-alternatives --install /usr/bin/wsimport wsimport /usr/lib/jvm/jdk1.8.0_251/bin/wsimport 1802
sudo update-alternatives --install /usr/bin/xjc xjc /usr/lib/jvm/jdk1.8.0_251/bin/xjc 1802
uc@uc:/usr/lib/jvm$ update-java-alternatives -l
java-1.8.0-openjdk-amd64 1081 /usr/lib/jvm/java-1.8.0-openjdk-amd64
jdk1.8.0_251 1802 /usr/lib/jvm/jdk1.8.0_251
切换测试
uc@uc:/usr/lib/jvm$ sudo update-java-alternatives -s java-1.8.0-openjdk-amd64
uc@uc:/usr/lib/jvm$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1ubuntu1-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
uc@uc:/usr/lib/jvm$ sudo update-java-alternatives -s jdk1.8.0_251
uc@uc:/usr/lib/jvm$ java -version
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
galternatives支持图形化操作
开发工具idea
tar -xvzf ideaIU-2019.2.4.tar.gz -C .
# custome vmoptions
-javaagent:jetbrains-agent.jar
Java版本管理maven
tar -xvzf apache-maven-3.6.2-bin.tar.gz -C .
#/etc/enviornment
MVN_HOME=/../../apache-maven-3.6.2
PATH="$MVN_HOME/bin:...."
Node版本管理 nvm
https://github.com/nvm-sh/nvm#install–update-script