【分享】升级内核,推荐使用xanmod内核
Tofloor
poster avatar
Shinglee
deepin
2020-10-22 22:15
Author
本帖最后由 shinglee 于 2020-10-25 17:01 编辑

为什么升级内核?
一般来说,新的内核会更好的支持较新的硬件(CPU, 网卡...),并且升级内核也许能解决一些奇奇怪怪的小问题
但并不是最新的内核就是最好的,有些硬件的厂商驱动可能不支持特别高版本的内核

为什么推荐xanmod的内核呢?
官网:https://xanmod.org/
XanMod是具有自定义设置和新功能的通用Linux内核发行版。 旨在提供稳定,响应和流畅的桌面体验。
建议将实时版本用于关键的运行时应用程序,例如Linux游戏电子竞技,流媒体,现场制作和超低延迟爱好者。
我个人一直用的xanmod的STABLE最新内核,对Debian类衍生系统兼容很好,当然也包括Deepin(UOS)

1. 升级内核
    添加xanmod内核apt源:
  1. echo 'deb http://deb.xanmod.org releases main' | sudo tee /etc/apt/sources.list.d/xanmod-kernel.list && wget -qO - https://dl.xanmod.org/gpg.key | sudo apt-key add -
Copy the Code
   升级xanmod内核到最新STABLE版本;如喜欢尝鲜最新的内核的请去官网查询最新EDGE版本的内核,自行安装(linux-xanmod-edge 替换下面的 linux-xanmod):
  1. sudo apt update && sudo apt install linux-xanmod
Copy the Code

2. 安装CPU微代码包
    Intel:
  1. sudo apt install intel-microcode iucode-tool
  2. sudo apt purge amd64-microcode
Copy the Code
   AMD:
  1. sudo apt install amd64-microcode
  2. sudo apt purge intel-microcode iucode-tool
Copy the Code

3. 设置 FQ-PIE 排队规则
  1. echo 'net.core.default_qdisc = fq_pie' | sudo tee /etc/sysctl.d/90-override.conf
Copy the Code


最后:
一定要选最适合自己的内核,不要选最新的,最新内核最大问题就是驱动问题
一旦升级了内核出了一些问题,重启系统,在引导选择界面,Advanced,选回旧的内核,删除最新内核即可


Reply Favorite View the author
All Replies
wzb
deepin
2020-10-22 23:17
#1
升级过后安装显卡驱动是个麻烦
Reply View the author
Shinglee
deepin
2020-10-22 23:59
#2
https://bbs.deepin.org/post/204163
升级过后安装显卡驱动是个麻烦

看你的显卡驱动是不是dkms的,如果是的,不跨越大版本升级一般不会有问题,我现在的蓝牙驱动就是的,小版本升级一点问题没有
Reply View the author
mmlmonkey
deepin
2020-10-23 00:09
#3
我是clone的xanmod的内核自己编译的  驱动就没问题了
Reply View the author
wzb
deepin
2020-10-23 00:49
#4
https://bbs.deepin.org/post/204163
看你的显卡驱动是不是dkms的,如果是的,不跨越大版本升级一般不会有问题,我现在的蓝牙驱动就是的,小版 ...

安装了dkms的。只是升级后显卡驱动不行
Reply View the author
SamLukeYes
deepin
2020-10-23 02:18
#5
可以用 app4deepin 的内核,有针对国内用户的镜像站
Reply View the author
mardou
deepin
2020-10-26 00:25
#6
如何选择“最适合自己的内核”?按照你上面的终端指令,我没一个升级成的。不知道是什么原因。
Reply View the author
Shinglee
deepin
2020-10-26 00:29
#7
https://bbs.deepin.org/post/204163
如何选择“最适合自己的内核”?按照你上面的终端指令,我没一个升级成的。不知道是什么原因。 ...

没成功,把你命令的结果截图或者复制给我看下
最适合自己的,主要看你的驱动,比如你的英伟达显卡,有没有支持5.8内核的,没有的话,就还是用5.4内核,你看这个官网,它5.4内核已经升级了到了很高的小版本号了,你可以试试
Reply View the author
mardou
deepin
2020-10-26 00:32
#8
https://bbs.deepin.org/post/204163
没成功,把你命令的结果截图或者复制给我看下
最适合自己的,主要看你的驱动,比如你的英伟达显卡,有没 ...

