이 문제를 어떻게 해결할 수 있나요?
root@ip-*******:/# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... 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.
Do you want to continue? [Y/n] y
Setting up mysql-community-server (5.7.19-1ubuntu16.04) ...
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.
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor reset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2017-09-01 12:16:18 UTC; 4ms ago
Main PID: 16929 (code=exited, status=0/SUCCESS)
dpkg: error processing package mysql-community-server (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-community-server (= 5.7.19-1ubuntu16.04); however:
Package mysql-community-server 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-community-server
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
그리고 그것은 모두 같은 오류입니다.
다음에 추가:
root@ip-172-31-15-21:/# apt-get update
Hit:1 http://security.ubuntu.com/ubuntu precise-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu precise InRelease
Ign:3 http://extras.ubuntu.com/ubuntu precise InRelease
Hit:4 http://archive.ubuntu.com/ubuntu precise Release
Hit:6 http://extras.ubuntu.com/ubuntu precise Release
Ign:7 http://archive.canonical.com/ubuntu precise InRelease
Get:8 http://extras.ubuntu.com/ubuntu precise Release.gpg [72 B]
Ign:8 http://extras.ubuntu.com/ubuntu precise Release.gpg
Hit:9 http://archive.canonical.com/ubuntu precise Release
Ign:11 http://it.archive.ubuntu.com/ubuntu precise InRelease
Hit:12 http://it.archive.ubuntu.com/ubuntu precise-updates InRelease
Hit:13 http://it.archive.ubuntu.com/ubuntu precise Release
Fetched 72 B in 2s (25 B/s)
Reading package lists... Done
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)
W: http://archive.ubuntu.com/ubuntu/dists/precise/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)
W: GPG error: http://extras.ubuntu.com/ubuntu precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192
W: The repository 'http://extras.ubuntu.com/ubuntu precise Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: http://archive.canonical.com/ubuntu/dists/precise/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)
W: http://it.archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)
W: http://it.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg: Signature by key 630239CC130E1A7FD81A27B140976EAF437D05B5 uses weak digest algorithm (SHA1)
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
답변1
이전 세션에서 설치가 중단된 것 같습니다.
sudo apt-get install -f
손상된 종속성을 수정할 수 있는지 확인해 보세요 .
실패하면 MySQL 서버를 지웁니다.
sudo apt-get purge mysql-server mysql-community-server
그런 다음 정리하고 업데이트하십시오.
sudo apt-get autoclean && sudo apt-get clean && sudo apt-get update
일반 업그레이드를 수행하려면:
sudo apt-get upgrade
이제 다시 설치해 보세요.
sudo apt-get install mysql-server and mysql-community-server
루트 프롬프트에서 이 작업을 수행하면 boot sudo
명령이 부팅되지 않습니다.
답변2
업데이트된 질문과 관련하여 우선 귀하의 source.list에 약간의 중복이 있음을 알 수 있습니다. 예를 들어 출력에 다음과 같은 오류가 있습니다.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:6
소스 파일의 첫 번째 줄에는 다음이 있습니다.
deb http://it.archive.ubuntu.com/ubuntu precise main restricted
6행에서도 반복합니다.
따라서 이러한 오류를 수정하려면 출력에 표시된 중복 줄을 모두 제거하는 것이 좋습니다. (많이있다!)
둘째, 다음과 같은 오류가 있습니다.
W: GPG error: http://extras.ubuntu.com/ubuntu precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192
이 GNU Privacy Guard 오류를 해결하려면 키를 가져와야 합니다. 이것을 실행하세요:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16126D3A3E5C1192
dpkg --configure -a
그런 다음 또는 둘 중 하나를 실행하여 apt-get install -f
손상된 종속성을 수정합니다 .
그리고 다시:
apt-get clean && apt-get update
답변3
Ubuntu 16.04 LTS(xenial)에서 이 문제가 직접 발생했습니다. MySQL 로그에도 오류가 있을 수 있습니다 mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server Upgrade process encountered error and will not continue.
.
문제를 해결하기 위해 제가 수행한 작업은 다음과 같습니다(아직 연결 실패의 실제 문제를 디버깅하지 않았습니다). 이는 지난 3번의 MySQL 업데이트에 유효했습니다.
먼저 MySQL을 루트로 실행합니다.
# mysql_upgrade --defaults-file=/etc/mysql/debian.cnf
이 작업은 오류 없이 완료되어야 합니다.
그런 다음 파일을 편집합니다 /var/lib/dpkg/info/mysql-server-5.7.postinst
. 320번 줄 근처에서 이 줄을 찾아 주석을 달아보세요.
mysql_upgrade --defaults-file=/etc/mysql/debian.cnf || result=$?
종료하고 파일을 저장합니다. 다시 실행 apt-get upgrade
하면 깨끗하게 실행됩니다.
답변4
이 오류는 mysql-server를 설치하려고 하는데 문제가 발생했음을 나타냅니다. 패키지를 구성하는 동안 문제가 발생했습니다 mysql-community-server
. 다음을 실행해 보세요.
dpkg --configure mysql-community-server
또는:
dpkg-reconfigure mysql-community-server
더 이상 mysql-server를 사용하지 않으려면 다음을 실행할 수 있습니다.
apt-get remove mysql-community-server mysql-server
시스템에서 이러한 패키지를 완전히 제거하십시오. 그러면 효과가 있을 것입니다.