首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未能更新debian拉伸/ Debian 9上的Linux头

未能更新debian拉伸/ Debian 9上的Linux头
EN

Unix & Linux用户
提问于 2019-09-25 08:35:46
回答 3查看 26.2K关注 0票数 9

在命令下运行之后,我得到了错误:

代码语言:javascript
复制
# apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-4.9.0-3-amd64
E: Couldn't find any package by glob 'linux-headers-4.9.0-3-amd64'
E: Couldn't find any package by regex 'linux-headers-4.9.0-3-amd64'

要排除故障,我检查了以下内容:

代码语言:javascript
复制
# apt-cache search linux-headers
aufs-dkms - DKMS files to build and install aufs
linux-libc-dev-arm64-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-armel-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-armhf-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mips-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mips64el-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mipsel-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-ppc64el-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-s390x-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-alpha-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-hppa-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-m68k-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mips64-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-powerpc-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-powerpcspe-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-ppc64-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-sh4-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-sparc64-cross - Linux Kernel Headers for development (for cross-compiling)
linux-headers-4.9.0-11-all - All header files for Linux 4.9 (meta-package)
linux-headers-4.9.0-11-all-amd64 - All header files for Linux 4.9 (meta-package)
linux-headers-4.9.0-11-amd64 - Header files for Linux 4.9.0-11-amd64
linux-headers-4.9.0-11-common - Common header files for Linux 4.9.0-11
linux-headers-4.9.0-11-common-rt - Common header files for Linux 4.9.0-11-rt
linux-headers-4.9.0-11-rt-amd64 - Header files for Linux 4.9.0-11-rt-amd64
linux-headers-amd64 - Header files for Linux amd64 configuration (meta-package)
linux-headers-rt-amd64 - Header files for Linux rt-amd64 configuration (meta-package)```


and 

# apt-cache search linux-image
linux-headers-4.9.0-11-amd64 - Header files for Linux 4.9.0-11-amd64
linux-headers-4.9.0-11-rt-amd64 - Header files for Linux 4.9.0-11-rt-amd64
linux-image-4.9.0-11-amd64 - Linux 4.9 for 64-bit PCs
linux-image-4.9.0-11-amd64-dbg - Debug symbols for linux-image-4.9.0-11-amd64
linux-image-4.9.0-11-rt-amd64 - Linux 4.9 for 64-bit PCs, PREEMPT_RT
linux-image-4.9.0-11-rt-amd64-dbg - Debug symbols for linux-image-4.9.0-11-rt-amd64
linux-image-amd64 - Linux for 64-bit PCs (meta-package)
linux-image-amd64-dbg - Debugging symbols for Linux amd64 configuration (meta-package)
linux-image-rt-amd64 - Linux for 64-bit PCs (meta-package), PREEMPT_RT
linux-image-rt-amd64-dbg - Debugging symbols for Linux rt-amd64 configuration (meta-package)
linux-image-4.9.0-3-amd64 - Linux 4.9 for 64-bit PCs

在运行apt-缓存搜索、linux-映像之后,我得到了Linux-Image-4.9.0-3-AMD 64内核版本,这也是我希望在apt-缓存搜索linux-headers命令的结果中得到的。

很少有人建议改变sources.list,然后尝试。但由于我对此并不熟悉,我不知道如何为sources.list搜索适当的链接,也不知道什么最适合解决我的问题。

我在谷歌上搜索过,但没有找到解决方案。任何能够提供解决方案的链接或解决方案都会有很大帮助。

EN

回答 3

Unix & Linux用户

回答已采纳

发布于 2019-09-25 09:10:25

代码语言:javascript
复制
apt-get install linux-headers-$(uname -r)

要工作,您需要运行一个仍然可以从发行版存储库中获得的内核;在大多数情况下,这基本上意味着您需要为您的发行版运行最新支持的内核。

在Debian上,最简单的选择是

代码语言:javascript
复制
apt-get update
apt-get install linux-image-amd64 linux-headers-amd64

(调整到您的体系结构)以获得当前内核和匹配的标头,然后重新启动。

票数 16
EN

Unix & Linux用户

发布于 2019-09-25 11:13:10

linux-headers-4.9.0-3-amd64已经过时了,它被删除并替换为最新的包linux-headers-4.9.0-11-amd64,这就是为什么不能从常规存储库安装它的原因。

您可以从linux-headers-4.9.0-3-amd64安装快照存档库

编辑您的源列表:

代码语言:javascript
复制
nano /etc/apt/sources.list.d/snapshot.list

增加以下几行:

代码语言:javascript
复制
deb http://snapshot.debian.org/archive/debian/20170609T034604Z stretch main
deb http://snapshot.debian.org/archive/debian/20170609T034604Z stretch-updates main
deb http://snapshot.debian.org/archive/debian-security/20170920T221221Z stretch/updates main

然后:

代码语言:javascript
复制
apt -o Acquire::Check-Valid-Until=false update
apt install linux-headers-4.9.0-3-amd64

若要访问使用有效的套件的快照--直到使用的时间超过12天,就必须忽略有效--直到发布文件中的头文件,以防止apt忽略快照条目(“释放文件过期”)。为此目的使用aptitude -o Acquire::Check-Valid-Until=false updateapt-get -o Acquire::Check-Valid-Until=false更新。

票数 10
EN

Unix & Linux用户

发布于 2020-09-18 01:39:35

在我提交命令:apt-cache search linux-headers之后,这对我起了作用。我从列表中选择了linux-headers-5.4.0-1009-oracle。我在使用Windows 10专业版!

代码语言:javascript
复制
sudo apt-get install linux-headers-5.4.0-1009-oracle
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  linux-oracle-headers-5.4.0-1009
The following NEW packages will be installed:
  linux-headers-5.4.0-1009-oracle linux-oracle-headers-5.4.0-1009
0 upgraded, 2 newly installed, 0 to remove and 21 not upgraded.
Need to get 12.2 MB of archives.
After this operation, 87.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 linux-oracle-headers-5.4.0-1009 all 5.4.0-1009.9 [11.0 MB]Get:2 http://archive.ubuntu.com/ubuntu focal/main amd64 linux-headers-5.4.0-1009-oracle amd64 5.4.0-1009.9 [1244 kB]
Fetched 12.2 MB in 1min 12s (170 kB/s)
Selecting previously unselected package linux-oracle-headers-5.4.0-1009.
(Reading database ... 99989 files and directories currently installed.)
Preparing to unpack .../linux-oracle-headers-5.4.0-1009_5.4.0-1009.9_all.deb ...
Unpacking linux-oracle-headers-5.4.0-1009 (5.4.0-1009.9) ...

Selecting previously unselected package linux-headers-5.4.0-1009-oracle.
Preparing to unpack .../linux-headers-5.4.0-1009-oracle_5.4.0-1009.9_amd64.deb ...
Unpacking linux-headers-5.4.0-1009-oracle (5.4.0-1009.9) ...
Setting up linux-oracle-headers-5.4.0-1009 (5.4.0-1009.9) ...
Setting up linux-headers-5.4.0-1009-oracle (5.4.0-1009.9) ...
/etc/kernel/header_postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.4.0-1009-oracle

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j8 KERNELRELEASE=5.4.0-1009-oracle -C /lib/modules/5.4.0-1009-oracle/build M=/var/lib/dkms/virtualbox/6.1.10/build................
cleaning build area...

DKMS: build completed.

vboxdrv.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-1009-oracle/updates/dkms/

vboxnetadp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-1009-oracle/updates/dkms/

vboxnetflt.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-1009-oracle/updates/dkms/

depmod...

DKMS: install completed.
   ...done.
票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/543601

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档