gpt4 book ai didi

postgresql - 如何修复 postgres 安装 ubuntu 时的错误

转载 作者:行者123 更新时间:2023-11-29 11:31:17 26 4
gpt4 key购买 nike

我正在努力解决安装 postgres 客户端时出现的错误。我在持续集成构建上安装它,所以我需要它安装时没有错误。问题是,客户端已安装,如果我 ssh 进入服务器,我什至可以运行 psql 命令,但我需要它在不接触的情况下运行,这意味着安装必须没有错误。我已经完成了所有 google-foo,但我在 Ubuntu 论坛或此处看到的所有建议似乎都没有指向正确的方向。这一切都在 ubuntu 14.04 上。

或者,只要客户端可用,也许我可以将错误静音。

以下是我遇到的错误:

sudo apt-get install postgresql-client    Reading package lists... Done    Building dependency tree           Reading state information... Done    The following additional packages will be installed:      libpq5 postgresql-client-9.6 postgresql-client-common    Suggested packages:      postgresql-9.6 postgresql-doc-9.6    The following NEW packages will be installed:      libpq5 postgresql-client postgresql-client-9.6 postgresql-client-common    0 upgraded, 4 newly installed, 0 to remove and 7 not upgraded.    Need to get 1494 kB of archives.    After this operation, 6121 kB of additional disk space will be used.    Get:1 http://deb.debian.org/debian stretch/main amd64 libpq5 amd64 9.6.7-0+deb9u1 [132 kB]    Get:2 http://deb.debian.org/debian stretch/main amd64 postgresql-client-common all 181+deb9u1 [79.0 kB]    Get:3 http://deb.debian.org/debian stretch/main amd64 postgresql-client-9.6 amd64 9.6.7-0+deb9u1 [1228 kB]    Get:4 http://deb.debian.org/debian stretch/main amd64 postgresql-client all 9.6+181+deb9u1 [55.7 kB]    Fetched 1494 kB in 0s (55.5 MB/s)    debconf: delaying package configuration, since apt-utils is not installed    Selecting previously unselected package libpq5:amd64.    (Reading database ... 31433 files and directories currently installed.)    Preparing to unpack .../libpq5_9.6.7-0+deb9u1_amd64.deb ...    Unpacking libpq5:amd64 (9.6.7-0+deb9u1) ...    Selecting previously unselected package postgresql-client-common.    Preparing to unpack .../postgresql-client-common_181+deb9u1_all.deb ...    Unpacking postgresql-client-common (181+deb9u1) ...    Selecting previously unselected package postgresql-client-9.6.    Preparing to unpack .../postgresql-client-9.6_9.6.7-0+deb9u1_amd64.deb ...    Unpacking postgresql-client-9.6 (9.6.7-0+deb9u1) ...    Selecting previously unselected package postgresql-client.    Preparing to unpack .../postgresql-client_9.6+181+deb9u1_all.deb ...    Unpacking postgresql-client (9.6+181+deb9u1) ...    Setting up libpq5:amd64 (9.6.7-0+deb9u1) ...    Processing triggers for libc-bin (2.24-11+deb9u3) ...    Setting up postgresql-client-common (181+deb9u1) ...    Setting up postgresql-client-9.6 (9.6.7-0+deb9u1) ...    update-alternatives: using /usr/share/postgresql/9.6/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode    update-alternatives: error: error creating symbolic link '/usr/share/man/man7/ABORT.7.gz.dpkg-tmp': No such file or directory    dpkg: error processing package postgresql-client-9.6 (--configure):     subprocess installed post-installation script returned error exit status 2    dpkg: dependency problems prevent configuration of postgresql-client:     postgresql-client depends on postgresql-client-9.6; however:      Package postgresql-client-9.6 is not configured yet.    dpkg: error processing package postgresql-client (--configure):     dependency problems - leaving unconfigured    Errors were encountered while processing:     postgresql-client-9.6     postgresql-client    E: Sub-process /usr/bin/dpkg returned an error code (1)    Exited with code 100

我尝试了以下方法来修复:

    sudo apt-get purge postgr*    sudo apt-get autoremove    sudo apt-get install synaptic    sudo apt-get update

来自:https://ubuntuforums.org/showthread.php?t=2277582

    which psql    /usr/bin/psql

    more /etc/apt/sources.list    deb http://deb.debian.org/debian stretch main    deb http://deb.debian.org/debian stretch-updates main    deb http://security.debian.org/debian-security stretch/updates main

我对如何前进感到困惑。

最佳答案

我的 CI 构建遇到了同样的问题,我找到了创建像@A 这样的文件夹的解决方法。谢尔鲍姆提到。

sudo mkdir -p /usr/share/man/man1
sudo mkdir -p /usr/share/man/man7
sudo apt-get update
sudo apt-get install postgresql-client

我通过这个commit在这个issue中找到了这个解决方案

但是我也像你说的那样做了测试来消除错误并且它有效,但我不知道后果

sudo apt-get install postgresql-client || true

我在这个circleci article中发现了类似的东西

关于postgresql - 如何修复 postgres 安装 ubuntu 时的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51033689/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com