yum install -y kernel-devel
# debuginfo,在CentOS7中需要这样装
sudo vim /etc/yum.repos.d/CentOS-Debuginfo.repo
修改为enable=1
sudo debuginfo-install kernel
安装时可能还会报错:
Invalid GPG Key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7: No key found in given key data
需要从https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Debug-7下载key写入到/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7