dpkg或apt出现如下问题,只需要用apt重装dpkg就行
cgch@cgch-virtual-machine:~$ sudo apt-get install gcc
[sudo] password for cgch:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
cgch@cgch-virtual-machine:~$ sudo apt-get upgrade
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
sudo apt-get install dpkg之后,再次安装gcc的结果如下:
cgch@cgch-virtual-machine:~$ sudo apt-get install gcc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
cpp cpp-7 gcc-7 gcc-7-base gcc-8-base libasan4 libatomic1 libc-dev-bin
li