Alpine image on Docker, apt-get upgrade libpq-dev - docker-compose

I'm trying to upgrade libpqto latest version, because I'm getting this error:
SCRAM authentication requires libpq version 10 or above
In docker compose I tried:
docker exec -it vu_app_1 apt-get update
Then:
docker exec -it vu_app_1 apt-get install libpq-dev
But I got:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpq-dev is already the newest version (9.6.23-0+deb9u1).
0 upgraded, 0 newly installed, 0 to remove and 59 not upgraded.
So how should I upgrade or install to a version above 10 that libpq?

Related

postgresql-client-13 : Depends: libpq5 (>= 13~beta2) but 12.3-1.pgdg18.04+1 is to be installed

I want to try new PostgreSQL and follow this instruction. But installation fails:
$ sudo apt install postgresql-client-13
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-client-13 : Depends: libpq5 (>= 13~beta2) but 12.3-1.pgdg18.04+1 is to be installed
E: Unable to correct problems, you have held broken packages.
I also tried this instruction to resolve unmet dependencies
What did I wrong and how to install psql 13?
UPD
Content of my sources.list.d:
kes#kes-X751SA /etc/apt/sources.list.d $ cat pgdg.list
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
kes#kes-X751SA /etc/apt/sources.list.d $ cat pgdg-testing.list
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg-testing main 13
Also:
$ sudo apt-cache policy postgresql-13
postgresql-13:
Installed: (none)
Candidate: 13~beta2-1.pgdg18.04+1
Version table:
13~beta2-1.pgdg18.04+1 100
100 http://apt.postgresql.org/pub/repos/apt bionic-pgdg-testing/13 amd64 Packages
Had the same problem.
in /etc/apt/sources.list.d/pgdg.list where you have
deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main
change it to
deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main 13
then run
sudo apt update
and then you can do
sudo apt install postgresql-13 postgresql-client-13
that worked on my machine.
Just FYI:
WARNING: The data format may change between beta releases. Be prepared
to pg_dump the database contents before you upgrade the package to a
newer beta or to a final release. Check the release notes before
upgrading.
try aptitude instead of apt-get
sudo apt-get install aptitude
sudo aptitude install <package-name>
https://askubuntu.com/a/1056378/1087086
Finally at my docker container I do next commands:
RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum -y install llvm5.0-devel
RUN yum -y install centos-release-scl-rh
RUN yum -y install llvm-toolset-7-clang
#RUN rpm -Uvh https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm --replacepkgs
#RUN yum-config-manager --enable pgdg13-updates-testing
RUN yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
RUN yum -y install postgresql13 postgresql13-devel
Commented out lines were for case before 13.1 was released

Not able to run apt-get command for docker image creation

I have centos Machine as a docker host and i was trying to create a container with UBUNTU
my docker compose file in docker host is as following
FROM ubuntu:latest
RUN apt-get install -y git && \
apt-get clean
When i was trying to build the image i am getting the following error
This is the section for building the image
[root#testcent image_creation]# docker build -t ubuntu_git/venkat_ubu_git .
Sending build context to Docker daemon 2.048 kB
Step 1/2 : FROM ubuntu:latest
---> 3556258649b2
Step 2/2 : RUN apt-get install -y git && apt-get clean
---> Running in 6b12dfaed5b8
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package git
The command '/bin/sh -c apt-get install -y git && apt-get clean' returned a non-zero code: 100
[root#testcent image_creation]# </i>
$ Can any one please help me
Normally docker base images won't support directly installing packages without update command. check and try out with the below if it works for you.
RUN apt-get update && apt-get install -y git && apt-get clean

Docker base image for perl; E: Package 'libssl1.0.0' has no installation candidate

I have a dockerfile that uses perl:5.22 as the base image
When I do:
#Dockerfile:
From perl:5.22
RUN apt-get update && apt-get install libssl1.0.0 libssl-dev
I get this error:
When I do: sudo apt-cache policy libssl1.0.0 in the dockerfile, like this:
#Dockerfile:
From perl:5.22
RUN apt-cache policy libssl1.0.0 && \
apt-cache policy libssl-dev
RUN apt-get update && apt-get install libssl1.0.0
I get:
Step 2/3 : RUN apt-cache policy libssl1.0.0 && apt-cache policy
libssl-dev ---> Running in a60f0185ef5a libssl1.0.0:
Installed: (none)
Candidate: (none)
Version table:
libssl-dev:
Installed: 1.1.0f-3+deb9u2
Candidate: 1.1.0f-3+deb9u2
Version table:
*** 1.1.0f-3+deb9u2 500
500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
100 /var/lib/dpkg/status
1.1.0f-3+deb9u1 500
500 http://deb.debian.org/debian stretch/main amd64 Packages
There's no available candidate to install libssl1.0.0; I get:
E: Package 'libssl1.0.0' has no installation candidate
However there's a candidate to install the libssl-dev package, but none for the libssl1.0.0
I'm new with docker; does the perl 5.22 base image already come with libssl1.0.0 already preinstalled in the image? I couldn't see it in their base image and secondly, *how do I install this package (libssl1.0.0) in my dockerfile if there's no candidate available to install it*?
Lastly, since the base image already comes preinstalled with the libssl-dev could I use this package, libssl-dev, instead of the libssl1.0.0, is there a difference between libssl-dev and libssl1.0.0 ?
Actually, it is already installed by default.
$ docker run -it perl:5.22 /bin/bash
root#e5315bc25223:~# apt search libssl
Sorting... Done
Full Text Search... Done
libssl-dev/now 1.1.0f-3+deb9u2 amd64 [installed,local]
Secure Sockets Layer toolkit - development files
libssl1.0.0/now 1.0.1t-1+deb8u8 amd64 [installed,local]
Secure Sockets Layer toolkit - shared libraries
The perl image is based on debian:stretch, which no longer supports libssl1.0.0. You can pull the package from jessie (https://packages.debian.org/jessie/libssl1.0.0) and install with dpkg.
Sample Dockerfile addition:
RUN wget "http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u8_amd64.deb" \
&& dpkg -i libssl1.0.0_1.0.1t-1+deb8u8_amd64.deb
Regarding the version, apt show libssl-dev gives:
Package: libssl-dev
Version: 1.1.0f-3+deb9u2
As far as if you can use 1.1.0 instead of 1.0.0, that really depends on your software's requirements.

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

Cannot reinstall postgresql - apt-get dependency errors

I previously could install postgresql but then I uninstalled and installed it again, now if I try:
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
This will appear:
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.4 but it is not going to be installed
postgresql-contrib : Depends: postgresql-contrib-9.4 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
What's wrong here?
I want to remodel starting from scratch. So what I did before:
sudo apt-get --purge remove postgresql
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
You may have a broken database. Try: sudo apt-get --fix-broken
Alternatively, it may be that there are files left behind that are conflicting with version 9.4 of postgresql. If you can, install the version of postgresql you had before, then, using dpkg-query -L <package_name>, you can see what files were installed and what you may have left behind.
run the following.
sudo apt install aptitude && sudo aptitude install postgresql postgresql-contrib