Postgres Update - version mismatch error when running commands - linux

I recently updated Postgres from version 9.3 to 9.6. After the update all of my commands (such as pg_dumpall) all point to version 9.3. I get the error of version mismatch.
I found that if I change my symlink in /usr/bin to point to 9.6 it seems to work. Is there a better way to point my commands to version 9.6? Thanks you for your help!

The best way to do it is using the package manager of your linux distro: it ensures all symlinks are changed to the newer version.
From your question it is possible to infer that the upgrade was done without using the package manager. I suggest to try to install Postgres with the package manager or give a little more information about your system so we can give you a more accurate answer.

Related

cannot open libmpfr.so.4 after update on ubuntu 18.04

Today I updated my laptop to Ubuntu 18.04.
Now I try to run a program for my bachelor thesis, but it gives me the following error message:
error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory
I did a bit of research, and I think libmpfr4 has been droppen in this ubuntu version. Is there any way I can solve this?
I had the same problem and solved it by creating symbolic link:
sudo ln -s /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4
Bear in mind that this is just workaround which might trigger other issues for your case. However, this might save you the day in cases when the problematic program is just a mean to achieve something else.
When you get such an error, this means that you generally need to recompile your program.
Alternatively, you may install the old MPFR 3.x version (which corresponds to libmpfr.so.4) if available, otherwise from an earlier Ubuntu release (I do not recommend that, but if there are no conflicts from the packaging system, this could be OK; FYI, in Debian, both packages libmpfr4 and libmpfr6 are co-installable).
Note: Contrary to what has been said in the comments, libmpfr.so.4 is no longer there if you're using the 64-bit ABI (x86_64), as ldconfig -p | grep mpfr gave for this file: /usr/lib/i386-linux-gnu/libmpfr.so.4, i.e. the 32-bit version. I suspect that the upgrade removed the x86_64 one (either due to a conflict or because it was no longer needed).
apt install python-gmpy2 can fix this error.

Unable to locate package libsystemd-dev during installation ScyllaDB on ubuntu 14

During installation Scylla from https://github.com/scylladb/scylla on ubuntu 14 during sudo ./install-dependencies.sh I get E: Unable to locate package libsystemd-dev. I tried to sudo apt-get install libsystemd-daemon-dev and many other methods but nothing works. Any ideas how can I solve this?
There is a bug in install-dependencies.sh script that causes this error.
The problem, as rightly mentioned in the comments to your post, is that Ubuntu 14.0 lacks the libsystemd-dev package: https://github.com/scylladb/scylla/issues/3515
This is not the only issue though as latest ScyllaDB code requires GCC 7.3 to be built and install-dependencies.sh enforces it.
It is possible to install the tools for building Scylla from ScyllaDB PPA: https://launchpad.net/~scylladb/+archive/ubuntu/ppa
Note that you'll need to pass information about the location of those tools manually to the configure.py script. Unfortunately, today install-dependencies.sh doesn't do this all for Ubuntu: https://github.com/scylladb/scylla/issues/3379
As an alternative, you can try using the packaging script from Scylla. It is well explained here: https://github.com/scylladb/scylla/wiki/Building-.deb-package-for-Ubuntu-Debian

Apache version upgrade issue

At present we are on Apache/2.2.15 (UNIX) version. To fix the vulnerabilities we are suggested to upgrade to new version. I got new version from online using "wget" command and followed steps mentioned on this link http://httpd.apache.org/docs/2.2/install.html#download.
Once I am done, checked version using httpd -v. It gives me old version Apache/2.2.15 (UNIX). If I check using /usr/local/apache2/bin/httpd - v. It gives me new version. Did I successfully upgraded the version or not? If not what should I do?
I tried "yum install httpd" - It says "Nothing to do".
You now have two versions of Apache installed. You have the one installed with the system package manager (yum) in /usr/sbin/httpd. You have one installed manually in /usr/local/apache2/....
Which one you get will be determined entirely by which path you use.
In general, mixing system-managed packages with manually installed packages is a recipe for trouble. If you want to stick with the newer version in /usr/local, you should remove the system version, and realize that you will lose some manageability. For example, you will no longer be able to use yum install ... to install new Apache modules, and you will not be able to verify the installed files using tools like rpmverify.
If your distribution currently has Apache 2.2.x, that suggests your distribution is fairly old. For example, RHEL (and CentOS) 7 (and similar variants) have version 2.4.6 packaged, so you may want to update your host to something newer than whatever you're running now.
Yes, its successfully upgraded as per the screenshot.
httpd 2.2.15 is the version with RHEL 6 repository, here HTTPD_HOME is /etc/httpd (Highest version provided for HTTPD via RPM RHEL 6 is 2.2.15)
httpd 2.4.6 is the version with EPEL-HTTPD24 repository, here HTTPD_HOME is /usr/local/apache2/

