How to install postgresql on Ubuntu 16.04 VM despite "unmet dependencies" to set up Ruby on Rails project - postgresql

Ubuntu 16.04 on VirtualBox VM using Vagrant.
Windows 10 host.
Git Bash terminal.
Connected to vagrant up, vagrant ssh.
I have a fresh VM and have installed ruby and rails. I am trying to install postgresql to use for a Ruby on Rails project, but I get the following error:
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.
I've tried various things, and nothing seems to let me install postgres

I was facing same problem in my ubuntu 16.04
but i fixed that problem and it's very simple just follow these step and you will be able to install postgresql 10 in your system :
Add this to your 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
after that add these link to your pgdg.list file if it's not there you have to create and add link and save it.
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
then update your system
sudo apt-get update
sudo apt-get upgrade
and install that unmet dependencies :
apt-get install ssl-cert
that's it. now Install postgresql using these command
sudo apt-get install postgresql-10

#JosMac pointed out that I am running Ubuntu 14.04 instead of 16.04 as I had thought.
I was still running into similar errors, but I just ended up installing the rails-dev-box (https://github.com/rails/rails-dev-box) way which uses yakkety64, and seems to work.

Related

Dependency issues while installing postgresql-10-postgis-2.5 on Ubuntu Xenial (16.04)

There are some dependency problems while installing postgresql-10-postgis-2.5 on Ubuntu Xenial (16.04) after 2.5.3 version (which is published to PostgreSQL Apt Repo a couple days ago). The reason is that now postgresql-10-postgis-2.5 (version 2.5.3+dfsg-2.pgdg16.04+1) requires libgeos-c1v5 (>= 3.7.0) but the latest version of libgeos-c1v5 is 3.5.0-1ubuntu2 for Ubuntu Xenial (https://packages.ubuntu.com/search?keywords=libgeos-c1v5). I can upgrade to bionic (18.04 LTS) but the same problem exists since it brings version 3.6.2. 19.04 is not an option for me at the moment.
Is there a way to install libgeos-c1v5 >= 3.7.0 or install postgresql-10-postgis-2.5 2.5.2 on Ubuntu Xenial (16.04) using apt?
The steps to reproduce it locally on a Docker container:
docker run -it ubuntu:xenial /bin/bash
apt update
apt install -y curl
echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" > /etc/apt/sources.list.d/pgdg.list
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt update
apt install postgresql-10-postgis-2.5 postgresql-10-postgis-2.5-scripts
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-10-postgis-2.5 : Depends: libgeos-c1v5 (>= 3.7.0) but 3.5.0-1ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.
We faced similar issue with Ubuntu 18 when trying to install postgresql-9.6-postgis-2.5. We had to install the experimental version 3.7 to get it working.
libgeos-3.7.0_3.7.0-1_bionic0_amd64
libgeos-c1v5_3.7.0-1_bionic0_amd64.deb
https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-experimental/+build/15675841
However, I'm not sure if you can get this for xenial.
Hope this helps, thanks.
Update:
We now have the updated version of libgeos in bionic repo, hope the updated version was released for xenial as well, thanks.
apt search libgeos-3.7
Sorting... Done
Full Text Search... Done
libgeos-3.7.1/bionic-pgdg 3.7.1-1~pgdg18.04+1 amd64
Geometry engine for Geographic Information Systems - C++ Library
libgeos-3.7.1-dbgsym/bionic-pgdg 3.7.1-1~pgdg18.04+1 amd64
debug symbols for libgeos-3.7.1

Problem Installing mysql-workbench on ubuntu 19.04

It says it is not available in any source. Tried using the debian provided by oracle. It says libssl versions are incompatible. Any help in this regard.
Now, mysql workbench is available for ubuntu 19.04.
You can manually install after downloading the file.
Step 1:
Direct download link-
https://dev.mysql.com/downloads/file/?id=488567
OR
Visit here select your OS then download as per OS version
https://dev.mysql.com/downloads/workbench/
Step 2:
sudo apt install file_path_of_downloaded_workbench
Finish!!
I solved this problem by installing the libzip package, directly from the deb package. I found at https://ubuntu.pkgs.org/18.10/ubuntu-universe-amd64/libzip4_1.1.2-1.1_amd64.deb.html. Download and install libzip4, then install mysql-workbench from the apt or deb package, whichever you prefer.
on Ubuntu 19
1)I had to, preceding it on Ubuntu 19, also install manually a library libzip https://ubuntu.pkgs.org/18.10/ubuntu-universe-amd64/libzip4_1.1.2-1.1_amd64.deb.html
2) then manually selecting on a download page deb package for mysql workbench https://dev.mysql.com/downloads/workbench/
then install deb packages via a standard apt installer in a Downloads dir
sudo apt install ./libzip4_1.1.2-1.1_amd64.deb
and downloaded workbench deb package
sudo apt install ./mysql-workbench-community_8.0.16-1ubuntu18.04_amd64.deb
You can download the source code from https://dev.mysql.com/downloads/workbench/, compile it and install it. I did it that way and it works perfectly for me. I had to install several package dependencies and review some basic compiler details, but in the end the result was successful. Follow the INSTALL file instructions and consider removing the Werror option from the CMakeLists.txt. Download antlr-4.7.1-complete.jar from web, and then run:
cmake -Wno-dev -DWITH_ANTLR_JAR='path_to_antlr-4.7.1-complete.jar' -Wno-error
make
sudo make install
screenshoot 1
screenshoot 2
UBUNTU 19.04 disco dingo -> mysql-workbench install steps:
add mysql complete source list from: https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb
install libs: sudo apt-get install libgtkmm-3.0 libpcre++*
add debian source list on "/etc/apt/sources.list" :
deb http://deb.debian.org/debian stretch main contrib non-free
deb-src http://deb.debian.org/debian stretch main
deb http://deb.debian.org/debian stretch-updates main contrib non-free
deb-src http://deb.debian.org/debian stretch-updates main
deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main
sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade -y
sudo apt-get install mysql-utilities mysql-common mysql-community*
sudo apt-get install mysql-workbench (finish!!)
works here!
Latest version of workbench does not support Ubuntu 19.04 and version for 19.10 will not work.
You have to download specific workbench version supported by 19.04 from the archive.
Visit https://downloads.mysql.com/archives/workbench/
Select product version 8.0.17,
download and install package mysql-workbench-community_8.0.17-1ubuntu19.04_amd64.deb
check out gdebi
gdebi is a tool resolving & installing dependencies, for more info http://manpages.ubuntu.com/manpages/bionic/man1/gdebi.1.html
1) Install libzip4
curl -OL http://launchpadlibrarian.net/260671111/libzip4_1.1.2-1.1_amd64.deb
sudo dpkg -i libzip4_1.1.2-1.1_amd64.deb
2) Then install MySQL workbench on Ubuntu 19.04 by running the commands:
curl -OL https://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-workbench-
community_8.0.16-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-workbench-community_8.0.16-1ubuntu18.04_amd64.deb
3) Install missing dependencies (libatkmm-1.6-1v5, libglibmm-2.4-1v5, libgtk2.0-0, libgtkmm-3.0-1v5, libpcrecpp0v5, libpython2.7, libsigc++-2.0-0v5, libtinfo5) by this command.
sudo apt --fix-broken install
Hope this helps.
Download the .deb file from here
Install it using command
dpkg -i *.deb。
Now MYSQL-WORKBENCH for Ubuntu-19.04(Disco) is available.
To install mysql workbench form command line you need add dependencies manually.
Edit your /etc/apt/sources.list and Append following lines:
deb http://security.ubuntu.com/ubuntu cosmic-security main
deb http://cz.archive.ubuntu.com/ubuntu cosmic main universe
sudo apt-get update
Download mysql-workbench from 'Mysql Workbench-19.04 for Ubuntu' and install by giving execute permission to mysql-workbench-community_8.0.17-1ubuntu19.04_amd64.deb file.
Now it should work. :)

