Thread: BUG #17348: Can never install pgsql on Ubuntu
The following bug has been logged on the website: Bug reference: 17348 Logged by: KT LEE Email address: ktr01@protonmail.com PostgreSQL version: Unsupported/Unknown Operating system: Windows 10 Description: I use Win10 + Ubuntu 20.04 and build a website with Ruby on Rails. Whether I changed the existing repo server to pg (in gemfile), or rails new specified db as pg, I all encountered the following error message, followed by a series of error message mazes. I once removed pg and reinstalled it. I have also referred to all the answers on Stack Overflow. I have also asked several questions, but none of them can be resolved. If I try sudo apt-get install libpq-dev, I will encounter "E: Unable to correct problems, you have held broken packages. ", and then go back to the beginning of the problem. Compared to elephants, pg may be more like ouroboros. This is the question I asked: https://stackoverflow.com/questions/70496525/cant-find-the-libpq-fe-h-header https://stackoverflow.com/questions/70497607/there-is-no-response-to-the-command-to-install-postgresql-on-ubuntu-gemextb https://stackoverflow.com/questions/70486509/cant-find-the-libpq-fe-h-header-cant-install-libpq-dev This is my error message: $ gem install pg -v '1.2.3' --source 'https://rubygems.org/' Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. current directory: /home/keaton/.rvm/gems/ruby-3.0.0/gems/pg-1.2.3/ext /home/keaton/.rvm/rubies/ruby-3.0.0/bin/ruby -I /home/keaton/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0 -r ./siteconf20211228-2714-f0chma.rb extconf.rb checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/keaton/.rvm/rubies/ruby-3.0.0/bin/$(RUBY_BASE_NAME) --with-pg --without-pg --enable-windows-cross --disable-windows-cross --with-pg-config --without-pg-config --with-pg_config --without-pg_config --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib To see why this extension failed to compile, please check the mkmf.log which can be found here: /home/keaton/.rvm/gems/ruby-3.0.0/extensions/x86_64-linux/3.0.0/pg-1.2.3/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /home/keaton/.rvm/gems/ruby-3.0.0/gems/pg-1.2.3 for inspection. Results logged to /home/keaton/.rvm/gems/ruby-3.0.0/extensions/x86_64-linux/3.0.0/pg-1.2.3/gem_make.out
On Tue, Dec 28, 2021 at 02:22:52PM +0000, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 17348 > Logged by: KT LEE > Email address: ktr01@protonmail.com > PostgreSQL version: Unsupported/Unknown > Operating system: Windows 10 > Description: > > I use Win10 + Ubuntu 20.04 and build a website with Ruby on Rails. Whether I > changed the existing repo server to pg (in gemfile), or rails new specified > db as pg, I all encountered the following error message, followed by a > series of error message mazes. I once removed pg and reinstalled it. I have > also referred to all the answers on Stack Overflow. I have also asked > several questions, but none of them can be resolved. > > If I try sudo apt-get install libpq-dev, I will encounter "E: Unable to > correct problems, you have held broken packages. ", and then go back to the This is the problem. Fix apt issue, and then install libpq-dev, and then ruby will allow you to compile its library. As for what is the problem with apt? No idea. Check full output of the apt-get install command, and react accordingly. This is not a bug in Pg. This is not even (most likely) a bug in Ubuntu. depesz p.s. how does windows fit in all of this? You mentioned that you have the problem on Windows, but then you say that you install Pg on ubuntu (which makes sense given apt-get command). So which is it?
This is useless, I run ``` sudo apt install postgresql-contrib libpq-dev ``` and it will stop at "Unable to correct problems,you have held broken packages." I think this is not a rare problem, I hope pg can produce a Q&A guide. The following is the process after the "broken packages" error occurs $ sudo apt-get update Hit:1 https://dl.yarnpkg.com/debian stable InRelease Hit:2 https://deb.nodesource.com/node_12.x focal InRelease Ign:3 http://old-releases.ubuntu.com/ubuntu raring InRelease Ign:4 http://old-releases.ubuntu.com/ubuntu raring-security InRelease Ign:5 http://old-releases.ubuntu.com/ubuntu raring-updates InRelease Ign:6 http://old-releases.ubuntu.com/ubuntu raring-backports InRelease Ign:7 http://old-releases.ubuntu.com/ubuntu raring-proposed InRelease Hit:8 http://old-releases.ubuntu.com/ubuntu raring Release Hit:10 http://old-releases.ubuntu.com/ubuntu raring-security Release Hit:12 http://old-releases.ubuntu.com/ubuntu raring-updates Release Hit:14 http://old-releases.ubuntu.com/ubuntu raring-backports Release Hit:16 http://old-releases.ubuntu.com/ubuntu raring-proposed Release Reading package lists... Done $ sudo apt-get dist-upgrade && sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. $ apt-cache policy libpq5 libpq5: Installed: (none) Candidate: 9.1.11-0ubuntu0.13.04 Version table: 9.1.11-0ubuntu0.13.04 500 500 http://old-releases.ubuntu.com/ubuntu raring-updates/main amd64 Packages 100 /var/lib/dpkg/status 9.1.9-1ubuntu1 500 500 http://old-releases.ubuntu.com/ubuntu raring/main amd64 Packages $ sudo apt install postgresql-contrib libpq-dev 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: libpq-dev : Depends: libkrb5-dev but it is not going to be installed Depends: comerr-dev but it is not going to be installed E: Unable to correct problems, you have held broken packages. Sent with ProtonMail Secure Email. ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Wednesday, December 29th, 2021 at AM 12:12, hubert depesz lubaczewski <depesz@depesz.com> wrote: > On Tue, Dec 28, 2021 at 02:22:52PM +0000, PG Bug reporting form wrote: > > > The following bug has been logged on the website: > > > > Bug reference: 17348 > > > > Logged by: KT LEE > > > > Email address: ktr01@protonmail.com > > > > PostgreSQL version: Unsupported/Unknown > > > > Operating system: Windows 10 > > > > Description: > > > > I use Win10 + Ubuntu 20.04 and build a website with Ruby on Rails. Whether I > > > > changed the existing repo server to pg (in gemfile), or rails new specified > > > > db as pg, I all encountered the following error message, followed by a > > > > series of error message mazes. I once removed pg and reinstalled it. I have > > > > also referred to all the answers on Stack Overflow. I have also asked > > > > several questions, but none of them can be resolved. > > > > If I try sudo apt-get install libpq-dev, I will encounter "E: Unable to > > > > correct problems, you have held broken packages. ", and then go back to the > > This is the problem. Fix apt issue, and then install libpq-dev, and then > > ruby will allow you to compile its library. > > As for what is the problem with apt? No idea. Check full output of the > > apt-get install command, and react accordingly. > > This is not a bug in Pg. This is not even (most likely) a bug in Ubuntu. > > depesz > > p.s. how does windows fit in all of this? You mentioned that you have > > the problem on Windows, but then you say that you install Pg on ubuntu > > (which makes sense given apt-get command). So which is it?
On Wed, Dec 29, 2021 at 03:01:29PM +0000, Mr. Keaton wrote: > This is useless, I run ``` sudo apt install postgresql-contrib libpq-dev ``` and it will stop at "Unable to correct problems,you have held broken packages." Comments "this is useless" are not really helpful. > I think this is not a rare problem, I hope pg can produce a Q&A guide. I think it is EXTREMELY RARE. Reason for the problem (as far as I can tell) - why are you running Ubuntu Raring? From 2013 ?! It's no longer supported. Best regards, depesz
I'm not sure what I ran, this is the version I found: ~$ cat /etc/issue Ubuntu 20.04.2 LTS \n \l Sent with ProtonMail Secure Email. ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Wednesday, December 29th, 2021 at PM 11:04, hubert depesz lubaczewski <depesz@depesz.com> wrote: > On Wed, Dec 29, 2021 at 03:01:29PM +0000, Mr. Keaton wrote: > > > This is useless, I run `sudo apt install postgresql-contrib libpq-dev` and it will stop at "Unable to correct problems,you have held broken packages." > > Comments "this is useless" are not really helpful. > > > I think this is not a rare problem, I hope pg can produce a Q&A guide. > > I think it is EXTREMELY RARE. > > Reason for the problem (as far as I can tell) - why are you running > > Ubuntu Raring? From 2013 ?! It's no longer supported. > > Best regards, > > depesz
On Wed, Dec 29, 2021 at 03:18:51PM +0000, Mr. Keaton wrote: > I'm not sure what I ran, this is the version I found: > ~$ cat /etc/issue > Ubuntu 20.04.2 LTS \n \l Please note that your apt is trying to install packages for raring. Why? No idea. Check /etc/apt for raring mentions, fix what needs to be fixed, remove raring packages, and install pg for ubuntu 20.04 (focal) depesz
What does "raring" mean? I did not see similar words in the Ubunru window Sent with ProtonMail Secure Email. ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Wednesday, December 29th, 2021 at PM 11:53, hubert depesz lubaczewski <depesz@depesz.com> wrote: > On Wed, Dec 29, 2021 at 03:18:51PM +0000, Mr. Keaton wrote: > > > I'm not sure what I ran, this is the version I found: > > > > ~$ cat /etc/issue > > > > Ubuntu 20.04.2 LTS \n \l > > Please note that your apt is trying to install packages for raring. > > Why? No idea. Check /etc/apt for raring mentions, fix what needs to be > > fixed, remove raring packages, and install pg for ubuntu 20.04 (focal) > > depesz
On Wed, Dec 29, 2021 at 04:13:55PM +0000, Mr. Keaton wrote: > What does "raring" mean? I did not see similar words in the Ubunru window It's an OLD version of Ubuntu. depesz
Should I remove Ubuntu 20.04 from Windows and install a newer version? Sent with ProtonMail Secure Email. ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Thursday, December 30th, 2021 at AM 12:15, hubert depesz lubaczewski <depesz@depesz.com> wrote: > On Wed, Dec 29, 2021 at 04:13:55PM +0000, Mr. Keaton wrote: > > > What does "raring" mean? I did not see similar words in the Ubunru window > > It's an OLD version of Ubuntu. > > depesz
On Wed, 2021-12-29 at 16:23 +0000, Mr. Keaton wrote: > Should I remove Ubuntu 20.04 from Windows and install a newer > version? > > > Sent with ProtonMail Secure Email. > > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ > > On Thursday, December 30th, 2021 at AM 12:15, hubert depesz > lubaczewski <depesz@depesz.com> wrote: > > > On Wed, Dec 29, 2021 at 04:13:55PM +0000, Mr. Keaton wrote: > > > > > What does "raring" mean? I did not see similar words in the > > > Ubunru window > > > > It's an OLD version of Ubuntu. > > > > depesz > > https://help.ubuntu.com/community/Repositories/CommandLine https://help.ubuntu.com/community/Repositories depesz is advising you that your 20.04 version of ubuntu (Focal Fossa) is somehow configured to install packages from version 13.x of ubuntu (Raring Ringtail). You need to configure your installation to utilize the repositories for 20.04 instead and remove the installed packages from the 13.x repositories and install the correct packages from the 20.x repositories. The above links provide an introduction to managing repositories.