Debian 更换 Cloud kernel
2024.09.01
技术教程 4129 Words
- Views
- Comments
目录索引
目录索引
📢 Debian 更换 Cloud内核可降低内存占用 🔊 Debain 12 为例子
原内核
root@ser2954483427:~# uname -r6.1.0-10-amd64内存 2G【系统显示1.92G】 在Debian12初始化后内存使用 htop查看 Mem占用在92-93M 使用 free -m查看 Mem占用
total used free shared buff/cache availableMem: 1967 239 1497 1 375 1728Swap: 0 0 0🌈apt 更新
apt update -y && apt dist-upgrade -y🎡查看系统现有内核
dpkg -l|grep linux-imageroot@ser2954483427:~# dpkg -l|grep linux-imageii linux-image-6.1.0-10-amd64 6.1.37-1 amd64 Linux 6.1 for 64-bit PCs (signed)ii linux-image-6.1.0-9-amd64 6.1.27-1 amd64 Linux 6.1 for 64-bit PCs (signed)ii linux-image-amd64 6.1.37-1 amd64 Linux for 64-bit PCs (meta-package)🏛️查看最新 cloud 内核
apt-cache search linux-image | grep cloudroot@ser2954483427:~# apt-cache search linux-image | grep cloudlinux-headers-6.1.0-18-cloud-amd64 - Header files for Linux 6.1.0-18-cloud-amd64linux-headers-6.1.0-22-cloud-amd64 - Header files for Linux 6.1.0-22-cloud-amd64linux-image-6.1.0-18-cloud-amd64-dbg - Debug symbols for linux-image-6.1.0-18-cloud-amd64linux-image-6.1.0-18-cloud-amd64-unsigned - Linux 6.1 for x86-64 cloudlinux-image-6.1.0-22-cloud-amd64-dbg - Debug symbols for linux-image-6.1.0-22-cloud-amd64linux-image-6.1.0-22-cloud-amd64-unsigned - Linux 6.1 for x86-64 cloudlinux-image-cloud-amd64-dbg - Debugging symbols for Linux cloud-amd64 configuration (meta-package)linux-image-6.1.0-18-cloud-amd64 - Linux 6.1 for x86-64 cloud (signed)linux-image-6.1.0-22-cloud-amd64 - Linux 6.1 for x86-64 cloud (signed)linux-image-cloud-amd64 - Linux for x86-64 cloud (meta-package)linux-headers-6.1.0-16-cloud-amd64 - Header files for Linux 6.1.0-16-cloud-amd64linux-image-6.1.0-16-cloud-amd64-dbg - Debug symbols for linux-image-6.1.0-16-cloud-amd64linux-image-6.1.0-16-cloud-amd64-unsigned - Linux 6.1 for x86-64 cloudlinux-image-6.1.0-16-cloud-amd64 - Linux 6.1 for x86-64 cloud (signed)linux-headers-6.10.6+bpo-cloud-amd64 - Header files for Linux 6.10.6+bpo-cloud-amd64linux-headers-6.9.10+bpo-cloud-amd64 - Header files for Linux 6.9.10+bpo-cloud-amd64linux-headers-6.9.7+bpo-cloud-amd64 - Header files for Linux 6.9.7+bpo-cloud-amd64linux-image-6.10.6+bpo-cloud-amd64-dbg - Debug symbols for linux-image-6.10.6+bpo-cloud-amd64linux-image-6.10.6+bpo-cloud-amd64-unsigned - Linux 6.10 for x86-64 cloudlinux-image-6.9.10+bpo-cloud-amd64-dbg - Debug symbols for linux-image-6.9.10+bpo-cloud-amd64linux-image-6.9.10+bpo-cloud-amd64-unsigned - Linux 6.9 for x86-64 cloudlinux-image-6.9.7+bpo-cloud-amd64-dbg - Debug symbols for linux-image-6.9.7+bpo-cloud-amd64linux-image-6.9.7+bpo-cloud-amd64-unsigned - Linux 6.9 for x86-64 cloudlinux-image-6.10.6+bpo-cloud-amd64 - Linux 6.10 for x86-64 cloud (signed)linux-image-6.9.10+bpo-cloud-amd64 - Linux 6.9 for x86-64 cloud (signed)linux-image-6.9.7+bpo-cloud-amd64 - Linux 6.9 for x86-64 cloud (signed)🚨安装 Cloud 内核
apt install linux-headers-6.1.0-18-cloud-amd64 \ linux-image-cloud-amd64 -y或者使用官方源的简单安装,不安装内核头文件只安装内核
apt install linux-image-cloud-amd64 -y💽更新引导文件
update-grub🧭关机重启
reboot💡验证是否安装成功
uname -r输入以下 cloud内核
root@ser2954483427:~# uname -r6.1.0-22-cloud-amd64📍验证内存占用 使用 htop查看 Mem占用在75-76M 使用 free -m查看 Mem占用
root@ser2954483427:~# free -m total used free shared buff/cache availableMem: 1979 194 1813 0 90 1784Swap: 0 0 0🔎卸载旧内核
此时的 linux-image-6.1.0-10-amd64 与【第二步:查看系统现有内核】查看的版本一致
dpkg --get-selections | grep linuxapt autoremove --purge linux-image-6.1.0-10-amd64apt autoremove --purge linux-image-6.1.0-9-amd64apt autoremoveapt autoclean