无法安装 Kali Linux 标头

无法安装 Kali Linux 标头

我正在尝试在我的机器上安装 Kali Linux 的 Linux 头文件,并且我已经尝试了互联网上所有可能的解决方案,但它总是显示“无法找到包”;我正在遵循以下指示:TP-Link Archer T2U Plus 又名 AC600 高增益

└─# sudo apt install build-essential libelf-dev linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-headers-6.1.0-kali9-amd64
E: Couldn't find any package by glob 'linux-headers-6.1.0-kali9-amd64'

我尝试通过命令找到正确的版本:

apt-cache search linux-headers

我看到的是:

linux-headers-6.3.0-kali1-amd64 - Header files for Linux 6.3.0-kali1-amd64
linux-headers-6.3.0-kali1-cloud-amd64 - Header files for Linux 6.3.0-kali1-cloud-amd64
linux-headers-6.3.0-kali1-common - Common header files for Linux 6.3.0-kali1
linux-headers-6.3.0-kali1-common-rt - Common header files for Linux 6.3.0-kali1-rt
linux-headers-6.3.0-kali1-rt-amd64 - Header files for Linux 6.3.0-kali1-rt-amd64
linux-headers-amd64 - Header files for Linux amd64 configuration (meta-package)
linux-headers-cloud-amd64 - Header files for Linux cloud-amd64 configuration (meta-   package)
linux-headers-rt-amd64 - Header files for Linux rt-amd64 configuration (meta-package)
linux-libc-dev-alpha-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-amd64-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-arc-cross - Linux Kernel Headers for development (for cross-compiling)
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-hppa-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-i386-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-mips-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-mips64el-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mips64r6-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mips64r6el-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-mipsn32-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mipsn32el-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mipsn32r6-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mipsn32r6el-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mipsr6-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-mipsr6el-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-ppc64-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-riscv64-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-sh4-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-sparc64-cross - Linux Kernel Headers for development (for cross-compiling)
linux-libc-dev-x32-cross - Linux Kernel Headers for development (for cross-compiling)

名称-r:

6.1.0-kali9-amd64

下一步如下:

sudo make dkms_install

给了我一个错误:

cp -r * /usr/src/8812au-5.6.4.2_35491.20191025
dkms add -m 8812au -v 5.6.4.2_35491.20191025
Creating symlink /var/lib/dkms/8812au/5.6.4.2_35491.20191025/source -> /usr/src/8812au-5.6.4.2_35491.20191025
dkms build -m 8812au -v 5.6.4.2_35491.20191025
Error! Your kernel headers for kernel 6.1.0-kali9-amd64 cannot be found at /lib/modules/6.1.0-kali9-amd64/build or /lib/modules/6.1.0-kali9-amd64/source.
Please install the linux-headers-6.1.0-kali9-amd64 package or use the --kernelsourcedir option to tell DKMS where it's located.
make: *** [Makefile:1786: dkms_install] Error 1

更新:截屏

答案1

说明中缺少一步:你需要确保你的系统是最新的。

sudo apt update

迈步、奔跑

sudo apt upgrade

这应该安装最新的内核;如果没有,你可以通过运行来解决这个问题

sudo apt install linux-image-amd64

升级完成后,重新启动,以便您的系统最终运行最新内核。然后

sudo apt install build-essential libelf-dev linux-headers-$(uname -r)

将工作。

相关内容