1.E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
chuchienshu@ubuntu:~$ sudo apt-get install g++ 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?
Someone experienced said that this error appear while others’ apt process alive.So I did as blew.
chuchienshu@ubuntu:~$ ps -A | grep apt 2934 ? 00:00:00 apt.systemd.dai 2938 ? 00:00:00 apt.systemd.dai chuchienshu@ubuntu:~$ sudo kill -9 2934 chuchienshu@ubuntu:~$ ps -A | grep apt 2938 ? 00:00:00 apt.systemd.dai chuchienshu@ubuntu:~$ sudo kill -9 2938 chuchienshu@ubuntu:~$ ps -A | grep apt chuchienshu@ubuntu:~$ sudo apt-get install g++ 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?
However, this error still here!
Further going.I got the finish solution.
chuchienshu@ubuntu:~$ sudo rm /var/cache/apt/archives/lock chuchienshu@ubuntu:~$ sudo rm /var/lib/dpkg/lock chuchienshu@ubuntu:~$ sudo dpkg --configure -a chuchienshu@ubuntu:~$ sudo apt-get update Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease Hit:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease Hit:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease Reading package lists... Done chuchienshu@ubuntu:~$ sudo apt-get install g++ Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: