reinstall postgres on Amazon EC2 ubuntu server - postgresql

While trying to install postgres on ubuntu server, I messed up and now I am getting the following error. How to fix the missing dependencies and move forward? My final aim is to install postgis.
ubuntu#ip-172-31-17-218:~$ 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-10 but it is not going to be installed
postgresql-contrib : Depends: postgresql-contrib-10
E: Unable to correct problems, you have held broken packages.
ubuntu#ip-172-31-17-218:~$

I followed the steps mentioned in the blog: http://www.gis-blog.com/how-to-install-postgis-2-3-on-ubuntu-16-04-lts and all the issue were solved.

Related

Ubuntu 20.04.5 LTS unable to install postgresql(-client)-13 or above (WSL)

sry but I am not an expert on Linux/Ubuntu, I just use WSL and zsh to fiddle around with it a bit and now for a dev project I need postgre-client-13, 12 seems to be included in Ubuntu focal, but I can not use that, as I need to make DB backups with pg_dump and that gives me a version error then.
I tried literally every SF and Blog Post I could find, but it always came done to versions of this in the end:
sudo apt-get install postgresql-client-15
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-15 : Depends: libpq5 (>= 15.1) but it is not going to be installed
Depends: libc6 (>= 2.34) but 2.31-0ubuntu9.9 is to be installed
Depends: libssl3 (>= 3.0.0~~alpha1) but it is not installable
E: Unable to correct problems, you have held broken packages.
Currently i deinstalled psql with apt-get purge, but now I have the problem that I can not even install version 12 of it anymore, guess with copying some scripts I broke my global Ubuntu config, now even just calling
sudo apt-get install postgresql-client
leads just to:
The following packages have unmet dependencies:
postgresql-client : Depends: postgresql-client-15 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I tried reading into the problem of held packages, but that is still a bit over my head.
Can someone point me to a good ressource or the right direction to fix my problem? I guess one could be restoring/updating the list of package versions an Ubunut version includes/supports, at least I read something about this?
Thanks very much in advance

downloading mongoDB with error "E: Unable to correct problems, you have held broken packages."

I'm downloading mongoDB on Linux Ubuntu Version 22.04.1 LTS, facing download error
I tried 3 solution from stack overflow discussion
E: Unable to correct problems, you have held broken packages.
(base) joy#joy-System-Product-Name:~$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree... Done
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:
mongodb-org-mongos : Depends: libssl1.1 (>= 1.1.1) but it is not installable
mongodb-org-server : Depends: libssl1.1 (>= 1.1.1) but it is not installable
E: Unable to correct problems, you have held broken packages.
I'm not sure what solution can perfectly solve my problem, that I need a hand here
I post on ask Ubuntu too the sister site, there I post more details as possible cause when I update here,system keep knowledge me posting format incorrect.
https://askubuntu.com/questions/1434992/downloading-mongodb-with-error-e-unable-to-correct-problems-you-have-held-bro
Stennie from MongoDB Community Team said that:
MongoDB build team is aware and will set up appropriate packaging & testing infrastructure to validate new packages.
Run your MongoDB deployment on separate hosts with supported O/S versions (eg 20.04 LTS)
Run MongoDB in a container/VM with a supported O/S version
Use a hosted version of MongoDB (eg MongoDB Atlas) so you have fewer direct dependencies on O/S updates
In my opinion MongoDB may not be in Ubuntu 22.04 (Jammy) yet because they didn't explain the installation process on the official web site.

Unable to install Conduktor - Depends: libglx0 but it is not installable

While installation I am having package conflicts. This is the response I am receiving.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'conduktor' instead of './Conduktor-2.2.5.deb'
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:
conduktor : Depends: libglx0 but it is not installable
E: Unable to correct problems, you have held broken packages.
For anyone who is having problens with Conduktor on Ubuntu 20:
Ubuntu 20 updated from libffi6 (required by Conduktor) to libffi7, so you'll end up with this error:
$ sudo apt install ./Conduktor-2.7.5.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'conduktor' instead of './Conduktor-2.7.5.deb'
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:
conduktor : Depends: libffi6 but it is not installable
E: Unable to correct problems, you have held broken packages.
You can fix it this way:
download libffi6 here http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
instal it: $ sudo apt install ./libffi6_3.2.1-8_amd64.deb
now, with success, install Conduktor: $ sudo apt install ./Conduktor-2.7.5.deb
It seems Conduktor does not support Ubuntu 16.04, the libglx0 library is only available starting from bionic (18.04 LTS): https://packages.ubuntu.com/search?lang=en&keywords=libglx0&searchon=names
This command helped me:
sudo apt --fix-broken install

Mongo enterprise installation Error in Ubuntu 20.04

I have updated recently to Ubuntu 20.04 and facing problems while installing MongoDb enterprise.
digvj#digvj:~$ sudo apt-get install -y mongodb-enterprise
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:
mongodb-enterprise : Depends: mongodb-enterprise-server but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Also on running the command where i have specified every package of mongo it is showing this error:
digvj#digvj:~$ sudo apt-get install -y mongodb-enterprise=4.2.6 mongodb-enterprise-server=4.2.6 mongodb-enterprise-shell=4.2.6 mongodb-enterprise-mongos=4.2.6 mongodb-enterprise-tools=4.2.6
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:
mongodb-enterprise-server : Depends: libsensors4 (>= 1:3.0.0) but it is not installable
Depends: libsnmp30 (>= 5.7.3+dfsg-1.8ubuntu3.3~dfsg) but it is not installable
E: Unable to correct problems, you have held broken packages.
How can I resolve this?
MongoDB provides binary packages for some operating systems. Ubuntu 20.04 is not an operating system that the packages are available for.
You may be able to get MongoDB running on 20.04 by downloading and installing the packages it wants manually (for example, libsnmp30 and libsensors4).
If there has been, for example, a C library upgrade between 18.04 and 20.04, the 18.04 packages may not be usable on a 20.04 system, and this won't work.
If the question is for a production environment and you are using the enterprise edition of MongoDB you should probably stick with the supported operating systems like Ubuntu 18.04. If this is for a development environment, you could run MongoDB in Ubuntu 18.04 in Docker.
I have added the issue in MongoDb Zira issues and got the solution over there.
Here is the link to that:
https://jira.mongodb.org/browse/SERVER-48316

Cannot install latest Mongdb

My production Mongo database was hacked and all databases deleted. I now want to upgrade to the latest version of Mongo but am having extraordinary problems. Im on Linux Mint 17.1. Im following instructions here:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
When I run:
sudo apt-get install -y mongodb-org
I end up with error:
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:
mongodb-org : Depends: mongodb-org-shell but it is not going to be installed
Depends: mongodb-org-server but it is not going to be installed
Depends: mongodb-org-mongos but it is not going to be installed
Depends: mongodb-org-tools but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
What can I try next? As I said, my app is down since the hack and now I cannot even install Mongo...
Try sudo apt-get install -f to fix packages.
If that doesn't work, figure out if you need all 4 packages, mongodb-org-server might be the only one you really need.
In this case you can try running the following command with a specific version (3.0.15 in my case):
sudo apt-get install -y --force-yes mongodb-org=3.0.15 mongodb-org-server=3.0.15 mongodb-org-shell=3.0.15 mongodb-org-mongos=3.0.15 mongodb-org-tools=3.0.15