在VMware中安装ISO镜像文件
最小化安装
关闭su密码
终端输入命令sudo visudo,打开 visudo;
找到 %sudo ALL=(ALL:ALL) ALL 这一行修改为%sudo ALL=(ALL:ALL) NOPASSWD:ALL
换源
sudo gedit /etc/apt/sources.list
新增如下
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
关闭文件后
sudo apt-get update
sudo apt autoremove
下载编译环境
uname -a
cd /usr/src
sudo wget -c http://www.kernel.org/pub/linux/kernel/v5.x/linux-5.13.1.tar.xz
sudo apt-get install build-essential
sudo apt-get install libncurses5 libncurses5-dev
sudo apt-get install fakeroot
sudo apt-get install initramfs-tools
sudo apt-get install module-init-tools
sudo apt-get install flex bison
sudo tar -xvf linux-5.13.1.tar.xz
config
sudo cp /boot/config-$(uname -r) .config
sudo make menuconfig
make
sudo make -j8
sudo make modules -j8
sudo make modules_install
sudo make install