首先使用下面的命令更新源:
sudo apt updaete
然后使用下面的命令搜索内核版本:
sudo apt search image | grep ^linux-image | awk '{print $1}' | awk -F '/' '{print $1}' | grep -Po "^linux-image-\d+\.*\d+.*"
结果如下:
l@l:~/桌面$ sudo apt search image | grep ^linux-image | awk '{print $1}' | awk -F '/' '{print $1}' | grep -Po "^linux-image-\d+\.*\d+.*"
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
linux-image-4.15.0-10-generic
linux-image-4.15.0-10-lowlatency
linux-image-4.15.0-1001-aws
linux-image-4.15.0-1001-gcp
linux-image-4.15.0-1003-azure
linux-image-4.15.0-1003-kvm
linux-image-4.15.0-13-generic
linux-image-4.15.0-13-lowlatency
linux-image-5.10.0-1-generic
linux-image-5.10.0-2-generic
linux-image-5.10.0-3-generic
linux-image-5.4.0-1002-oem
linux-image-5.4.0-1009-aws
linux-image-5.4.0-1009-gcp
linux-image-5.4.0-1009-kvm
linux-image-5.4.0-1009-oracle
linux-image-5.4.0-1010-azure
linux-image-5.4.0-26-generic
linux-image-5.4.0-26-lowlatency
linux-image-5.4.0-29-generic
linux-image-5.4.0-29-lowlatency
linux-image-5.4.18-15-generic
linux-image-5.4.18-15-lowlatency
linux-image-5.4.18-16-generic
linux-image-5.4.18-16-lowlatency
linux-image-5.4.18-17-generic
linux-image-5.4.18-17-lowlatency
linux-image-5.4.18-18-generic
linux-image-5.4.18-18-lowlatency
linux-image-5.4.18-19-generic
linux-image-5.4.18-19-lowlatency
linux-image-5.4.18-20-generic
linux-image-5.4.18-20-lowlatency
linux-image-5.4.18-21-generic
linux-image-5.4.18-21-lowlatency
linux-image-5.4.18-22-generic
linux-image-5.4.18-22-lowlatency
linux-image-5.4.18-23-generic
linux-image-5.4.18-23-lowlatency
linux-image-5.4.18-24-generic
linux-image-5.4.18-24-lowlatency
linux-image-5.4.18-25-generic
linux-image-5.4.18-26-generic
linux-image-5.4.18-27-generic
linux-image-5.4.18-28-biv
linux-image-5.4.18-28-generic
linux-image-5.4.18-29-biv
linux-image-5.4.18-29-generic
linux-image-5.4.18-30-biv
linux-image-5.4.18-30-generic
linux-image-5.4.18-31-biv
linux-image-5.4.18-31-generic
linux-image-5.4.18-32-biv
linux-image-5.4.18-32-generic
linux-image-5.4.18-33-biv
linux-image-5.4.18-33-generic
linux-image-5.4.18-34-biv
linux-image-5.4.18-34-generic
linux-image-5.4.18-35-biv
linux-image-5.4.18-35-generic
linux-image-5.6.0-1007-oem
l@l:~/桌面$
然后选择一个你需要安装的版本,例如:
linux-image-5.4.18-35-generic
此时需要执行的安装命令就是:
sudo apt install -y linux-image-5.4.18-35-generic linux-headers-5.4.18-35-generic
也就是说: 安装内核必须同时安装两个包:
- linux-image
- linux-headers
并且必须安装同版本
|