문제를 해결할 수 없습니다. 손상된 패키지를 보유하고 있습니다.

문제를 해결할 수 없습니다. 손상된 패키지를 보유하고 있습니다.

Postgres를 설치하려고 합니다. 다음과 같이 썼습니다.

sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
    wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
    sudo apt-get update

그런 다음 이:

jonsdirewolf@DESKTOP-GNM7V6T:~$ sudo apt-get install postgresql-common
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:
 postgresql-common : Depends: init-system-helpers (>= 1.18~) but 1.14ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.
jonsdirewolf@DESKTOP-GNM7V6T:~$ sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list"wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
gpg: no valid OpenPGP data found.

Windows 10에 내장된 wsl Linux 환경을 사용하고 있습니다.

jonsdirewolf@DESKTOP-GNM7V6T:~$ uname -a
Linux DESKTOP-GNM7V6T 3.4.0+ #1 PREEMPT Thu Aug 1 17:06:05 CST 2013 x86_64 x86_64 x86_64 GNU/Linux

답변1

교체해야 해

sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list"

그리고

sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"

링크 주소에서 볼 수 있듯이 16.04 xenial용입니다(링크에 "xenial"이 포함되어 있음).

관련 정보