Share/OS
[error] apt-get update 에러 , apt install net-tools 설치 에러, could not get lock /var/lib/dpkg/lock
Jimmy.B
2021. 11. 23. 11:18
상황
초기 세팅된 ubuntu 18.04 환경에서
apt install net-tools 를 시도
설치 되지않고,
update하라고 해서 다시 update시도했으나,
설치 실패
error --> could not get lock /var/lib/dpkg/lock
해결
두가지 에러존재
1. apt-get update
2. apt install net-tools
1. apt-get update
아래 dns-nameserver와 nameserver를 추가를 해주면 정상적으로 작동
$ sudo vi /etc/network/interfaces
//(아래한줄 작성추가)
dns-nameservers 8.8.8.8 8.8.4.4
$ rm /etc/resolv.conf
$ sudo vi /etc/resolv.conf
//(아래 두줄 작성 추가)
nameserver 8.8.8.8
nameserver 8.8.4.4
2. apt install net-tools , could not get lock /var/lib/dpkg/lock
) sudo killall apt apt-get
// 나의 경우 진행중인 프로세스가 없다고 뜸...
//아래 3단계를 직접 삭제 해줘야 됨
- 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
해결
-끝-
참고자료
1.
2.
https://kgu0724.tistory.com/71