内核我已经升级到5.9.1了。
echo 'deb http://deb.xanmod.org releases mian' | sudo tee /etc/apt/sources.list.d/xanmod-kernel.list && wget -go -https://dl.xanmod.org/gpg.key | sudo apt-key add -
请输入密码
[sudo] mardou 的密码:
验证成功
tee: /etc/apt/sources.list.d/xanmod-kernel.list: 没有那个文件或目录
deb http://deb.xanmod.org releases mian


Reply View the author
Shinglee
deepin
2020-10-26 00:43
#9
https://bbs.deepin.org/post/204163
内核我已经升级到5.9.1了。
echo 'deb http://deb.xanmod.org releases mian' | sudo tee /etc/apt/source ...

  你都已经升级到5.9.1 了,这个xanmod最新尝鲜版也是5.9.1的,虽然版本一样,但还是有些差异性的

你这个报错是命令拼写错误,建议你直接复制粘贴,不要手敲,有点长,有些空格被你漏掉了
Reply View the author
mardou
deepin
2020-10-26 00:47
#10
https://bbs.deepin.org/post/204163
你都已经升级到5.9.1 了,这个xanmod最新尝鲜版也是5.9.1的,虽然版本一样,但还是有些差异性的 ...

好的,我试后再告诉情况。谢谢万分。
Reply View the author
rekees2020
deepin
2020-10-26 00:50
#11
https://bbs.deepin.org/post/204163
可以用 app4deepin 的内核,有针对国内用户的镜像站

app4deepin似乎直接搬运xanmod,deb文件名里很长一串代表版本的数字都是一模一样的;连接速度就快过一次,其余每次升级内核都需要一个多小时
Reply View the author
Shinglee
deepin
2020-10-26 00:54
#12
https://bbs.deepin.org/post/204163
app4deepin似乎直接搬运xanmod,deb文件名里很长一串代表版本的数字都是一模一样的;连接速度就快过一次, ...

搬运,而且还最新版本搬运延后很长时间,最主要的是app4deepin国内源也是巨慢无比,速度还不如xanmod官方源
Reply View the author
mardou
deepin
2020-10-27 19:05
#13
以下内容没弄明白是什么问题:
root@mardou-PC:/var/lib/dpkg# apt --fix-broken install
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
正在修复依赖关系... 完成
下列软件包是自动安装的并且现在不需要了:
  deepin-fonts-wine deepin-libwine:i386 deepin-wine-uninstaller:i386 deepin-wine32:i386
  deepin-wine32-preloader:i386 libgl1-mesa-glx:i386
使用'apt autoremove'来卸载它(它们)。
下列软件包将被【卸载】:
  com.eastmoney.deepin deepin-wine deepin.com.95579.cjsc:i386 deepin.com.gtja.fuyi:i386
升级了 0 个软件包,新安装了 0 个软件包,要卸载 4 个软件包,有 0 个软件包未被升级。
有 1 个软件包没有被完全安装或卸载。
解压缩后将会空出 179 MB 的空间。
您希望继续执行吗? [Y/n] y
E: 子进程 dpkg --set-selections 返回了一个错误号 (100)
E: Couldn't record the approved state changes as dpkg selection states
root@mardou-PC:/var/lib/dpkg# apt autoremove
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
您也许需要运行“apt --fix-broken install”来修正上面的错误。
下列软件包有未满足的依赖关系:
com.eastmoney.deepin : 依赖: deepin-wine5 但无法安装它
deepin-wine : 依赖: deepin-wine64 (>= 2.18-24~rc3) 但无法安装它 或
                       deepin-wine32 (>= 2.18-24~rc3) 但无法安装它
               依赖: deepin-wine64 (< 2.18-24~rc3.1~) 但无法安装它 或
                       deepin-wine32 (< 2.18-24~rc3.1~) 但无法安装它
E: 有未能满足的依赖关系。请尝试不指明软件包的名字来运行“apt --fix-broken install”(也可以指定一个解决办法)。
Reply View the author
Shinglee
deepin
2020-10-27 19:15
#14
https://bbs.deepin.org/post/204163
以下内容没弄明白是什么问题:
root@mardou-PC:/var/lib/dpkg# apt --fix-broken install
正在读取软件包列 ...

