当前位置: 首页 > 知识库问答 >
问题:

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

吴涵育
2023-03-14

我正在努力修复安装postgres客户端时的一个错误。我在一个持续集成构建上安装这个,所以我需要它安装无误。问题是,客户机已经安装,如果我ssh进入服务器,我甚至可以运行psql命令,但我需要在没有触摸的情况下运行这些命令,这意味着安装必须在没有错误的情况下进行。我已经做了所有的google-foo,但我在Ubuntu论坛或这里看到的建议似乎都没有指向正确的方向。这都是Ubuntu14.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


    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

我在如何前进的问题上被难住了。

共有1个答案

戚阳
2023-03-14

我在我的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

我通过这个问题在这个提交中找到了这个解决方案

但是我也做了测试,像你说的那样压制了错误,它起作用了,但我不知道后果

sudo apt-get install postgresql-client || true
 类似资料:
  • 我已经安装了Java,并且正在尝试在我的Windows10上安装NetBeans 11.3,但是在我运行了EXE之后。安装程序,弹出一条错误消息: 线程主java.lang.NoClassDeffounderRror java/util/jar/pack200中发生意外异常

  • 我对Unix系统很陌生,我只是不明白为什么在Ubuntu 20.04焦点窝上安装R时会出现这个问题。 我使用以下过程安装了 R: 在我的 /etc/apt/sources.list文件中检查是否存在字符串debhttps://cloud.r-project.org/bin/linux/ubuntu焦距-起重机40/; 使用命令:sudo apt-get update,然后命令sudo apt-ge

  • 我试图在我的Windows 10上安装Apache Netbeans IDE,然后我遇到了这个问题“关键错误-线程主程序中发生了意外的异常。异常:java.lang.NoClassDefoundError:java/util/jarpack200” 单击“确定”按钮后,弹出另一个错误 “Apache Netbeans IDE安装程序-运行Java进程QT时出错:检测到未经测试的Windows 10

  • 我正在尝试使用蟒蛇文档在我的ubuntu 18.04上安装蟒蛇。它显示安装已完成。 但是当我尝试使用anaconda-navigator时,它显示“未找到命令”错误。 当我使用source ~/anaconda 3/bin/activate root转到base时,提示符以(base)开始,它将加载anaconda,并在终端中显示一些错误,如下所示 不知道怎么了。我曾经在windows中安装了an

  • 我使用下面的行安装PyAutoGui使用我的anaconda提示符: 安装似乎成功,但在google colab上导入库pyautogui时,出现以下错误: ()中的KeyError回溯(最近一次调用)---- 2帧 /usr/lib/python3.7/os.py(自,键)679除了KeyError: 680#提出与原始键值KeyError- KeyError:“显示” 我能做些什么来解决这个问

  • npm WARNajv-keywords@3.3.0需要ajv@^6.0.0的对等体,但没有安装。您必须自己安装对等依赖项。npm WARN可选跳过可选依赖项:fsevents@1.2.7(node_modules\fsecents): npm WARN not sup跳过可选依赖项:fsevents@1.2.7不支持的平台:想要{"os":"darwin","arch":"any"}(当前:{"