debianstretch/Debian 9에서 Linux 헤더를 업데이트할 수 없습니다.

debianstretch/Debian 9에서 Linux 헤더를 업데이트할 수 없습니다.

다음 명령을 실행한 후 오류가 발생합니다.

# 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'

문제를 해결하기 위해 다음 사항을 확인했습니다.

# 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

달리고 난 후 적절한 캐시 검색 리눅스 이미지알겠어요리눅스-이미지-4.9.0-3-amd64내가 원하는 커널 버전apt-cache는 리눅스 헤더를 검색합니다주문도 하세요.

source.list를 변경하고 시도해 보라고 제안하는 사람은 거의 없습니다. 하지만 저는 초보자이기 때문에 resources.list에서 올바른 링크를 검색하는 방법과 문제를 해결하는 가장 좋은 방법을 모릅니다.

Google에서 검색했지만 해결책을 찾지 못했습니다. 솔루션을 제공할 수 있는 링크나 솔루션은 큰 도움이 될 것입니다.

답변1

~을 위한

apt-get install linux-headers-$(uname -r)

일하기 위해서는 다음과 같은 것이 필요합니다.달리기커널은 배포 저장소에서 계속 사용할 수 있습니다. 대부분의 경우 이는 기본적으로 배포에 대해 지원되는 최신 커널을 실행해야 함을 의미합니다.

데비안에서 가장 간단한 옵션은

apt-get update
apt-get install linux-image-amd64 linux-headers-amd64

(아키텍처에 맞게 조정) 현재 커널과 일치하는 헤더를 가져온 다음 재부팅하십시오.

답변2

더 이상 사용되지 않으며 linux-headers-4.9.0-3-amd64제거되었으며 최신 패키지로 교체되었습니다.linux-headers-4.9.0-11-amd64그렇기 때문에 일반 저장소에서 설치할 수 없습니다.

당신은 설치할 수 있습니다linux-headers-4.9.0-3-amd64~에서스냅샷 아카이브 저장소:

매체 목록을 편집하십시오:

nano /etc/apt/sources.list.d/snapshot.list

다음 줄을 추가합니다.

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

그 다음에:

apt -o Acquire::Check-Valid-Until=false update
apt install linux-headers-4.9.0-3-amd64

Valid-Until을 사용하여 10일이 지난 패키지 스냅샷에 액세스하려면 apt가 스냅샷 항목("릴리스 파일이 만료되었습니다.")을 무시하지 않도록 릴리스 파일의 Valid-Until 헤더를 무시해야 합니다. 이 목적으로 사용되거나 aptitude -o Acquire::Check-Valid-Until=false update업데이트됩니다 .apt-get -o Acquire::Check-Valid-Until=false

답변3

이것은 명령을 제출한 후에 나에게 효과적이었습니다: apt-cache search linux-headers. 나는 linux-headers-5.4.0-1009-oracle목록에서 선택합니다. 저는 윈도우 10 프로를 사용하고 있어요!

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.

관련 정보