혹시라도 제목과 같은 에러를 Ubuntu 환경에 리눅스 작업중 만났다면 이 블로그가 도움이 될것이다.
해당 에러는 리눅스 환경에서 apt install 명령어를 통해 외부 라이브러리를 다운받는 도중 생기는 에러이다.
이 에러의 경우 dpkg및 apt install 기능 자체가 모두 죽게되어 명령어를 수행할 수 없게되고 그로 인해 패키지들간의 의존성 문제가 발생하게 되어 이를 해결하여야 apt install 기능을 다시 사용할 수 있다.
해결방법은 의외로 간단한데 해당 절차를 따르면 된다.
첫번째로 에러가 나는 위치인 dpkg 경로 밑에 info 라는 디렉터리가 존재한다. 이 디렉터리에는 리눅스의 기본설정들이 존재하게 된다. 이 파일들을 전부 삭제하여준다.
두번째로 리눅스의 --configure -a 옵션 명령어를 사용하여 dpkg 명령을 다시 실행시켜준다.
세번째로 apt update를 실행시켜준다.
해당 순서대로 작업을 해줄경우 이후부터는 업데이트 및 설치에러가 일어나지 않는다.
에러 해결 코드는 아래를 참조하도록 하자
sudo rm /var/lib/dpkg/info/*
sudo dpkg --configure -a
sudo apt update -y