![内核是 5.19.0-38-generic 但 apt install linux-headers-generic 说 linux-headers-generic 已经是最新版本(5.15.0.58.56)](https://linux22.com/image/951786/%E5%86%85%E6%A0%B8%E6%98%AF%205.19.0-38-generic%20%E4%BD%86%20apt%20install%20linux-headers-generic%20%E8%AF%B4%20linux-headers-generic%20%E5%B7%B2%E7%BB%8F%E6%98%AF%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC%EF%BC%885.15.0.58.56%EF%BC%89.png)
我不知道最近安装的 22.04 怎么会陷入这种混乱,但假设是我上周添加的用于获取某些东西的存储库导致了这种情况,因为我显然正在启动 5.19.0-38 内核,但内核头不存在。(我知道是因为 VirtualBox 停止工作并且清楚地抱怨 vboxdrv 模块不存在。)输出为/sbin/vboconfig
:
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
linux-headers-generic linux-headers-5.19.0-38-generic
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
linux-headers-generic linux-headers-5.19.0-38-generic
但是apt-get install linux-headers-generic linux-headers-5.19.0-38-generic
(作为 root 之后apt update
)说:
root@Clevo2:/home/chris# apt-get install linux-headers-generic linux-headers-5.19.0-38-generic
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package linux-headers-5.19.0-38-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'linux-headers-5.19.0-38-generic' has no installation candidate
我怀疑我的 grub 设置可能是问题所在。 update-grub
给了我这个:
root@Clevo2:/home/chris# update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.19.0-38-generic
Found initrd image: /boot/initrd.img-5.19.0-38-generic
Found linux image: /boot/vmlinuz-5.19.0-32-generic
Found initrd image: /boot/initrd.img-5.19.0-32-generic
Found linux image: /boot/vmlinuz-5.15.0-58-generic
Found initrd image: /boot/initrd.img-5.15.0-58-generic
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
自从运行它以来,我还没有重启过机器,因为我宁愿先看看我在这里得到什么建议。有人能找到前进的道路吗?我迫切需要 virtualbox(遗憾的是为了能够回来使用 M$oft Wurd:抱歉!)
短暂性脑缺血发作,
克里斯
输出已添加 16.iv.2023
root@Clevo2:/home/chris# apt-cache policy linux-headers-5.19.0-38-generic
linux-headers-5.19.0-38-generic:
Installed: (none)
Candidate: (none)
Version table:
2023 年 4 月 16 日添加的内容/etc/apt/sources.list
:
# deb cdrom:[Ubuntu 22.04.2 LTS _Jammy Jellyfish_ - Release amd64 (20230223)]/ jammy main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirror.infomaniak.ch/ubuntu/ jammy main restricted
# deb-src http://fr.archive.ubuntu.com/ubuntu/ jammy main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirror.infomaniak.ch/ubuntu/ jammy-updates main restricted
# deb-src http://fr.archive.ubuntu.com/ubuntu/ jammy-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirror.infomaniak.ch/ubuntu/ jammy universe
# deb-src http://fr.archive.ubuntu.com/ubuntu/ jammy universe
deb http://mirror.infomaniak.ch/ubuntu/ jammy-updates universe
# deb-src http://fr.archive.ubuntu.com/ubuntu/ jammy-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirror.infomaniak.ch/ubuntu/ jammy multiverse
# deb-src http://fr.archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://mirror.infomaniak.ch/ubuntu/ jammy-updates multiverse
# deb-src http://fr.archive.ubuntu.com/ubuntu/ jammy-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirror.infomaniak.ch/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://fr.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
deb http://mirror.infomaniak.ch/ubuntu/ jammy-security main restricted
# deb-src http://security.ubuntu.com/ubuntu jammy-security main restricted
deb http://mirror.infomaniak.ch/ubuntu/ jammy-security universe
# deb-src http://security.ubuntu.com/ubuntu jammy-security universe
deb http://mirror.infomaniak.ch/ubuntu/ jammy-security multiverse
# deb-src http://security.ubuntu.com/ubuntu jammy-security multiverse
# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
root@Clevo2:/home/chris#
我认为这表明要求更新。
答案1
我怀疑这可能不是一个适用于所有机器的答案,但它在我最初遇到这个问题的地方起作用了。它来自 Laptopswithlinux 的 Peter Pont,他提供了这台机器:
打开终端并运行:
sudo apt update && sudo apt upgrade && sudo apt autoremove -y
然后重新启动笔记本电脑。
通过软件和更新安装此驱动程序:
来自 nvidia-driver-525 的 NVIDIA 驱动程序元包
重启笔记本电脑
打开终端然后运行:
sudo apt install linux-oem-22.04c linux-tools-oem-22.04c -y
重新启动笔记本电脑并再次检查。
这是最后一次安装,虽然我尝试过 nvidia 驱动程序linux-oem-22.04c
,但linux-tools-oem-22.04c
我之前没有安装过。我希望有一天这对其他人有用,并感谢所有回复的人。