如何安装包含Ubuntu内核调试符号的软件包?


19

默认的Ubuntu内核-generic软件包中似乎没有符号。

我试图避免手动编译带有调试信息的内核。

Ubuntu是否提供带有内核调试符号的软件包?

Answers:


25
  1. 首先创建一个ddebs.list使用:

    echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ddebs.list
  2. 然后添加GPG密钥ddebs.ubuntu.com

    wget -O - http://ddebs.ubuntu.com/dbgsym-release-key.asc | sudo apt-key add -
  3. 然后运行:

    sudo apt-get update
  4. 然后使用以下命令安装符号包:

    sudo apt-get install linux-image-`uname -r`-dbgsym

    这相当大(> 680MB),因此请等待下载。

我将Linux内核调试符号用于类似systemtap内核的工具。


apt-cache search dbgsympkg-create-dbgsym仅返回,是否在其他存储库中?
雏菊2012年

3
@ warl0ck是的,这些-dbgsym软件包位于必须启用的特殊存储库中才能安装。这说明了如何
伊利亚·卡根

我现在已经更新了帖子,以阐明如何做到这一点。
科林·伊恩·金

步骤apt-get update导致出现警告消息:W: GPG error: http://ddebs.ubuntu.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ECDCAD72428D7C01,这就是为什么我要针对这种情况扩展解决方案。
Pro Backup

1
sudo apt-get install linux-image-$(uname -r)-dbgsym=3.13.0-49.83 Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package linux-image-3.13.0-49-generic-dbgsym E: Couldn't find any package by regex 'linux-image-3.13.0-49-generic-dbgsym'
肯尼·埃维特

7

我尝试了Colin Ian King的答案,但它对我没有用。我发现我必须在其中添加两行/etc/apt/sources.list.d/ddebs.list

通过编辑文件

sudo nano /etc/apt/sources.list.d/ddebs.list

并在下面添加两行

deb http://ddebs.ubuntu.com trusty-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com trusty-proposed main restricted universe multiverse

替换trusty为执行时获得的版本

lsb_release -cs

1
这对我有用!
霍华德·沙恩

7

对于16.04+

GPG密钥导入

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C8CAB6595FDFF622 

添加存储库配置

codename=$(lsb_release -c | awk  '{print $2}')
sudo tee /etc/apt/sources.list.d/ddebs.list << EOF
deb http://ddebs.ubuntu.com/ ${codename}      main restricted universe multiverse
deb http://ddebs.ubuntu.com/ ${codename}-security main restricted universe multiverse
deb http://ddebs.ubuntu.com/ ${codename}-updates  main restricted universe multiverse
deb http://ddebs.ubuntu.com/ ${codename}-proposed main restricted universe multiverse
EOF

sudo apt-get update
sudo apt-get install linux-image-$(uname -r)-dbgsym

(贷给Ubuntu Wiki

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.