apt-get: "...그러나 설치되지 않음"에 대한 이유 [중복]

apt-get: "...그러나 설치되지 않음"에 대한 이유 [중복]

그래서 apt-get은 종속성이 "설치되지 않음"으로 인해 패키지 설치가 실패했다는 악명 높은 메시지로 다시 한 번 나를 귀찮게 했습니다.

~ $ sudo apt-get install php-apcu
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php-apcu : Depends: phpapi-20151012
            Recommends: php-apcu-bc but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

내가 이해한 바로는 기본값은 누락된 모든 종속성과 요청된 패키지를 설치하는 것입니다. apt-get이 특정 종속성 설치를 거부하는 원인은 무엇입니까? (이 문제의 원인이 두 가지 이상인 경우 원인이 무엇인지 어떻게 알 수 있나요?)

답변1

간단히 말해서: <foobar> is not going to be installed<foobar>종속성 자체가 어떤 이유로 충족될 수 없는 일종의 종속성을 갖고 있음 을 암시합니다 .

재실행 apt-get하고 문제가 되는 종속성을 명령줄에 명시적으로 포함하면 문제가 무엇인지 더 잘 알 수 있습니다.


위의 예에서 나는 이것을 얻습니다:

~ $ sudo apt-get install php-apcu php-apcu-bc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php-apcu : Depends: phpapi-20151012
 php-apcu-bc : Depends: phpapi-20151012
E: Unable to correct problems, you have held broken packages.

그리고:

~ $ sudo apt-get install php-apcu php-apcu-bc phpapi-20151012
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package phpapi-20151012 is a virtual package provided by:
  php7.0-phpdbg 7.0.22-3
  php7.0-fpm 7.0.22-3
  php7.0-cli 7.0.22-3
  php7.0-cgi 7.0.22-3
  libphp7.0-embed 7.0.22-3
  libapache2-mod-php7.0 7.0.22-3
You should explicitly select one to install.

E: Package 'phpapi-20151012' has no installation candidate

따라서 여기서 문제는 처음에 요청된 패키지가 php-apcu에 의존하고 php-apcu-bc, 이 패키지도 에 의존한다는 것입니다 phpapi-20151012. 후자는 직접 설치할 수 있는 패키지가 아니라 여러 패키지에서 제공하는 기능이므로 apt-get은 설치해야 할 항목을 자동으로 결정할 수 없습니다.

이 특정 사례의 근본 원인은 PHP5를 실행하는 시스템에 PHP7 패키지를 설치하려고 했고 php-apcu올바른 패키지는 php5-apcu.

관련 정보