Debian 安装使用 Cloud 内核

个人电脑的系统主要还是使用苹果的macOS,辅助使用微软的Windows 10,手上Linux的机器使用的Debian 10,且全部都是远程VPS,因此将Debian中的内核全部升级为 cloud 内核。

cloud 内核的包名是 linux-image-cloud-amd64,可以直接从官方源安装:

apt update
apt install linux-image-cloud-amd64 -y

Debian 10 安装完的内核为4.19.0-17-cloud-amd64,具体可参考官方的软件包

如果需要安装5.10内核,则需要从 backports 源安装:

echo "deb buster-backports main" > /etc/apt/sources.list.d/buster-backports.list 
apt update
apt -t buster-backports install linux-image-cloud-amd64



dpkg --get-selections | grep linux
apt autoremove --purge linux-image-4.19.0-5-amd64
apt autoremove
apt autoclean

那么 cloud 内核是什么呢?包页面对 linux-image-cloud-amd64 的说明是:

This package depends on the latest Linux kernel and modules for use on cloud platforms including Amazon EC2, Microsoft Azure, and Google Compute Engine.

即专门为云平台而优化的,具体可以从 News from the Debian Cloud Team 中一探究竟:

A cloud-specific Linux package (linux-image-cloud) allowed us to disable features that are not relevant in cloud environments and enable what is really important. For example, features related to bluetooth and sound support are disabled and some drivers needed by the cloud providers are enabled. To illustrate that, Amazon EC2 uses Elastic Network Adapter (ENA) support and Intel Corporation 82599 Ethernet Controller Virtual Function, and Microsoft Azure uses Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function], all of them are enabled by default in linux-image-cloud package (and are not needed at all by regular Debian users). Furthermore, the grub-cloud package was created to provide some specific cloud setup on top of regular grub packages, it installs grub for the PC/BIOS and the EFI-AMD64 architecture.

有些特性是云环境不需要的,像蓝牙、声音的支持,Cloud 内核剔除了这些无用模块的同时添加了几乎只有云平台会用到的驱动程序。在 KVM 虚拟化的机器中,cloud 内核表现良好。


标签: Debian