Linux 头文件文件夹内的链接已损坏

Linux 头文件文件夹内的链接已损坏

我使用命令安装了内核的 Linux 头文件:

sudo apt-get install linux-headers-`uname -r`

在文件夹中

/usr/src/linux-headers-2.6.32-21-generic

全部文件的链接已损坏。

示例:文件 linux-headers-2.6.32-21/crypto 有断开的链接指向 ../linux-headers-2.6.32-21/crypto。

输出

ls -l /usr/src/linux-headers-2.6.32-21-generic :

drwxr-xr-x 3 root root   4096 2013-03-25 18:39 arch
lrwxrwxrwx 1 root root     32 2013-03-25 18:39 block -> ../linux-headers-2.6.32-    21/block
lrwxrwxrwx 1 root root     33 2013-03-25 18:39 crypto -> ../linux-headers-2.6.32-21/crypto
lrwxrwxrwx 1 root root     40 2013-03-25 18:39 Documentation -> ../linux-headers-2.6.32-21/Documentation
lrwxrwxrwx 1 root root     34 2013-03-25 18:39 drivers -> ../linux-headers-2.6.32-21/drivers
lrwxrwxrwx 1 root root     35 2013-03-25 18:39 firmware -> ../linux-headers-2.6.32-21/firmware
lrwxrwxrwx 1 root root     29 2013-03-25 18:39 fs -> ../linux-headers-2.6.32-21/fs
drwxr-xr-x 5 root root   4096 2013-03-25 18:39 include
lrwxrwxrwx 1 root root     31 2013-03-25 18:39 init -> ../linux-headers-2.6.32-21/init
lrwxrwxrwx 1 root root     30 2013-03-25 18:39 ipc -> ../linux-headers-2.6.32-21/ipc
lrwxrwxrwx 1 root root     33 2013-03-25 18:39 Kbuild -> ../linux-headers-2.6.32-21/Kbuild
drwxr-xr-x 2 root root   4096 2013-03-25 18:39 kernel
lrwxrwxrwx 1 root root     30 2013-03-25 18:39 lib -> ../linux-headers-2.6.32-21/lib
lrwxrwxrwx 1 root root     35 2013-03-25 18:39 Makefile -> ../linux-headers-2.6.32-21/Makefile
lrwxrwxrwx 1 root root     29 2013-03-25 18:39 mm -> ../linux-headers-2.6.32-21/mm
-rw-r--r-- 1 root root 640617 2010-04-16 18:37 Module.symvers
lrwxrwxrwx 1 root root     30 2013-03-25 18:39 net -> ../linux-headers-2.6.32-21/net
lrwxrwxrwx 1 root root     34 2013-03-25 18:39 samples -> ../linux-headers-2.6.32-21/samples
drwxr-xr-x 7 root root   4096 2013-03-25 18:39 scripts
lrwxrwxrwx 1 root root     35 2013-03-25 18:39 security -> ../linux-headers-2.6.32-21/security
lrwxrwxrwx 1 root root     32 2013-03-25 18:39 sound -> ../linux-headers-2.6.32-21/sound
lrwxrwxrwx 1 root root     26 2013-03-25 18:39 source -> /build/buildd/linux-2.6.32
lrwxrwxrwx 1 root root     32 2013-03-25 18:39 tools -> ../linux-headers-2.6.32-21/tools
lrwxrwxrwx 1 root root     33 2013-03-25 18:39 ubuntu -> ../linux-headers-2.6.32-21/ubuntu
lrwxrwxrwx 1 root root     30 2013-03-25 18:39 usr -> ../linux-headers-2.6.32-21/usr
lrwxrwxrwx 1 root root     31 2013-03-25 18:39 virt -> ../linux-headers-2.6.32-21/virt

输出:

uname -r

2.6.32-21-generic

我该如何修复这个问题?(我想要没有断开链接的头文件)。

答案1

目录中缺少的文件/usr/src/linux-headers-2.6.32-21假如通过包装Linux 标头-2.6.32-21安装 linux-headers-2.6.32-21。要获取它们,请尝试安装该包。

如果您想从命令行安装它,请运行:

sudo apt-get update && sudo apt-get install linux-headers-2.6.32-21

(该apt-get update部分将有助于确保系统根据有关哪里有哪些软件包以及哪些版本可用的正确且一致的信息来安装软件包。)

相关内容