This article is reproduced from: http://www.oolap.com/2015-11-07-ubuntu-install-dbgsym
When executing the systemtap script under linux, you need to install the debug-info of the system kernel, debug-info is called redhat, and called debug symbols under ubuntu, abbreviated as dbgsym. When ubuntu is installed by default, dbgsym is not installed, and there is no dbgsym package in the default warehouse. The dbgsym package exists in a separate warehouse. The official warehouse address is http://ddebs.ubuntu.com/, and the package name suffix seems to have also changed from .deb to .ddeb.
The steps to install dbgsym are as follows:
/etc/apt/sources.list file to add dbgsym sourceTo install the dbgsym package, you can manually add this source. Edit the /etc/apt/sources.list file and add the following two lines at the end:
deb http://ddebs.ubuntu.com/ precise main
deb http://ddebs.ubuntu.com/ precise-updates main
Where precise is replaced with the name of the ubuntu release, you can use the following command to complete the operation
python2 -c 'import sys; print "\n".join(sys.argv[1:])'"deb http://ddebs.ubuntu.com/ $(lsb_release --short --codename)"{,-updates}" main #restricted universe multiverse"| sudo tee -a /etc/apt/sources.list
If you want to install dbgsym of other software, you may need to enable other components other than "main".
When you execute sudo apt-get update after adding the source for the first time, you may see the following error message at the end:
Reading package list...carry out
W:GPG error: http://ddebs.ubuntu.com precise Release:Since there is no public key, the following signatures cannot be verified: NO_PUBKEY ECDCAD72428D7C01
W:GPG error: http://ddebs.ubuntu.com precise-updates Release:Since there is no public key, the following signatures cannot be verified: NO_PUBKEY ECDCAD72428D7C01
This is because the source public key is not added, you can use the following command to add the source public key from ubuntu keyserver.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ECDCAD72428D7C01
The last parameter ECDCAD72428D7C01 is the PUBKEY reported above. For http://ddebs.ubuntu.com/, this value should be fixed.
After adding the public key, execute the following command again to update the source information:
sudo apt-get update
After updating the source, you can find and install dbgsym just like installing a normal software package. When searching, you can add the "-dbgsym" suffix. If you want to find kernel-related dbgsym, you can use the following command to search:
sudo aptitude search 'linux-image-.*-dbgsym'
You can also bring the version number to directly search the dbgsym of the current kernel:
sudo aptitude search 'linux-image-'$(uname -r)'-dbgsym'
Since the Linux kernel version is also updated iteratively, it is possible that the current kernel version of dbgsym has been online and offline, and the corresponding dbgsym cannot be found and installed. At this time, it is recommended that the system reinstall a kernel version that has a corresponding dbgsym. If the latest version of the kernel is not strong If required, it is recommended to select an older but relatively stable version from the dbgsym list.
For example, I currently find the following dbgsym version list:
p linux-image-3.13.0-30-generic-dbgsym - Linux kernel debug image for version 3.13.0 on 64 bit x86 SMP
p linux-image-3.13.0-30-generic-dbgsym:i386 - Linux kernel debug image for version 3.13.0 on 32 bit x86 SMP
p linux-image-3.13.0-32-generic-dbgsym - Linux kernel debug image for version 3.13.0 on 64 bit x86 SMP
p linux-image-3.13.0-32-generic-dbgsym:i386 - Linux kernel debug image for version 3.13.0 on 32 bit x86 SMP
p linux-image-3.13.0-65-generic-dbgsym - Linux kernel debug image for version 3.13.0 on 64 bit x86 SMP
p linux-image-3.13.0-65-generic-dbgsym:i386 - Linux kernel debug image for version 3.13.0 on 32 bit x86 SMP
p linux-image-3.13.0-66-generic-dbgsym - Linux kernel debug image for version 3.13.0 on 64 bit x86 SMP
p linux-image-3.13.0-66-generic-dbgsym:i386 - Linux kernel debug image for version 3.13.0 on 32 bit x86 SMP
p linux-image-3.13.0-67-generic-dbgsym - Linux kernel debug image for version 3.13.0 on 64 bit x86 SMP
p linux-image-3.13.0-67-generic-dbgsym:i386 - Linux kernel debug image for version 3.13.0 on 32 bit x86 SMP
Then I will choose to install the 3.13.0-32-generic version, linux-image and linux-headers are best installed at the same time, you can use the following command to install the corresponding kernel and dbgsym at the same time:
sudo aptitude install linux-{image,headers}-3.13.0-32-generic linux-image-3.13.0-32-generic-dbgsym
linux-image recommends (suggests) install linux-headers, but not recommended (recommends). When using aptitude to install the software package, the recommended software packages will be installed by default, but the recommended software packages are not controlled. There are usually many recommended software packages. It is not needed, if you need to install it, you can specify it manually.
Since the official source of dbgsym is abroad and no mirror is found, downloading and installing from the source is usually very slow. You can also copy the downloaded installation package and install it with dpkg -i:
sudo dpkg -i linux-image-3.13.0-32-generic-dbgsym_3.13.0-32.57~precise1_amd64.ddeb
Recommended Posts