Failed to install postgres 9.3 with postgis on Ubuntu 17.10

I am following this guide to install postgres 9.3 on ubuntu 17.10, but after line of code where I actually try to install (sudo apt-get install postgresql-9.3 pgadmin3) I get the following output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package postgresql-9.3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'postgresql-9.3' has no installation candidate
Also, I need to install postgis, and when I type
sudo apt-get install postgresql-9.3-postgis-2.1
I got the same error. Can anyone help me?
Looking at the postgres wiki I was able to install postgresql-9.3 using their Quickstart steps on ubuntu LTS 18; same should be true for 17 if you want. fwiw I tend to lay off the odd number installs but I also don't have to worry about that extension you mentioned.

sudo apt-get install scala not found on ubuntu

I am completely stumped by why this simple sudo install is not working.
I am running ubuntu 16.04 on virtualbox on windows, and when i run the command
sudo apt-get install scala
command, I get the E:Unable to locate package scala error.
I have sudo apt-get update beforehand, and sudo apt-get install default-jdk worked
perfectly fine.
Does anyone have any idea why my ubuntu can't find the scala package?
There is a way to apt-get Scala, but you have to add the bintray repository to your sources file.
deb https://dl.bintray.com/sbt/debian / # access to Scala deb packages
I recommend against installing Scala with apt install scala, as the versions can be out of date (on Ubuntu 18.04 I got v2.11, while v2.13 is available). Instead go to the Scala webpage and install from there. If you want to be able to run
$ scala
and get the REPL, one option is to look for the .deb package on the install page and use that

I have to change my databasefrom MySQL to postgreSQL in django, but its not working

I have to change my databasefrom MySQL to postgreSQL in django. But postgreSQL is not installing .
Error while installing postgreSQL using commands-
sudo apt-get update && sudo apt-get upgrade
sudo apt-get purge postgresql*
sudo apt-get -f install
sudo apt-get install postgresql
At terminal-
(jango)dc#dc-comp-4:~/website$ sudo apt-get install postgresql
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.3 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
but its not working.how can i do this.and what changes i have to made. Plz help