What is POSTGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1?

I can understand 2.1.7 but what is +dfsg-3~94.git954a8d0.pgdg80+1 coming after that ?
I am now build postgis docker container from appropriate/docker-postgis
and am getting error
E: Version '2.1.7+dfsg-3~94.git954a8d0.pgdg80+1' for 'postgresql-9.3-postgis-2.1' was not found
E: Version '2.1.7+dfsg-3~94.git954a8d0.pgdg80+1' for 'postgis' was not found
seems to be a problem of package management?
How could I find fix this? How could I find all "subversions" +dfsg-3~94.git954a8d0.pgdg80+1.
thx
Sometimes using only version number 2.1.7 is not enough, as there are different OS, architectures (or even git branches as you can see), so developers append these specifics to the version to avoid confusion. If you used:
apt-get update postgresq-2.1.7
It would not make sense (or it would and would give you default option), because for this product version-number is not good enough for Docker to set up your environment.
dfsg = Debian Free Software Guidelines (specifies it is for specific version of Debian system, not for redHat for example)
git - version/branch specified
pgdg80 = PostgreSQL packages and backports for Debian/Ubuntu
Take a look here

Postgresql 8.3 version needed for OpenSUSE

I have installed OpenSUSE 12.1 installed on machine.
and i have postgresql-contrib-8.3.11-0.1.i586.rpm,postgresql-devel-8.3.11-0.1.i586.rpm, postgresql-docs-8.3.11-0.1.i586.rpm,postgresql-libs-8.3.11-0.1.i586.rpm,postgresql-server-8.3.11-0.1.i586.rpm..
I want to installed postgresql 8.3 version based on above packages..but when i installed with this command .it shows an error.
opnsu121:/ # rpm -Uvh postgresql-server-8.3.11-0.1.i586.rpm
error: Failed dependencies:
postgresql = 8.3 is needed by postgresql-server-8.3.11-0.1.i586
Even i am not able to find postgresql 8.3 base version as i think the above one is update.i have gone throgh the download.openSUSE.orf,ftp.openSUSE.org..
http://download.opensuse.org/update/11.0/rpm/i586/..
but not able to find what i need..so please help on this,
If at all possible, use YaST or whatever package manager SuSE uses to install the current version of PostgreSQL. From the repository it looks like that's 9.1.1.
If you specifically need PostgreSQL 8.3, I'd recommend using the distro-independent installer from EnterpriseDB. That should work fine on SuSE 12.2. If your organisation has particularly restrictive and unsafe version policies that force you to use old versions with known bugs, you can get 8.3.14 for 32-bit Linux here and 8.3.11 for 32-bit Linux here.
If you have issues with using the well-tested and known-to-work EnterpriseDB binary installer versions of PostgreSQL, your other option (and a good one) is to install from source code. Download the PostgreSQL 8.3.18 sources from the FTP site, then:
sudo mkdir -p /opt/postgresql93
sudo chown `id -un` /opt/postgresql93
./configure --prefix=/opt/postgresql93
make
make install
after which you can use /opt/postgresql93/bin/initdb (see initdb manual) to create a database and /opt/postgresql93/bin/pg_ctl (see pg_ctl manual) to start/stop it, as per the PostgreSQL documentation.
Don't try to force packages from an old version of SuSE to install on your new version. It'll probably result in an increasing tree of dependencies and end in pain.
If at all possible, try to convince your company that their policy of requiring a specific minor version (eg 8.4.14 not just "8.4.x") of PostgreSQL is unsafe and counterproductive. They're forcing you to do dirty hacks or hand-compile unique, custom installs just for your setup in order to avoid using well tested builds that contain extra bug fixes. Requiring approval before upgrading from 8.3 to 8.4/9.0/9.1/etc makes sense as there are feature and backward compatibility changes that require careful testing, but requiring approval before upgrading from 8.3.14 to 8.3.18 is counterproductive. Minor version upgrades of PostgreSQL are very conservative; you should stay up to date with the latest minor release.
hurray...I got the answer..
I have got the package below:
postgresql-contrib-8.3.11-0.1.i586.rpm, postgresql-devel-8.3.11-0.1.i586.rpm,postgresql-docs-8.3.11-0.1.i586.rpm,postgresql-libs-8.3.11-0.1.i586.rpm,postgresql-server-8.3.11-0.1.i586.rpm from the below link:
http://download.opensuse.org/update/12.1/i586/
and the one more package which i have struggled to get is:
postgresql-8.3.11-0.1.i586.rpm with the following link:
http://rpm.pbone.net/index.php3/stat/4/idpl/17194424/dir/opensuse_11.x/com/postgresql-8.3.11-0.1.i586.rpm.html
with all above packages i have installed using..
rpm -ivh packagename
if there is a dependency then rpm -ivh --nodeps packagename
great..its done..

Resources