[TIL] Ubuntu에서 /var/lib/dpkg/lock-frontend 에러

[TIL] Ubuntu에서 /var/lib/dpkg/lock-frontend 에러

728x90

$ sudo apt-get install nodejs E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3725 (unattended-upgr) N: Be aware that removing the lock file is not a solution and may break your system. E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

우분투에서 설치했는데 에러가 발생했다. 우분투 사용할 때마다 느끼는데 이 에러 생각보다 되게 자주 발생하는 듯 하다.

$ sudo killall apt apt-get

프로세스를 삭제하기 위해서 위의 명령어를 입력했다.

$ sudo killall apt apt-get apt: no process found apt-get: no process found

입력하니까 프로세스가 없다고 나온다.

$ sudo rm /var/lib/apt/lists/lock $ sudo rm /var/cache/apt/archives/lock $ sudo rm /var/lib/dpkg/lock*

그렇다면 위의 명령어를 입력해 보자!

$ sudo dpkg --configure -a $ sudo apt update $ sudo apt upgrade

마지막으로 위의 명령어 들을 입력해 주면 된다!

from http://sdardew-valley.tistory.com/60 by ccl(A) rewrite - 2021-08-18 11:26:36