September 21, 2017

How to solve dpkg error


[Type 1]

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?


If you see a message like above, following method can helps.

1. sudo rm -rf /var/lib/dpkg/lock
2. sudo apt-get autoclean
* This cleans up the software cache that is currently not installed.
3. apt-get clean
* This cleans up the whole cache.
4. sudo reboot

Check environment
O      S Ubuntu 15.10 (64bit) CPU Intel i7-4710MQ 2.50GHz
SHELL GNU bash (4.3.42) GPU Gallium 0.4 on SVGA3D


RAM 984MiB




[Type 2]

E: Sub-process /usr/bin/dpkg returned an error code (1)

If you see a message like above, following method can helps.

$ sudo rm /var/lib/dpkg/info/*
$ sudo apt-get clean
$ sudo apt-get update
$ sudo apt-get —fix-broken install

※ Check environment: Ubuntu 20.04(64bit)