我正在Ubuntu18.04上安装perf。但是,我遇到了一个libc依赖问题:
$ perf
WARNING: perf not found for kernel 5.0.0-21
You may need to install the following packages for this specific kernel:
linux-tools-5.0.0-21-generic
linux-cloud-tools-5.0.0-21-generic
$ sudo apt install linux-cloud-tools-5.0.0-21-generic
The following packages have unmet dependencies:
linux-tools-5.0.0-21-generic : Depends: linux-tools-5.0.0-21 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
$ sudo apt install linux-cloud-tools-5.0.0-21
The following packages have unmet dependencies:
linux-tools-5.0.0-21 : Depends: libc6 (>= 2.28) but 2.27-3ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.
$ sudo apt install libc6
libc6 is already the newest version (2.27-3ubuntu1).
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic有没有其他人碰过这个,还有什么办法可以绕过它吗?
发布于 2019-07-11 11:30:13
在@DougSmithies的推荐下,我创建了一个perf源代码。这很简单,但也不简单,下面是说明。
1)克隆linux内核:
$ git clone https://github.com/torvalds/linux.git2)通过uname -r查找内核,并通过git tags查找相应的内核分支。
linux$ git checkout v5.03)安装一些依赖项:
linux$ sudo apt install bison flex libelf-dev systemtap-sdt-dev libssl-dev libslang2-dev liblzma-dev libdw-dev libunwind-dev libgtk2.0-dev binutils-dev libbabeltrace-dev libiberty-dev libperl-dev libaudit-devtools/perf/Makefile将解释每个依赖项的用途。
3)切换到perf目录,并运行:
linux/tools/perf$ make
linux/tools/perf$ make install4)编辑/proc/sys/kernel/perf_event_paranoid (和/或?) /etc/sysctl.conf,以便其中唯一的值是-1。
5)得到一个根壳
$ sudo bash
# echo 0 > /proc/sys/kernel/kptr_restrict现在我有perf了!
发布于 2019-07-10 19:27:38
似乎你在你的sources.list中有仿生求婚。如果是的话
sudo apt install -t bionic-proposed linux-tools-generic-hwe-18.04-edge linux-cloud-tools-generic-hwe-18.04-edge这只能在你有仿生-提议是集成的情况下才能工作。
sudo apt --dry-run install -t bionic-proposed linux-tools-generic-hwe-18.04-edge linux-cloud-tools-generic-hwe-18.04-edge
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
linux-cloud-tools-5.0.0-21-generic linux-cloud-tools-common linux-hwe-cloud-tools-5.0.0-21 linux-hwe-tools-5.0.0-21
linux-tools-5.0.0-21-generic
The following packages will be REMOVED:
libllvm7*
The following NEW packages will be installed:
linux-cloud-tools-5.0.0-21-generic linux-cloud-tools-common linux-cloud-tools-generic-hwe-18.04-edge
linux-hwe-cloud-tools-5.0.0-21 linux-hwe-tools-5.0.0-21 linux-tools-5.0.0-21-generic linux-tools-generic-hwe-18.04-edge剪辑
https://askubuntu.com/questions/1157363
复制相似问题