抱歉,您的浏览器无法访问本站

本页面需要浏览器支持(启用)JavaScript


了解详情 >

Debian 安装配置

基于 Debian 10 配置.

系统配置

# 换源 https://cloud.tencent.com/developer/article/1590080
# 全球镜像站列表 https://www.debian.org/mirror/list
echo 'xxx' > /etc/apt/sources.list

# 设置 root 密码
sudo passwd root
# 更新
apt-get update
apt-get upgrade

debian 10的源

# 163
deb http://mirrors.163.com/debian/ buster main non-free contrib
deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

deb-src http://mirrors.163.com/debian/ buster main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

# 华为云
deb https://mirrors.huaweicloud.com/debian/ buster main contrib non-free
deb https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free
deb https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free
deb https://mirrors.huaweicloud.com/debian-security/ buster/updates main contrib non-free

deb-src https://mirrors.huaweicloud.com/debian/ buster main contrib non-free
deb-src https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free
deb-src https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free

# 腾讯云
deb http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
deb http://mirrors.cloud.tencent.com/debian-security buster/updates main
deb http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
deb http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib

deb-src http://mirrors.cloud.tencent.com/debian-security buster/updates main
deb-src http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib

# 中科大
deb https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free

deb-src https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free

# 阿里云
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

开启 ssh

apt install openssh-server -y

systemctl start ssh
systemctl enable ssh
systemctl stop ssh
systemctl status ssh
systemctl restart ssh
# 允许root登录
vi /etc/ssh/sshd_config

LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
PasswordAuthentication yes

安装 JDK

apt search jdk
# 安装jdk17
apt install ca-certificates-java
apt install openjdk-17-jdk-headless
# 安装源码
# idea 的话,需要设置下源码的目录,如下图
apt install openjdk-17-source
# 切换jdk版本
update-alternatives --config java

image-20230401144718021

安装 Nginx

apt-get update
apt-get install make gcc libpcre3 libpcre3-dev openssl libssl-dev zlib1g-dev
# 下载nginx源码包
wget http://nginx.org/download/nginx-1.18.0.tar.gz
# 解压到指定目录
tar -zxvf nginx-1.18.0.tar.gz -C /usr/local/
# 进入目录编译安装
./configure --with-http_ssl_module
make
make install
# 修改配置文件
vim /usr/local/nginx/conf/nginx.conf
# 启动服务
cd /usr/local/nginx/sbin
./nginx
# 查看是否启动成功
ps -ef | grep nginx

安装 Ruby

apt install ruby-full ruby-dev

安装 nodejs

apt install nodejs npm

安装 redis

# 下载redis源码
wget https://github.com/redis/redis/archive/7.2.3.tar.gz
# 安装依赖
apt install wget gcc make pkg-config -y
# 进入源码目录
make && make install
# 默认安装位置 /usr/local/bin/

安装 docker

# 添加docker官方GPG key
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# 添加仓库到apt源
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

# 安装
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# 测试
docker run hello-world

安装 mysql

# 下载  APT repository https://dev.mysql.com/downloads/repo/apt/
# sudo dpkg -i /PATH/version-specific-package-name.deb
sudo dpkg -i mysql-apt-config_0.8.16-1_all.deb
# update package infomation
sudo apt-get update
# install
sudo apt-get install mysql-server

安装 ZSH

sudo apt-get install zsh
chsh -s $(which zsh)

安装工具

apt-get install screenfetch
apt-get install neofetch
apt-get install ruby-full
apt-get install gnupg2
apt-get install curl
apt-get install net-tools
apt-get install unzip
apt-get install htop

评论