修改国内源
首先用DVD1(4G左右)离线安装(不联网,否则排错麻烦),勾选xfce(轻量级图形界面,非常适合服务器 ),、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
apt-get update
安装常用组件(这里考虑今后公司内网的情况,在互联网获取离线包,实际用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++ wget sysstat apt-utils zlib1g-dev python3-pip automake make bison flex libelf-dev bc tightvncserver"
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)
下载内核源码,解压,进入内核源码文件夹目录
cp /boot/config-4.19.0-14-amd64 .config
make olddefconfig
注释掉.config文件中四处配置:CONFIG_MODULE_SIG_ALL、CONFIG_MODULE_SIG_KEY、CONFIG_SYSTEM_TRUSTED_KEYS和CONFIG_DEBUG_INFO
make clean && make -j 3
make modules_install
make install
update-grub
重启,检查新内核:
uname -r
删除旧内核:
sudo apt remove --purge linux-image-4.19.0-6-amd64
不确定的话可以先查看有哪些旧内核:
dpkg -l | grep linux-image | awk '{print$2}'
此命令我得到两条结果:
linux-image-4.19.0-6-amd64
linux-image
删除第一个就会顺带把第二个也删了。