Ubuntu 安装头文件报错apt-get install linux-headers-$(uname -r)
原因是因为apt-get线程被占用了,需要杀死:
sudo rm -rf /var/lib/dpkg/lock
sudo rm -rf /var/cache/apt/archives/lock
sudo apt-get update
sudo dpkg --configure -a
但是结果还是行不通,需要切换成管理员权限sudo su:
xxx@xxx-VirtualBox:~$ sudo su
[sudo] password for xxx:
root@xxx-VirtualBox:/home/xxx# apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-headers-5.13.0-40-generic is already the newest version (5.13.0-40.45).
linux-headers-5.13.0-40-generic set to manually installed.
0 to upgrade, 0 to newly install, 0 to remove and 21 not to upgrade.
交流学习及资料分享: