다음을 수행할 때 처리 패키지 오류가 발생합니다 apt upgrade
.
온라인에서 언급된 일반적인 솔루션을 시도했습니다. 그러나 그것은 루프에 갇혔습니다.
❯ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
mysql-server-5.7 : PreDepends: mysql-common (>= 5.5) but it is not installed
Depends: apparmor (>= 2.10) but it is not installed
Depends: mysql-client-5.7 (>= 5.7.32-0ubuntu0.16.04.1) but it is not installed
Depends: mysql-common (>= 5.6.22-1~) but it is not installed
Depends: mysql-server-core-5.7 (= 5.7.32-0ubuntu0.16.04.1) but it is not installed
Recommends: libhtml-template-perl but it is not installed
phpmyadmin : Depends: libapache2-mod-php or
libapache2-mod-phpfilter but it is not installable or
php-cgi or
php-fpm or
php
Depends: php-mysql but it is not installed or
php-mysqli or
php-mysqlnd
Depends: php-json
Depends: php-common but it is not installed
Depends: libjs-sphinxdoc (>= 1.0) but it is not installed
Depends: dbconfig-mysql but it is not installed or
dbconfig-no-thanks but it is not installed or
dbconfig-common (< 2.0.0) but it is not installed
Depends: php-gettext
Depends: php-mbstring
Depends: php-phpseclib (>= 2.0)
Recommends: php-gd
Recommends: mysql-client but it is not installed or
mariadb-client but it is not installed or
virtual-mysql-client
Recommends: php-tcpdf but it is not installed
E: Unmet dependencies. Try using -f.
그런 다음 다음을 시도합니다.
❯ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
apparmor dbconfig-common dbconfig-mysql libapache2-mod-php libapache2-mod-php7.0
libapparmor-perl libjs-sphinxdoc libjs-underscore mysql-client-5.7
mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 php-common
php-gettext php-mbstring php-mysql php-pear php-phpseclib php-xml php7.0-cli
php7.0-common php7.0-json php7.0-mbstring php7.0-mysql php7.0-opcache php7.0-readline
php7.0-xml
Suggested packages:
apparmor-profiles apparmor-profiles-extra apparmor-docs apparmor-utils mysql-server
| mariadb-server mailx tinyca php-libsodium php-mcrypt php-gmp
Recommended packages:
libhtml-template-perl
The following NEW packages will be installed:
apparmor dbconfig-common dbconfig-mysql libapache2-mod-php libapache2-mod-php7.0
libapparmor-perl libjs-sphinxdoc libjs-underscore mysql-client-5.7
mysql-client-core-5.7 mysql-common mysql-server-core-5.7 php-common php-gettext
php-mbstring php-mysql php-pear php-phpseclib php-xml php7.0-cli php7.0-common
php7.0-json php7.0-mbstring php7.0-mysql php7.0-opcache php7.0-readline php7.0-xml
The following packages will be upgraded:
mysql-server-5.7
1 upgraded, 27 newly installed, 0 to remove and 0 not upgraded.
14 not fully installed or removed.
Need to get 20.7 MB/23.2 MB of archives.
After this operation, 131 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
...
Selecting previously unselected package php-phpseclib.
Preparing to unpack .../php-phpseclib_2.0.1-1build1_all.deb ...
Unpacking php-phpseclib (2.0.1-1build1) ...
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.7_5.7.33-0ubuntu0.16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
그 다음에:
❯ sudo dpkg --configure -a
Setting up grub-pc (2.02~beta2-36ubuntu3.29) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package grub-pc (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up tzdata (2021a-0ubuntu0.16.04) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package tzdata (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up samba-common (2:4.3.11+dfsg-0ubuntu0.16.04.32) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package samba-common (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up openssh-server (1:7.2p2-4ubuntu2.10) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package openssh-server (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of samba:
samba depends on samba-common (= 2:4.3.11+dfsg-0ubuntu0.16.04.32); however:
Package samba-common is not configured yet.
dpkg: error processing package samba (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-minimal:
ubuntu-minimal depends on tzdata; however:
Package tzdata is not configured yet.
...
dpkg: error processing package python-pip-whl (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nodejs:
nodejs depends on ca-certificates; however:
Package ca-certificates is not configured yet.
dpkg: error processing package nodejs (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
grub-pc
tzdata
samba-common
openssh-server
samba
ubuntu-minimal
samba-common-bin
ca-certificates
python-pip
software-properties-common
python-pip-whl
nodejs
여기에 나열된 패키지를 제거하려고 시도했습니다.
❯ sudo apt-get remove $pkg -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'libapache2-mod-php7.0' is not installed, so not removed
Package 'mysql-server' is not installed, so not removed
Package 'php-pear' is not installed, so not removed
Package 'php7.0-cli' is not installed, so not removed
Package 'php7.0-common' is not installed, so not removed
Package 'php7.0-gd' is not installed, so not removed
Package 'php7.0-json' is not installed, so not removed
Package 'php7.0-mysql' is not installed, so not removed
Package 'php7.0-opcache' is not installed, so not removed
Package 'php7.0-readline' is not installed, so not removed
Package 'php7.0-xml' is not installed, so not removed
Package 'php7.0-mbstring' is not installed, so not removed
Package 'php7.0-mcrypt' is not installed, so not removed
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
grub-gfxpayload-lists : Depends: grub-pc (>= 1.99~20101210-1ubuntu2)
libtcl8.6 : Depends: tzdata but it is not going to be installed
phpmyadmin : Depends: libapache2-mod-php or
libapache2-mod-phpfilter but it is not installable or
php-cgi or
php-fpm or
php
Depends: php-mysql but it is not going to be installed or
php-mysqli or
php-mysqlnd
Depends: php-json
Depends: php-common but it is not going to be installed
Depends: libjs-sphinxdoc (>= 1.0) but it is not going to be installed
Depends: dbconfig-mysql but it is not going to be installed or
dbconfig-no-thanks but it is not going to be installed or
dbconfig-common (< 2.0.0) but it is not going to be installed
Depends: php-gettext
Depends: php-mbstring
Depends: php-phpseclib (>= 2.0)
Recommends: php-gd
Recommends: mysql-client but it is not going to be installed or
mariadb-client but it is not going to be installed or
virtual-mysql-client
Recommends: php-tcpdf but it is not going to be installed
python3-requests : Depends: ca-certificates but it is not going to be installed
rubygems-integration : Depends: ca-certificates but it is not going to be installed
ssh-import-id : Depends: ca-certificates but it is not going to be installed
Recommends: openssh-server
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
그러면 설치 단계로 돌아갑니다. 이 문제를 해결하고 모든 것을 업그레이드하려면 어떻게 해야 합니까 apt-get
?
운영 체제: 우분투 16.04.7 LTS x86_64
셸: 물고기 3.1.2
답변1
귀하의 상황은 …is locked by another process…
실행 중인 다른 프로세스로 인해 dpkg
발생할 가능성이 높습니다. 이는 이전에 실패한 패키지 구성 실행에서 남은 것일 수 있습니다.
dpkg
다른 창 등에서 실행되고 있지 않은 것이 확실하다면 apt
기존 프로세스를 살펴보고 사용을 dpkg
고려해 보세요 .kill
$ ps awux | grep dpkg
다른 오류의 경우 설치 중에 하나 이상의 패키지가 구성되지 않아 발생합니다. 실제로 일어난 일에 대한 로그를 보지 않고서는 원인을 파악하는 것이 불가능합니다.
이러한 패키지가 필요하지 않다고 판단되면 문제가 사라질 때까지 해당 패키지를 제거할 수 있습니다. /var/lib/dpkg/info/
예를 들어 사전 또는 사후 rm 스크립트의 문제로 인해 패키지 제거에 실패하는 경우 해당 스크립트를 찾아 /var/lib/dpkg/info/mysql-server.postrm
제거할 수 있습니다. 분명히 이러한 패키지를 유지하려는 경우 이는 "핵 옵션"이지 현명한 방법은 아닙니다. 즉시 다시 설치하고 싶다면 괜찮을 것입니다.
나는 당신이 추구하는 대량 제거 전략을 권장하지 않습니다. 중요한 것을 제거하고 설치를 완전히 중단하는 것은 너무 쉽습니다. 개별 패키지의 설치 문제를 해결하는 데 집중하세요. apt의 출력은 무엇이 무엇에 달려 있는지 알려주는 데 매우 좋습니다. 이 문제를 해결하려면 종속성을 따르십시오.
향후 문제를 해결하는 데 도움이 되도록 실패한 설치 로그를 보관하십시오. 애초에 이러한 패키지가 구성에 실패하는 이유를 이해하지 못하기 때문에 적절한 도움을 제공할 수 없습니다.
답변2
또한 이 문제가 발생했습니다. 마침내 내 부팅 파티션이 마지막 바이트까지 가득 찼습니다. 일부 오래된 업데이트가 제대로 제거되지 않았습니다. 더 크고 오래된 파일을 수동으로 삭제하고 다시 시작하십시오. 다시 일하다
(부팅) 파티션 크기를 확인하려면 "baobab"과 같은 도구를 사용하십시오.https://linux.die.net/man/1/baobab.
! 삭제 전 파일명을 다시 한 번 확인해주세요! 시스템을 망칠 수도 있어