
mysql-server-5.6을 다시 설치하려고 하는데 다음과 같은 이상한 메시지가 나타날 때마다 아무것도 할 수 없습니다.
root@ps****:/home/nikitasorokin# apt-get remove --purge mysql-server-5.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
mysql-client-core-5.6
Use 'apt-get autoremove' to remove it.
The following packages will be REMOVED:
mysql-server-5.6*
0 upgraded, 0 newly installed, 1 to remove and 941 not upgraded.
1 not fully installed or removed.
After this operation, 52.5 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 122623 files and directories currently installed.)
Removing mysql-server-5.6 (5.6.25-0ubuntu1) ...
stop: Unknown instance:
invoke-rc.d: initscript mysql, action "stop" failed.
dpkg: error processing package mysql-server-5.6 (--purge):
subprocess installed pre-removal script returned error exit status 1
stop: Unknown instance:
invoke-rc.d: initscript mysql, action "stop" failed.
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.6
E: Sub-process /usr/bin/dpkg returned an error code (1)
주요 권장 사항은 mysql과 해당 구성 요소를 모두 완전히 제거하는 것이라는 것을 알고 있지만 그렇게 할 수는 없습니다. 제발, 어떤 해결책이라도 고려해 주시겠습니까?
답변1
post-installation
스크립트 편집sudo nano /var/lib/dpkg/info/mysql-server-5.6.postinst
기능 검색
invoke() { if [ -x /usr/sbin/invoke-rc.d ]; then invoke-rc.d mysql $1 else /etc/init.d/mysql $1 fi }
그리고로 교체
invoke() { echo #if [ -x /usr/sbin/invoke-rc.d ]; then # invoke-rc.d mysql $1 #else # /etc/init.d/mysql $1 #fi }
파일을 저장하세요
pre-removal
스크립트 편집sudo nano /var/lib/dpkg/info/mysql-server-5.6.prerm
라인 검색
if [ -x "/etc/init.d/mysql" ] || [ -e "/etc/init/mysql.conf" ]; then invoke-rc.d mysql stop || exit $? fi
교체하고
if [ -x "/etc/init.d/mysql" ] || [ -e "/etc/init/mysql.conf" ]; then echo #invoke-rc.d mysql stop || exit $? fi
post-removal
스크립트 편집sudo nano /var/lib/dpkg/info/mysql-server-5.6.postrm
찾다
# New packaging paradigm for my.cnf as of Dec-2014 for sharing mysql # variants in Ubuntu. case "$1" in remove|disappear) /usr/share/mysql-common/configure-symlinks remove mysql "$mysql_cfgdir/mysql.cnf" ;; esac
교체하고
# New packaging paradigm for my.cnf as of Dec-2014 for sharing mysql # variants in Ubuntu. case "$1" in remove|disappear) # /usr/share/mysql-common/configure-symlinks remove mysql "$mysql_cfgdir/mysql.cnf" ;; esac
파일을 저장하고 명령을 다시 실행하십시오.
sudo apt-get remove --purge mysql-server-5.6