gpt4 book ai didi

postgresql - 尽管有 "unmet dependencies",但如何在 Ubuntu 16.04 VM 上安装 postgresql 以设置 Ruby on Rails 项目

转载 作者:行者123 更新时间:2023-11-29 14:38:10 25 4
gpt4 key购买 nike

VirtualBox VM 上的 Ubuntu 16.04 使用 Vagrant。Windows 10 主机。Git Bash 终端。

连接到 vagrant up,vagrant ssh。

我有一个全新的 VM,并安装了 ruby​​ 和 rails。我正在尝试安装 postgresql 以用于 Ruby on Rails 项目,但出现以下错误:

vagrant@vagrant-ubuntu-trusty-64:~$ sudo apt-get install postgresql postgresql-contrib

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 : Depends: postgresql-9.6 but it is not going to be installed postgresql-contrib : Depends: postgresql-contrib-9.6 but it is not going to be installed

E: Unable to correct problems, you have held broken packages.

我试过各种东西,似乎没有什么能让我安装 postgres

最佳答案

我在我的 ubuntu 16.04 中遇到了同样的问题

但我解决了这个问题,只需按照以下步骤操作即可非常简单,您将能够在您的系统中安装 postgresql 10:

将此添加到您的 sources.list 中:

sudo vim /etc/apt/sources.list
deb http://ftp.de.debian.org/debian/ wheezy main non-free contrib
deb-src http://ftp.de.debian.org/debian/ wheezy main non-free contrib

之后,将这些链接添加到您的 pgdg.list 文件中(如果不存在,您必须创建并添加链接并保存)。

sudo vim /etc/apt/sources.list.d/pgdg.list
deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main

然后更新你的系统

sudo apt-get update
sudo apt-get upgrade

并安装未满足的依赖项:

apt-get install ssl-cert

就是这样。现在使用这些命令安装 postgresql

sudo apt-get install postgresql-10

关于postgresql - 尽管有 "unmet dependencies",但如何在 Ubuntu 16.04 VM 上安装 postgresql 以设置 Ruby on Rails 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41123297/

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