1138 字
6 分钟
软件开发工具安装
此文档用于自我备份,基于自身常用操作系统,需要时可以即时查询。
安装前统一执行更新命令。
sudo apt update && sudo apt upgrade -yDocker
安装
非大陆服务器
curl -fsSL https://get.docker.com | sudo sh大陆服务器
export DOWNLOAD_URL="https://mirrors.tuna.tsinghua.edu.cn/docker-ce"curl -fsSL https://raw.githubusercontent.com/docker/docker-install/master/install.sh | sh验证
$ docker -vDocker version 29.1.2, build 890dcca$ sudo docker run --rm hello-worldUnable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-world17eec7bbc9d7: Pull completeea52d2000f90: Download completeDigest: sha256:f7931603f70e13dbd844253370742c4fc4202d290c80442b2e68706d8f33ce26Status: Downloaded newer image for hello-world:latest
Hello from Docker!This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/
For more examples and ideas, visit: https://docs.docker.com/get-started/Docker Compose
安装
sudo curl -SL https://github.com/docker/compose/releases/download/v2.40.3/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose赋予执行权限
sudo chmod +x /usr/local/bin/docker-compose验证
$ docker compose versionDocker Compose version v2.40.3nvm
nvm(Node Version Manager)是一款 Node.js 多版本管理器。
安装
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash正常安装完会自动把如下代码片段加入到 ~/.zshrc(如果shell是zsh):
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --no-use # This loads nvm, without auto-using the default version如果没有,请手动添加。
然后可以执行 source ~/.zshrc 加载环境,或者开启新的终端。
验证
➜ ~ nvm -v0.39.3接下来可以通过 nvm 来安装 Node.js:
nvm install v20.18.0如果是首次安装,将会自动配置系统 Node.js 为 v20.18.0 版本,也可以手动选择版本:
nvm use v20.18.0查看node 和 npm 的版本:
➜ ~ node -vv20.18.0➜ ~ npm -v10.8.2pnpm
安装
npm install -g pnpm@latest-10验证
➜ ~ pnpm -v10.25.0Rust
安装
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh验证
➜ ~ rustc --versionrustc 1.91.1 (ed61e7d7e 2025-11-07)JDK
以JDK 8为例。
安装
OpenJDK
sudo apt install openjdk-8-jdk配置环境变量,将如下代码块添加至 ~/.zshrc(如果shell是zsh):
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64export PATH=$JAVA_HOME/bin:$PATH然后执行 source ~/.zshrc 。
验证
➜ ~ which java/bin/java➜ ~ java -versionopenjdk version "1.8.0_472"OpenJDK Runtime Environment (build 1.8.0_472-8u472-ga-1~24.04-b08)OpenJDK 64-Bit Server VM (build 25.472-b08, mixed mode)➜ ~ echo $JAVA_HOME/usr/lib/jvm/java-8-openjdk-amd64Maven
前提
- Java 8+
安装
sudo apt install maven通过 apt 安装的版本为 3.8.7,如需其他版本需通过二进制安装的方式。
cd ~wget https://archive.apache.org/dist/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.tar.gztar -zxvf apache-maven-3.9.11-bin.tar.gzsudo mv apache-maven-3.9.11 /usr/share/mavenrm apache-maven-3.9.11-bin.tar.gz配置环境变量,将如下代码块添加至 ~/.zshrc(如果shell是zsh):
# Mavenexport MAVEN_HOME=/usr/share/mavenexport PATH=$MAVEN_HOME/bin:$PATH然后执行 source ~/.zshrc 。
验证
➜ ~ mvn -vApache Maven 3.9.11 (3e54c93a704957b63ee3494413a2b544fd3d825b)Maven home: /usr/share/mavenJava version: 1.8.0_472, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jreDefault locale: en_US, platform encoding: UTF-8OS name: "linux", version: "6.14.0-37-generic", arch: "amd64", family: "unix"MariaDB
安装
sudo apt install mariadb-server mariadb-client galera-4安装后
➜ ~ sudo mariadb-secure-installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the currentpassword for the root user. If you've just installed MariaDB, andhaven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobodycan log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
Switch to unix_socket authentication [Y/n] n ... skipping.
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n]New password:Re-enter new password:Password updated successfully!Reloading privilege tables.. ... Success!
By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into aproduction environment.
Remove anonymous users? [Y/n] ... Success!
Normally, root should only be allowed to connect from 'localhost'. Thisensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] ... Success!
By default, MariaDB comes with a database named 'test' that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.
Remove test database and access to it? [Y/n] - Dropping test database... ... Success! - Removing privileges on test database... ... Success!
Reloading the privilege tables will ensure that all changes made so farwill take effect immediately.
Reload privilege tables now? [Y/n] ... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDBinstallation should now be secure.
Thanks for using MariaDB!验证
➜ ~ sudo systemctl status mariadb● mariadb.service - MariaDB 10.11.13 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: > Active: active (running) since Sun 2025-12-14 00:10:56 CST; 7min ago Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Main PID: 40629 (mariadbd) Status: "Taking your SQL requests now..." Tasks: 10 (limit: 187724) Memory: 78.8M (peak: 84.3M) CPU: 264ms CGroup: /system.slice/mariadb.service └─40629 /usr/sbin/mariadbdRedis
安装
sudo apt install redis-server验证
➜ ~ sudo systemctl status redis-server● redis-server.service - Advanced key-value store Loaded: loaded (/usr/lib/systemd/system/redis-server.service; enabled; preset: enabled) Active: active (running) since Sun 2025-12-14 15:05:32 CST; 20s ago Docs: http://redis.io/documentation, man:redis-server(1) Main PID: 32587 (redis-server) Status: "Ready to accept connections" Tasks: 5 (limit: 28443) Memory: 3.4M (peak: 4.7M) CPU: 56ms CGroup: /system.slice/redis-server.service └─32587 "/usr/bin/redis-server 127.0.0.1:6379"启动Redis客户端
➜ ~ redis-cli127.0.0.1:6379> pingPONG