![如何将 Linux 内核安装从 System76 存储库切换到标准 Ubuntu 存储库?](https://linux22.com/image/1178099/%E5%A6%82%E4%BD%95%E5%B0%86%20Linux%20%E5%86%85%E6%A0%B8%E5%AE%89%E8%A3%85%E4%BB%8E%20System76%20%E5%AD%98%E5%82%A8%E5%BA%93%E5%88%87%E6%8D%A2%E5%88%B0%E6%A0%87%E5%87%86%20Ubuntu%20%E5%AD%98%E5%82%A8%E5%BA%93%EF%BC%9F.png)
如何将 Linux 内核包从 System76 存储库切换到使用标准 Ubuntu 存储库?我的计算机除了标准 Ubuntu 20.04 存储库外,还添加了 System76 存储库 PPA。以下是该apt-cache policy
命令的部分输出:
101 http://ppa.launchpad.net/system76-dev/stable/ubuntu focal/main amd64 Packages
release v=20.04,o=LP-PPA-system76-dev-stable,a=focal,n=focal,l=System76 Stable PPA,c=main,b=amd64
我将此 PPA 的优先级从 1000 更改为 101,使其低于标准 Ubuntu 存储库 500。我的计算机仍安装有来自 System76 存储库的 Linux 内核。以下是输出uname -a
:
Linux laptop 5.8.0-7625-generic #26~1604441536~20.04~a2b1f25~dev-Ubuntu SMP Wed Nov 4 01:19:56 U x86_64 x86_64 x86_64 GNU/Linux
我怎样才能恢复到标准 Ubuntu Linux 内核并且不让 System76 尝试升级它?
澄清:我没有运行 PopOS。System76 存储库已安装 5.8 Linux 内核,我想安全地切换到 Ubuntu 20.04 标准 5.4 Linux 内核。我想我可能需要 System76 存储库中的一些固件或设备驱动程序,所以我认为我需要保持启用状态。
答案1
请注意,即使使用 apt 固定,它也可能使您的包管理/系统陷入混乱。我不保证。为了安全起见,请先安装 ppa-purge。如果出现问题,您可以尝试使用以下方法恢复/删除软件包
sudo ppa-purge system76-dev/stable
做好准备的另一种方法是
/etc/apt/preferences.d/focal.pref
Package: *
Pin: release n=focal
Pin-Priority: 1001
为此
/etc/apt/sources.list.d/system76-dev-ubuntu-stable-focal.list
这些条目必须被注释掉。
sudo apt full-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
python3-distupgrade ubuntu-release-upgrader-core ubuntu-release-upgrader-qt
The following packages will be DOWNGRADED:
accountsservice libaccountsservice0 linux-firmware linux-generic linux-headers-generic linux-image-generic linux-libc-dev ubuntu-drivers-common
virtualbox virtualbox-dkms virtualbox-qt
3 upgraded, 0 newly installed, 11 downgraded, 0 to remove and 0 not upgraded.
Need to get 43,9 MB/145 MB of archives.
After this operation, 50,5 MB disk space will be freed.
锁定内核
/etc/apt/preferences.d/kernel.pref
# Kernel pinnen
Package: linux-generic
Pin: origin security.ubuntu.com
Pin-Priority:1001
Package: linux-generic
Pin: origin archive.ubuntu.com
Pin-Priority: 1001
Package: linux-image-generic
Pin: origin security.ubuntu.com
Pin-Priority:1001
Package: linux-image-generic
Pin: origin archive.ubuntu.com
Pin-Priority:1001
Package: linux-headers-generic
Pin: origin archive.ubuntu.com
Pin-Priority: 1001
Package: linux-headers-generic
Pin: origin security.ubuntu.com
Pin-Priority: 1001
Package: *
Pin: origin ppa.launchpad.net
Pin-Priority: 300
优先考虑来自源 archive.ubuntu.com/security.ubuntu.com 的内核软件包 (1001)
sudo apt full-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be DOWNGRADED:
linux-generic linux-headers-generic linux-image-generic
0 upgraded, 0 newly installed, 3 downgraded, 0 to remove and 0 not upgraded.
Need to get 0 B/7.028 B of archives.
After this operation, 630 kB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: warning: downgrading linux-generic from 5.8.0.7630.32~1605108853~20.04~8bcf10e~dev to 5.4.0.54.57
(Reading database ... 291830 files and directories currently installed.)
Preparing to unpack .../linux-generic_5.4.0.54.57_amd64.deb ...
Unpacking linux-generic (5.4.0.54.57) over (5.8.0.7630.32~1605108853~20.04~8bcf10e~dev) ...
dpkg: warning: downgrading linux-image-generic from 5.8.0.7630.32~1605108853~20.04~8bcf10e~dev to 5.4.0.54.57
Preparing to unpack .../linux-image-generic_5.4.0.54.57_amd64.deb ...
Unpacking linux-image-generic (5.4.0.54.57) over (5.8.0.7630.32~1605108853~20.04~8bcf10e~dev) ...
dpkg: warning: downgrading linux-headers-generic from 5.8.0.7630.32~1605108853~20.04~8bcf10e~dev to 5.4.0.54.57
Preparing to unpack .../linux-headers-generic_5.4.0.54.57_amd64.deb ...
Unpacking linux-headers-generic (5.4.0.54.57) over (5.8.0.7630.32~1605108853~20.04~8bcf10e~dev) ...
Setting up linux-image-generic (5.4.0.54.57) ...
Setting up linux-headers-generic (5.4.0.54.57) ...
Setting up linux-generic (5.4.0.54.57) ...
您可以从 ppa 更新中获得安装包的所有其他包。
请注意,您必须自行清除 ppa 中剩余的 kernel/headermodules 包。
你可以自己承担风险。真的。警告
更好的方法是使用 ppa-purge 删除 ppa。删除所有 apt 固定文件。
重新激活 ppa。然后创建
/etc/apt/preferences.d/system76.pref
# pinning für system-dev
Package: *
Pin: release o=LP-PPA-system76-dev-stable,a=focal
Pin-Priority: 300
如果您需要 ppa 中的特定包,您可以像这样安装它。
apt-get -s install -t focal linux-firmware
NOTE: This is only a simulation!
apt-get needs root privileges for real execution.
Keep also in mind that locking is deactivated,
so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
linux-firmware
1 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
Inst linux-firmware [1.187.4] (1.190.1+system76~1605123765~20.04~3894207~dev System76 Stable PPA:20.04/focal [all])
Conf linux-firmware (1.190.1+system76~1605123765~20.04~3894207~dev System76 Stable PPA:20.04/focal [all])
另一个例子
apt-get -s install -t focal accountsservice
NOTE: This is only a simulation!
apt-get needs root privileges for real execution.
Keep also in mind that locking is deactivated,
so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libaccountsservice0
Suggested packages:
gnome-control-center
The following packages will be upgraded:
accountsservice libaccountsservice0
2 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Inst accountsservice [0.6.55-0ubuntu12~20.04.4] (0.6.55-0ubuntu13.2pop0~1605745773~20.04~d9482b1~dev System76 Stable PPA:20.04/focal [amd64]) []
Inst libaccountsservice0 [0.6.55-0ubuntu12~20.04.4] (0.6.55-0ubuntu13.2pop0~1605745773~20.04~d9482b1~dev System76 Stable PPA:20.04/focal [amd64])
Conf accountsservice (0.6.55-0ubuntu13.2pop0~1605745773~20.04~d9482b1~dev System76 Stable PPA:20.04/focal [amd64])
Conf libaccountsservice0 (0.6.55-0ubuntu13.2pop0~1605745773~20.04~d9482b1~dev System76 Stable PPA:20.04/focal [amd64])
答案2
最简单的方法是删除 System76 存储库并将桌面环境更改为 Gnome。
- 从当前会话注销
- 从登录屏幕选择您的帐户,然后从右下角的小齿轮菜单中选择“Ubuntu”选项以使用 Gnome,然后登录
/etc/apt/sources.list
从文件中删除所有 System76 存储库引用/etc/apt/sources.list.d/
从目录中删除所有 System76 引用sudo apt update
就是这样。然后你将运行原版 Ubuntu。