Errors trying to install PostgreSQL on Debian 11 - postgresql

Fail to install PostgreSQL on Debian 11
First time to install package: sudo apt install postgresql
...
Unpacking postgresql (13+225) ...
Setting up postgresql-client-common (225) ...
Setting up libpq5:amd64 (13.5-0+deb11u1) ...
Setting up postgresql-client-13 (13.5-0+deb11u1) ...
double free or corruption (!prev)
dpkg: error processing package postgresql-client-13 (--configure):
installed postgresql-client-13 package post-installation script subprocess was killed by signal (Aborted)
Setting up libz3-4:amd64 (4.8.10-1) ...
Setting up libllvm11:amd64 (1:11.0.1-2) ...
Setting up postgresql-common (225) ...
Adding user postgres to group ssl-cert
Creating config file /etc/postgresql-common/createcluster.conf with new version
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql.service → /lib/systemd/system/postgresql.service.
dpkg: dependency problems prevent configuration of postgresql-13:
postgresql-13 depends on postgresql-client-13; however:
Package postgresql-client-13 is not configured yet.
dpkg: error processing package postgresql-13 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql:
postgresql depends on postgresql-13; however:
Package postgresql-13 is not configured yet.
dpkg: error processing package postgresql (--configure):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u2) ...
Errors were encountered while processing:
postgresql-client-13
postgresql-13
postgresql
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
Look that package postgresql-client-13 appears with "iF" state (configuration failed) and other failed packages with "iU" state
dpkg -l | grep postgres
iU postgresql 13+225 all object-relational SQL database (supported version)
iU postgresql-13 13.5-0+deb11u1 amd64 The World's Most Advanced Open Source Relational Database
iF postgresql-client-13 13.5-0+deb11u1 amd64 front-end programs for PostgreSQL 13
ii postgresql-client-common 225 all manager for multiple PostgreSQL client versions
ii postgresql-common 225 all PostgreSQL database-cluster manager
Second letter -> current package state:
i ... installed
U ... unpacked
F ... half-configured (configuration failed for some reason)
Get packages states table at:
https://askubuntu.com/questions/18804/what-do-the-various-dpkg-flags-like-ii-rc-mean
I removed all PostgreSQL packages and all files with: sudo apt purge postgresql
After that I tried again to install postgresql-client-13, which returned the error above. sudo apt install postgresql-client-13
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libllvm11 libz3-4
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
postgresql-client-common
Suggested packages:
postgresql-13 postgresql-doc-13
The following NEW packages will be installed:
postgresql-client-13 postgresql-client-common
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,603 kB of archives.
After this operation, 6,789 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package postgresql-client-common.
(Reading database ... 39655 files and directories currently installed.)
Preparing to unpack .../postgresql-client-common_225_all.deb ...
Unpacking postgresql-client-common (225) ...
Selecting previously unselected package postgresql-client-13.
Preparing to unpack .../postgresql-client-13_13.5-0+deb11u1_amd64.deb ...
Unpacking postgresql-client-13 (13.5-0+deb11u1) ...
Setting up postgresql-client-common (225) ...
Setting up postgresql-client-13 (13.5-0+deb11u1) ...
double free or corruption (!prev)
dpkg: error processing package postgresql-client-13 (--configure):
installed postgresql-client-13 package post-installation script subprocess was killed by signal (Aborted)
Processing triggers for man-db (2.9.4-2) ...
Errors were encountered while processing:
postgresql-client-13
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

The problem is related to the existence of the previously installed snoopy package.
Uninstall snoopy with sudo apt remove snoopy and, after that install PostgreSQL or postgresql-client-13.

Related

error processing package postgresql-contrib (--configure): dependency problems - leaving unconfigured

