一、修改国内源
首先用DVD1(4G左右)离线安装(不联网,否则排错麻烦),勾选lxde、lxqt、xfce都行(均为轻量级图形界面,非常适合服务器,排前最轻,lxde已经基本停止支持了,发展为lxqt,xfce内存多占200M,但图形好很多)、openssh-server (其他不安装)
sudo vi /etc/apt/sources.list
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.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
二、安装常用组件(这里考虑今后公司内网的情况,在互联网获取离线包,实际用dpkg安装)
mkdir offline
cd offline
# 理论上装vim libssl-dev iputils-ping net-tools 就行
# sysstat 主要是引入sar命令监控cpu资源用的
items="vim libssl-dev iputils-ping net-tools curl gcc g++ cmake wget sysstat apt-utils zlib1g-dev python3-pip"
sudo apt-get update
sudo apt-get download $(sudo apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends $items | grep -v i386 | grep "^\w")
# offline.dev.tgz 拿到公司内网更新用
tar zcvf debian-offline.deb.tgz *
mv debian-offline.deb.tgz ..
sudo dpkg -i $(ls)
三、离线安装docker(很简单,参照另一文)