How to upgrade postregsql-client on ubuntu? - postgresql

I am trying to use pg_dump that comes from postgresql.
Problem is I have the error pg_dump: error: server version: 13.9; pg_dump version: 12.12 (Ubuntu 12.12-0ubuntu0.20.04.1)
I tried to upgrade it with sudo apt-get install -y postgresql-client-13 but I have errors like E: Unable to locate package postgresql-client-13
I tried sudo apt update && sudo apt upgrade -y but nothing changed.
What can I do to upgrade the version in order to have 13.9 version (same version than server version) ?

Create the file repository configuration:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
Import the repository signing key:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
Update the package lists:
apt update and apt install postgresql-client-13

Related

How can I install Unity Hub on Ubuntu 22.04?

I have some troubles installing Unity Hub on my Ubuntu 22.04.
I've followed the instruction from official Unity site, but the hub seem not working well.
Only black screen is shown and nothing else.
I am very lost with it! :(
The following codes has been runned:
sudo sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
wget -qO - https://hub.unity3d.com/linux/keys/public | sudo apt-key add -
sudo apt update
sudo apt-get install unityhub
Thank you for your reply!
To resolve this issue you can install libssl1.1
I was also facing the same issue so I made an script that make it easy to install Unity hub on Ubuntu latest versions
#!/bin/bash
#Lib issue Ubuntu
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
chmod +x libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
sudo dpkg -i libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list
sudo apt-get update
sudo apt-get install libssl1.1
#unityhub
sudo sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
wget -qO - https://hub.unity3d.com/linux/keys/public | sudo apt-key add -
sudo apt update
sudo apt-get install unityhub
HOW TO USE BASH
Make a file with install.sh on Desktop.
Paste this code on install.sh file.
Open Terminal in "Desktop" location.
type chmod +x install.sh then press Enter.
type ./install.sh and press Enter.
After all the installing, Restart PC and then run UnityHub.
Unity Editor fails to launch and complains about "no usable version of libssl was found"
Ubuntu 22.04 now ships with libssl3 by default and does not include libssl1.1. Unity currently uses .NET5 which requires libssl1.1. To
work around this issue you can install libssl1.1 from an older Ubuntu
release
https://packages.ubuntu.com/bionic/amd64/libssl1.1/download
In a terminal:
echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list
sudo apt-get update
sudo apt-get install libssl1.1

postgresql-13-postgis-3 : Depends: libgdal20 (>= 2.0.1) but it is not going to be installed

I am trying to install the postgresql-13-postgis-3 package using following method on ubuntu 18.04 version. I have tried following method,
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
sudo wget --no-check-certificate --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update -y; sudo apt install -y postgresql-13 postgresql-13-postgis-3 postgresql-13-postgis-3-scripts postgresql-13 postgresql-client-13
But I am getting following error,
postgresql-client-13 is already the newest version (13.5-1.pgdg18.04+1).
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-13-postgis-3 : Depends: libgdal20 (>= 2.0.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Can anyone suggest to me, how to install the postGIS in ubuntu 18.04? Any help will be highly appreciated.
The missing dependency is available in universe:
sudo add-apt-repository universe
sudo apt update
sudo apt install libgdal20

PostgreSQL 12 installion problem with Ubuntu 18.04 docker image

I was trying to install Postgresql-12 on an Ubuntu container, but it is giving the following error.
Reading state information...
E: Unable to locate package postgresql-12
E: Unable to locate package postgresql-client-12
It looks like the Ubuntu 18 container doesn't support PostgreSQL version 12.
Is there any way I can install postgresl version 12 on Ubuntu 18.04 container?
Any help is appreaciated. The docker file code snippet is given below.
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y gnupg dirmngr
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common postgresql-12 postgresql-client-12
It seems like you are using the wrong APT package repository. Replace
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
with
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" > /etc/apt/sources.list.d/pgdg.list
and try again. precise is the codename for Ubuntu 12.04 (which has reached its end of life years ago), but your Dockerfile uses the newer Ubuntu 18.04. The codename for Ubuntu 18.04 is bionic.
Edit:
Since I'm having problems connecting to the key server given in the Dockerfile I took a look at the PostgreSQL website and aquired the key via wget as shown there. The Dockerfile does now look like this:
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y gnupg dirmngr wget
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" > /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common postgresql-12 postgresql-client-12
Notable changes are the installation of wget (2nd line) and using it to get the key (4th line).

Version '100.2.1' for 'mongodb-org-tools' was not found

Background:
Quoting from the MongoDB Database Tools docs:
Starting with MongoDB 4.4, mongodump is now released separately from
the MongoDB Server and uses its own versioning, with an initial
version of 100.0.0. Previously, mongodump was released alongside the
MongoDB Server and used matching versioning.
Problem:
I'm trying to install the MongoDB Database Tools using Docker/Dockerfile:
...
RUN apt-get update
RUN apt-get install -y gnupg
RUN apt-get install -y wget
RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add -
RUN echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list
RUN apt-get update
RUN apt-get install -y mongodb-org-tools=100.2.1
RUN echo "mongodb-org-tools hold" | dpkg --set-selections
...
But this line RUN apt-get install -y mongodb-org-tools=100.2.1 is giving me an error:
Version '100.2.1' for 'mongodb-org-tools' was not found
If I remove =100.2.1 the tools are installed.
But I need to specify this specific version (100.2.1) of the MongoDB Database Tools.
Question:
Is this possible? And how?
Seems to work by using:
RUN apt-get install -y mongodb-database-tools=100.2.1
Got the idea from this page:
https://docs.mongodb.com/database-tools/installation/installation-linux/
sudo dpkg -l mongodb-database-tools
sudo apt install ./mongodb-database-tools-*-100.2.1.deb
Can someone from MongoDB please confirm this is the proper way?

Installing MongoDb on Lubuntu

I am trying to install MongoDD on Lubuntu following the official instructions for Ubuntu.
But when I try to run this line:
sudo apt-get install -y mongodb-org
I get this error:
jon#jon-HP-ENVY-17-Notebook-PC:~$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mongodb-org
jon#jon-HP-ENVY-17-Notebook-PC:~$
What am I doing wrong?
Try "sudo apt-get update" before "sudo apt-get install -y mongodb-org"...
Or try tutorial for Lubuntu, not Ubuntu, like this: http://tutorialforlinux.com/2014/03/12/how-to-install-latest-mongodb-on-lubuntu-12-04-precise-lts-32-64bit-linux-easy-guide/
May be it's beacause of the old MongoDb's version. Try with the latest MondoDb repository url to generate the file.
Before trying sudo apt-get install -y mongodb-org , execute the following commands in your terminal
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
# following is the repository url for Latest MongoDb version 3.0
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org