com.eastmoney.deepin
deepin-wine
这两个包是旧包,应该是不兼容行的 wine5
Reply View the author
mardou
deepin
2020-10-27 19:59
#15
https://bbs.deepin.org/post/204163
com.eastmoney.deepin
deepin-wine
这两个包是旧包,应该是不兼容行的 wine5

什么意思?怎么办呢?
Reply View the author
Shinglee
deepin
2020-10-27 21:01
#16
https://bbs.deepin.org/post/204163
什么意思?怎么办呢?

apt autoclean
apt clean
apt --fix-broken install
apt autoremove

不行的话,我也不知道什么问题
Reply View the author
geno
deepin
2021-03-19 18:59
#17
  • If the NVIDIA compiler complains about different versions of GCC between the current one and the one used for compiling the kernel, add in /etc/profile:

 

export IGNORE_CC_MISMATCH=1

如果因为GCC版本问题而导致你的NVIDIA卡dkms驱动安装失败,(debian buster 以及deepin 都是用的gcc 8,而xandom目前用的是gcc-10),可以在你的/etc/profile 中加入一行(最开头或者最后面)export IGNORE_CC_MISMATCH=1,就没有问题了,亲测可用!

Reply View the author
geno
deepin
2021-03-20 20:34
#18
geno
  • If the NVIDIA compiler complains about different versions of GCC between the current one and the one used for compiling the kernel, add in /etc/profile:

 

export IGNORE_CC_MISMATCH=1

如果因为GCC版本问题而导致你的NVIDIA卡dkms驱动安装失败,(debian buster 以及deepin 都是用的gcc 8,而xandom目前用的是gcc-10),可以在你的/etc/profile 中加入一行(最开头或者最后面)export IGNORE_CC_MISMATCH=1,就没有问题了,亲测可用!

如果通过 sudo安装内核,还需要sudo visudo,将:

#

Defaults        env_reset

Defaults        mail_badpass

Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

改为:

#

Defaults        env_reset

Defaults        env_keep= "IGNORE_CC_MISMATCH"

Defaults        mail_badpass

Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

 

之中增加了一行:

Defaults        env_keep= "IGNORE_CC_MISMATCH"

 

 

Reply View the author
135******27
deepin
2022-03-12 16:59
#19

升级后,我的笔记本休眠功能正常了,原来笔记本休眠后,屏幕就亮不起来了,需要关机重启才行。

原先开机会有个错误提示一闪而过,看不清,用了这个内核后错误提示没了,休眠功能也正常了。

Reply View the author
来我的哔哩哔哩看看如何
deepin
2022-07-30 06:09
#20
mardou
以下内容没弄明白是什么问题:
root@mardou-PC:/var/lib/dpkg# apt --fix-broken install
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
正在修复依赖关系... 完成
下列软件包是自动安装的并且现在不需要了:
  deepin-fonts-wine deepin-libwine:i386 deepin-wine-uninstaller:i386 deepin-wine32:i386
  deepin-wine32-preloader:i386 libgl1-mesa-glx:i386
使用'apt autoremove'来卸载它(它们)。
下列软件包将被【卸载】:
  com.eastmoney.deepin deepin-wine deepin.com.95579.cjsc:i386 deepin.com.gtja.fuyi:i386
升级了 0 个软件包,新安装了 0 个软件包,要卸载 4 个软件包,有 0 个软件包未被升级。
有 1 个软件包没有被完全安装或卸载。
解压缩后将会空出 179 MB 的空间。
您希望继续执行吗? [Y/n] y
E: 子进程 dpkg --set-selections 返回了一个错误号 (100)
E: Couldn't record the approved state changes as dpkg selection states
root@mardou-PC:/var/lib/dpkg# apt autoremove
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
您也许需要运行“apt --fix-broken install”来修正上面的错误。
下列软件包有未满足的依赖关系:
com.eastmoney.deepin : 依赖: deepin-wine5 但无法安装它
deepin-wine : 依赖: deepin-wine64 (>= 2.18-24~rc3) 但无法安装它 或
                       deepin-wine32 (>= 2.18-24~rc3) 但无法安装它
               依赖: deepin-wine64 (< 2.18-24~rc3.1~) 但无法安装它 或
                       deepin-wine32 (< 2.18-24~rc3.1~) 但无法安装它
E: 有未能满足的依赖关系。请尝试不指明软件包的名字来运行“apt --fix-broken install”(也可以指定一个解决办法)。

别安装了,wine要没,你这个机器

Reply View the author