eading package lists... Done
Building dependency tree... Done
Reading state information... Done
postgresql is already the newest version (14+241.pgdg22.04+1).
postgresql-contrib is already the newest version (14+241.pgdg22.04+1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up postgresql-common (241.pgdg22.04+1) ...
dpkg: error processing package postgresql-common (--configure):
installed postgresql-common package post-installation script subprocess returned error exit status 10
Setting up sysstat (12.5.2-2build2) ...
dpkg: error processing package sysstat (--configure):
installed sysstat package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of postgresql-14:
postgresql-14 depends on postgresql-common (>= 229~); however:
Package postgresql-common is not configured yet.
dpkg: error processing package postgresql-14 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib:
postgresql-contrib depends on postgresql-contrib-14; however:
Package postgresql-contrib-14 is not installed.
Package postgresql-14 which provides postgresql-contrib-14 is not configured yet.
dpkg: error processing package postgresql-contrib (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql:
postgresql depends on postgresql-14; however:
Package postgresql-14 is not configured yet.
dpkg: error processing package postgresql (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
No apport report written because MaxReports
is reached already
Errors were encountered while processing:
postgresql-common
sysstat
postgresql-14
postgresql-contrib
postgresql

mongoDB in Ubuntu 20.04 Problems

so i installed mongodb in a wrong way , like watched a video of it in youtube even if "mongo" command is working that doesn't mean its really working
so i'm trying to uninstall mongodb-org but i got this error :
sudo apt remove mongodb-org
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
mongodb-org-tools : Depends: mongodb-database-tools but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
when i tried sudo apt --fix-broken install :
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libboost-program-options1.71.0 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libyaml-cpp0.6 mongo-tools mongodb-server-core
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
mongodb-database-tools mongodb-org-mongos mongodb-org-server
The following NEW packages will be installed:
mongodb-database-tools mongodb-org-mongos mongodb-org-server
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
Need to get 90.4 MB of archives.
After this operation, 146 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse amd64 mongodb-org-server amd64 4.4.1 [20.3 MB]
8% [1 mongodb-org-server 8,584 kB/20.3 MB 42%] Get:2 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse amd64 mongodb-org-mongos amd64 4.4.1 [15.7 MB]
Get:3 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4/multiverse amd64 mongodb-database-tools amd64 100.1.1 [54.4 MB]
Fetched 90.4 MB in 1min 11s (1,266 kB/s)
(Reading database ... 215423 files and directories currently installed.)
Preparing to unpack .../mongodb-org-server_4.4.1_amd64.deb ...
Unpacking mongodb-org-server (4.4.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_4.4.1_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.9+really3.
6.8+90~g8e540c0b6d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-mongos_4.4.1_amd64.deb ...
Unpacking mongodb-org-mongos (4.4.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_4.4.1_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.9+really3.
6.8+90~g8e540c0b6d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-database-tools_100.1.1_amd64.deb ...
Unpacking mongodb-database-tools (100.1.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_100.1.1_amd64.deb (--un
pack):
trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-org-server_4.4.1_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_4.4.1_amd64.deb
/var/cache/apt/archives/mongodb-database-tools_100.1.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
when trying this commands :
apt upgrade , autoclean,remove,purge
they give the same first error
i tried sudo apt clean , then sudo apt --fix-broken install the same problem happend and the same response
all i want is to remove it .
In general if you are removing a package and you get that error, and you don't want the other packages that are being kept that want additional dependencies, you can remove all packages in the same command:
sudo apt remove mongodb-org mongodb-org-tools
The problem is with program:
http://manpages.ubuntu.com/manpages/focal/man1/bsondump.1.html
that is installed in package: mongo-tools from mongo v3
You can try:
sudo apt remove mongo-tools
In docs you can read that in mongo v4 this package has name mongodb-database-tools
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

Install postgres on Ubuntu18 on AWS

I need to run a shell script on my new Ubuntu machine in AWS which has the following command:
sudo apt-get install postgresql postgresql-contrib
But, due to some restrictions, I don't want to go to internet to do that. So, I downloaded the below two .debs and scp them to the box.
postgresql_12+213.pgdg18.04+1_all.deb
postgresql-contrib_12+213.pgdg18.04+1_all.deb
And , in the shell script, I replaced the above command with the below:
sudo dpkg -i postgresql_12+213.pgdg18.04+1_all.deb
sudo dpkg -i postgresql-contrib_12+213.pgdg18.04+1_all.deb
Now, while executing the script, i got the below error:
(Reading database ... 56588 files and directories currently installed.)
Preparing to unpack postgresql_12+213.pgdg18.04+1_all.deb ...
Unpacking postgresql (12+213.pgdg18.04+1) ...
dpkg: dependency problems prevent configuration of postgresql:
postgresql depends on postgresql-12; however:
Package postgresql-12 is not installed.
dpkg: error processing package postgresql (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
postgresql
Selecting previously unselected package postgresql-contrib.
(Reading database ... 56591 files and directories currently installed.)
Preparing to unpack postgresql-contrib_12+213.pgdg18.04+1_all.deb ...
Unpacking postgresql-contrib (12+213.pgdg18.04+1) ...
dpkg: dependency problems prevent configuration of postgresql-contrib:
postgresql-contrib depends on postgresql-contrib-12; however:
Package postgresql-contrib-12 is not installed.
dpkg: error processing package postgresql-contrib (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
postgresql-contrib
So, I tried to individually run the below command (just to check, as they work perfectly fine on my local ubuntu machine) which I believe goes to the internet:
sudo apt-get install postgresql postgresql-contrib
I get the below error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgresql-contrib is already the newest version (12+213.pgdg18.04+1).
postgresql is already the newest version (12+213.pgdg18.04+1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
postgresql : Depends: postgresql-12 but it is not installable
postgresql-contrib : Depends: postgresql-contrib-12 but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
I am not very good with linux, but in the error above, I see it says that postgresql is already on the newest version. But when I try to run the below commands, they dont work:
postgres --version
postgres -V
locate /bin/postgres
psql --version
It seems postgres is not pre-installed on the machine. So, my issue here is I need to run the below command without internet access ( for which I downloaded the deb and tried but didnt work)
sudo apt-get install postgresql postgresql-contrib
Try updating your ubuntu and then install the packages again -
sudo apt-get update -y && sudo apt-get upgrade -y
Then install postgresql -
sudo apt-get install postgresql postgresql-contrib -y
Hope it helps.

Problam with apt-get install

I'm using ubuntu 16.04 and last week I try to install some virtual machine on my computer but I failed to do it.
Now when I try to install any program from the apt-get install I got this text:
sudo apt-get install build-essential git libssl-dev
[sudo] password for eliya:
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
git is already the newest version (1:2.7.4-0ubuntu1.5).
libssl-dev is already the newest version (1.0.2g-1ubuntu4.13).
The following packages were automatically installed and are no longer required:
libavdevice-ffmpeg56 linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic
linux-image-4.4.0-134-generic linux-image-extra-4.4.0-134-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 103 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up virtualbox-ext-pack (5.1.38-0ubuntu1.16.04.1) ...
removing old virtualbox extension packs
virtualbox-ext-pack: downloading: http://download.virtualbox.org/virtualbox/5.1.38/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack
The file will be downloaded into /usr/share/virtualbox-ext-pack
License accepted.
0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to install "/usr/share/virtualbox-ext-pack/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack"
VBoxManage: error: The installer failed with exit code 1: VBoxExtPackHelperApp: error: World writable: '/usr'
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackManagerWrap, interface IExtPackManager
VBoxManage: error: Context: "RTEXITCODE handleExtPack(HandlerArg*)" at line 1201 of file VBoxManageMisc.cpp
Hash mismatch Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack: expected e93d87b0f5de50369baca0a48082236b947df5b922ffd0233c0fa92c1206defd, or wrong accept-license key, removing the file.
dpkg: error processing package virtualbox-ext-pack (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
virtualbox-ext-pack
E: Sub-process /usr/bin/dpkg returned an error code (1)
And now i can't install anything because this problam.
Thank you
1.Reconfigure Package Database
sudo dpkg --configure -a
2.force install
sudo apt-get install -f
Then try again installing virtualbox

mongodb installation - error - chown: invalid group: ‘mongodb:mongodb’

I'm trying to install mongodb on ubuntu 14.10 following instructions from mongodb manual here . However I get the error chown: invalid group: ‘mongodb:mongodb’ and not able to proceed further with this.
> sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
The following NEW packages will be installed:
mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell
mongodb-org-tools
0 upgraded, 5 newly installed, 0 to remove and 56 not upgraded.
..................................
..................................
Setting up mongodb-org-shell (3.4.2) ...
Setting up mongodb-org-server (3.4.2) ...
chown: invalid group: ‘mongodb:mongodb’
dpkg: error processing package mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up mongodb-org-mongos (3.4.2) ...
Setting up mongodb-org-tools (3.4.2) ...
dpkg: dependency problems prevent configuration of mongodb-org:
mongodb-org depends on mongodb-org-server; however:
Package mongodb-org-server is not configured yet.
dpkg: error processing package mongodb-org (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mongodb-org-server
mongodb-org
E: Sub-process /usr/bin/dpkg returned an error code (1)
>
Follow this commands, I hope, This will help you.
sudo userdel -r mongodb
sudo groupdel mongodb
sudo adduser mongodb
sudo groupadd mongodb
useradd -G mongodb mongodb