我正在尝试安装PostgreSQL第一次,但我收到以下错误:
root@CodeWarriors:~# apt-get install postgresql
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
postgresql-9.3 postgresql-client-9.3 postgresql-client-common
postgresql-common
Suggested packages:
oidentd ident-server locales-all postgresql-doc-9.3
The following NEW packages will be installed:
postgresql postgresql-9.3 postgresql-client-9.3 postgresql-client-common
postgresql-common
0 upgraded, 5 newly installed, 0 to remove and 910 not upgraded.
Need to get 0 B/3.603 kB of archives.
After this operation, 15,2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package postgresql-client-common.
(Reading database ... 305678 files and directories currently installed.)
Preparing to unpack .../postgresql-client-common_154ubuntu1_all.deb ...
Unpacking postgresql-client-common (154ubuntu1) ...
Selecting previously unselected package postgresql-client-9.3.
Preparing to unpack .../postgresql-client-9.3_9.3.14-0ubuntu0.14.04_amd64.deb ...
Unpacking postgresql-client-9.3 (9.3.14-0ubuntu0.14.04) ...
Selecting previously unselected package postgresql-common.
Preparing to unpack .../postgresql-common_154ubuntu1_all.deb ...
Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
Unpacking postgresql-common (154ubuntu1) ...
Selecting previously unselected package postgresql-9.3.
Preparing to unpack .../postgresql-9.3_9.3.14-0ubuntu0.14.04_amd64.deb ...
Unpacking postgresql-9.3 (9.3.14-0ubuntu0.14.04) ...
Selecting previously unselected package postgresql.
Preparing to unpack .../postgresql_9.3+154ubuntu1_all.deb ...
Unpacking postgresql (9.3+154ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up postgresql-client-common (154ubuntu1) ...
Setting up postgresql-client-9.3 (9.3.14-0ubuntu0.14.04) ...
update-alternatives: using
/usr/share/postgresql/9.3/man/man1/psql.1.gz to provide
/usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
Setting up postgresql-common (154ubuntu1) ...
/usr/share/postgresql-common/supported-versions: 3: /etc/os-release: OS: not found
dpkg: error processing package postgresql-common (--configure):
subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of postgresql-9.3:
postgresql-9.3 depends on postgresql-common (>= 142~); however:
Package postgresql-common is not configured yet.
dpkg: error processing package postgresql-9.3 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql:
postgresql depends on postgresql-9.3; however:
Package postgresql-9.3 is not configured yet.
dpkg: error processing package postgresql (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
postgresql-common
postgresql-9.3
postgresql
E: Sub-process /usr/bin/dpkg returned an error code (1)
如何解决这个错误?
答案1
我也遇到过这个问题。好像操作系统没有被识别
检查内容/etc/os-release
sudo nano /etc/os-release
对我来说,一个简单的办法就是将其编辑为
NAME="Ubuntu"
VERSION="16.04 (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
显然,由于 Zorin 基于 Ubuntu,我没有收到任何错误。