Mysql-common을 제거할 수 없습니다.

Mysql-common을 제거할 수 없습니다.

나중에 다시 설치하기 위해 mysql을 완전히 제거하려고 하는데, mysql 관련 패키지를 모두 제거한 후에도 mysql-common이 손상된 상태로 남아 있는 것 같습니다.

$ sudo dpkg -l | grep mysql
pc  mysql-common                                  5.6.28-0ubuntu0.15.10.1                      all          MySQL database common files, e.g. /etc/mysql/my.cnf

그러나 apt-get 제거를 실행하면

$ sudo apt-get remove mysql-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'mysql-common' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.

또는 --purge를 사용하면

$ sudo apt-get remove --purge mysql-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  mysql-common*
0 upgraded, 0 newly installed, 1 to remove and 36 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 199090 files and directories currently installed.)
Removing mysql-common (5.6.28-0ubuntu0.15.10.1) ...
Purging configuration files for mysql-common (5.6.28-0ubuntu0.15.10.1) ...
update-alternatives: error: no alternatives for my.cnf
dpkg: error processing package mysql-common (--purge):
 subprocess installed post-removal script returned error exit status 2
Errors were encountered while processing:
 mysql-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

또한 모든 mysql 관련 디렉터리와 파일을 제거했습니다.

이 느린 깨진 패키지를 어떻게 제거할 수 있습니까?

답변1

일부 종속성이 사라지거나 어떤 이유로 일부 구성 파일이 삭제된 경우 일부 패키지를 제거할 수 없습니다. 패키지가 완전히 설치되지도 않고 완전히 제거되지도 않게 됩니다.

이 경우 해결책은 sudo apt-get install패키지에 있습니다. 필요한 경우 을 수행합니다 sudo apt-get install --reinstall [package]. 누락된 파일이 시스템에 추가되고 누락된 종속성이 즉시 설치됩니다. 그런 다음 일반적인 방법으로 패키지를 완전히 제거할 수 있습니다 sudo apt-get remove [package].

apt-get다른 (종속성) 문제로 인해 패키지 재설치를 거부하는 경우 apt-get패키지를 다운로드하고 dpkg직접 설치하는 데만 사용할 수 있습니다.

apt-get download mysql-common
sudo dpkg -i mysql-common_*.deb
sudo apt-get install -f

Apt는 이전에 다운로드하고 설치한 패키지의 아카이브를 보관하여 /var/cache/apt/archives/두 번째 단계부터 직접 시작할 수 있기 때문에 다운로드를 건너뛸 수 있는 경우도 있습니다.

sudo dpkg -i /var/cache/apt/archives/mysql-common_*.deb

관련 정보