I upgraded our gentoo server, got lost in the messages and, to make the story short, I ended up removing my postgresql 9.1 BEFORE I run a pg_upgrade to 9.2.. Then I discovered that pg_upgrade requires the binary of the previous version to still be there!
How can I re-install postgresql 9.1 without removing 9.2?
I know I can specify a version with /etc/portage/package.mask
eg.
>dev-db/postgresql-server-9.1.9
<dev-db/postgresql-server-9.1.9
but I'm afraid doing so I would replace the postgresql installed and end up more screwed up than before.
dev-db/postgresql-server
is SLOT-ed on the major and minor version, so reinstalling9.1
should not force a remove of9.2
(in theory, the dependencies of twoSLOT
able versions of a package can conflict though and might prevent you from doing so):As you can see, both versions are installed at the same time.
On a side note, to help with unslotted packages, you can use quickpkg to package the currently installed version. The rough workflow would be:
portage
s-k/-K
switches)quickpkg
has a switch to include the package's config files (--include-config
), you probably want to use this as well (seeman quickpkg
).Before performing a big bunch of upgrades (tm) you can always
quickpkg
the most important packages that you think might cause headaches later for some reason (like MySQL, PostgreSQL, Apache, ...), then you can quickly switch back to the earlier version if necessary.This does not mean that you don't have to have backups of your data (and config files, even when included in your binary package)!
Just as a reference, based on Adrian's answer, I fearlessy did a
please note that i used
:9.1
and not:9.1.9
(latest version) which resulted in aand got me confused at first.
Now I have them happily living together: