최근에 Ubuntu 16.04를 새로 설치했습니다. 나는 또한 설치 mysql-server
하고 mysql-client
(기본 버전 5.7.12)를 통해 apt-get install
.
5.7.12에서 일부 문제가 발생했기 때문에 제거하기로 결정했습니다. apt-get remove mysql-server mysql-client
먼저 시도 했지만 아티팩트가 좋아 /etc/mysql
지고 /var/lib/mysql
제거되지 않는 것을 보았습니다 .
그런 다음 시도 apt-get --purge removed mysql-server mysql-client
했지만 여전히 차이가 없습니다.
따라서 수동으로 (을 통해 rm -rf
) 제거했습니다 . 또한와 같은 종속성 패키지 에서 온 모든 *mysql*
파일을 수동으로 제거했습니다 ./usr/
mysql-*
mysql-common
그러나 지금 다시 설치하려고 할 때 mysql-server and -client
할 수 없다는 것을 알게되었습니다.
사실, 지금은 어디도 할 수있는 상태에있어 apt-get remove mysql-server
도 apt-get install mysql-server
!
내가 처한 상황을 어떻게 해결합니까? 로컬 패키지 리포지토리 메타 데이터가 손상된 경우 어떻게 복구합니까?
축복받은 OS를 다른 모든 앱 및 환경과 함께 다시 설치하는 것이 싫습니다 mysql-server
.
예를 들어 다음은 제거하려고 할 때 발생하는 오류입니다 mysql-server
.
$ apt-get remove mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libaio1 mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
mysql-server
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 159 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 237601 files and directories currently installed.)
Removing mysql-server (5.7.12-0ubuntu1) ...
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)
그리고 설치하려고 할 때이 오류가 발생합니다.
$ apt-get -f install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
mysql-server
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/10.1 kB of archives.
After this operation, 159 kB of additional disk space will be used.
Selecting previously unselected package mysql-server.
(Reading database ... 237599 files and directories currently installed.)
Preparing to unpack .../mysql-server_5.7.12-0ubuntu1_all.deb ...
Unpacking mysql-server (5.7.12-0ubuntu1) ...
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
출력은 다음과 같습니다 apt-get install -f
.
$ apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
... invoke-rc.d: initscript mysql, action "start" failed. ...
다른 종류의 설치 명령을 사용하고 있습니다.
sudo apt-get remove --purge mysql-server-5.7
. 이것은 실제로 mysql-server-5.7
우리가 말하고있는 것이 아니라는 점에 유의하십시오 mysql-server
.
mysql-server-5.7
나쁜 상태에, 그것을 다시 설치하려고 :sudo apt-get install --reinstall mysql-server-5.7
.