Apt

無法安裝 Linux 標頭檔 (Kali Linux)

  • December 24, 2018

我正在嘗試在我的機器上安裝 Kali Linux 的 Linux 標頭檔,我已經嘗試了網際網路上所有可能的解決方案,但它總是顯示“無法找到軟體包”

root@kali:/usr/sbin# apt-get install linux-headers-4.6.0-kali1-amd64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package linux-headers-4.6.0-kali1-amd64
E: Couldn't find any package by glob 'linux-headers-4.6.0-kali1-amd64'
E: Couldn't find any package by regex 'linux-headers-4.6.0-kali1-amd64'

這是我的 sources.list 文件:

# Regular Repositories
deb http://http.kali.org/kali sana main non-free contrib
deb http://security.kali.org/kali-security sana/updates main contrib non-free
# Source repositories
deb-src http://http.kali.org/kali sana main non-free contrib
deb-src http://security.kali.org/kali-security sana/updates main contrib non-free

Unname -a 輸出:

root@kali:/usr/sbin# uname -a
Linux kali 4.6.0-kali1-amd64 #1 SMP Debian 4.6.4-1kali1 (2016-07-21) x86_64 GNU/Linux

該軟體包linux-headers-4.6.0-kali1-amd64不再在正常的 kali-linux 儲存庫中可用,它應該升級到該4.8.x版本。

更新你的/etc/apt/sources.list:見Kali sources.list Repositories

通過以下方式列出可用的 linux-headers 和 linux-image apt-cache search

apt update 
apt-cache search linux-headers

然後安裝正確的包 e,g (這是一個例子,它取決於前面的輸出命令):

apt-get install linux-headers-4.8.0-kali1-amd64

也跑;

apt-cache search linux-image

安裝它:

apt-get install linux-image-4.8.0-kali1-amd64

重新啟動系統。

或者您可以使用以下命令將核心升級到最新的可用版本並安裝適當的核心標頭檔:

apt update
apt dist-upgrade
reboot
apt install linux-headers-$(uname -r)

引用自:https://unix.stackexchange.com/questions/328655