给Ubuntu16.04升级内核到5.7
date
Feb 1, 2022
slug
ubuntu-1604-upgrade-kernel
status
Published
summary
也可以是任何合适的版本
tags
linux
type
Post
URL
Problem & SummarySoltion确认现有版本去 https://kernel.ubuntu.com/~kernel-ppa/mainline/ 确定新的版本ubuntu 16.04会碰上依赖libssl1.1.0问题下载并安装所有相关的deb (headers_all, headers, image, moduels共4个.deb)!重启后,uname -a 确认新版本清理旧内核
Problem & Summary
Soltion
确认现有版本
uname -a
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F36e8b1a0-80ab-464a-82e9-d345e4b49d18%2FUntitled.png?table=block&id=24882251-6e08-45b1-9914-8a6ddd3b2598&cache=v2)
去 https://kernel.ubuntu.com/~kernel-ppa/mainline/ 确定新的版本
- 比如 v.5.7/
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F7a87b8da-4347-406c-8626-dcf0119a3427%2Fkxmini-2022-0201-PM131422-Iwk9W8Hg2x.jpg?table=block&id=839f1b86-62f2-4e51-8b62-3b8762b3b6dd&cache=v2)
ubuntu 16.04会碰上依赖libssl1.1.0问题
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F50760f8c-1b67-42cd-a59b-fee13875c22f%2FUntitled.png?table=block&id=b94b8a78-862d-48da-9807-e7364c800c93&cache=v2)
下载并安装所有相关的deb (headers_all, headers, image, moduels共4个.deb)
wget https://kernel.ubuntu.com/\~kernel-ppa/mainline/v5.7/amd64/linux-headers-5.7.0-050700_5.7.0-050700.202006082127_all.deb \
https://kernel.ubuntu.com/\~kernel-ppa/mainline/v5.7/amd64/linux-headers-5.7.0-050700-generic_5.7.0-050700.202006082127_amd64.deb \
https://kernel.ubuntu.com/\~kernel-ppa/mainline/v5.7/amd64/linux-image-unsigned-5.7.0-050700-generic_5.7.0-050700.202006082127_amd64.deb \
https://kernel.ubuntu.com/\~kernel-ppa/mainline/v5.7/amd64/linux-modules-5.7.0-050700-generic_5.7.0-050700.202006082127_amd64.deb
ll linux*.deb
dpkg -i linux*.deb
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fd4e4a402-5ace-452b-a978-368ce06fd9bc%2FUntitled.png?table=block&id=5da42288-27e9-4309-b834-8c8a998bad5d&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3491f7f5-41d4-4ccf-a635-c1397a3752ee%2FUntitled.png?table=block&id=66727544-dc91-4de7-8f5c-0762043c9748&cache=v2)
!重启后,uname -a 确认新版本
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F5a6c37d4-7384-43c9-9f5a-f468e90b6065%2FUntitled.png?table=block&id=eb3827e6-60fe-44d4-b3f7-a5a918581366&cache=v2)
清理旧内核
apt -y clean && apt -y autoclean && apt -y autoremove
# 如果清理不掉,就手动
# 先把系统里面的内核 != 当前正在使用内核的找出来 (grep -v的相关)
dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2d4d0f4f-c5a4-48bf-a77d-05e2ee27c17d%2FUntitled.png?table=block&id=c1eea927-e46b-4d66-8831-63797bd73d19&cache=v2)