Browsing articles from "August, 2011"
Aug 31, 2011
Nathan Thom

Installation Frustrations


I am bad at linux installations. Really really bad. This post is more of a rant than anything useful :)

I messed up the auto start service while testing out some upgrades and needed to reinstall the postgresql 8.3 server package:

# rpm -i postgresql-server-8.3.13-1PGDG.x86_64.rpm
package postgresql-server-8.3.13-1PGDG.x86_64 is already installed

Umm OK I’ll remove it first then:

# rpm -e postgresql-server-8.3.13-1PGDG.x86_64.rpm
error: package postgresql-server-8.3.13-1PGDG.x86_64.rpm is not installed

Umm OK. What does yum have to say:

# yum list installed postgresql\*
Loaded plugins: rhnplugin, security

Installed Packages
postgresql.x86_64 8.3.13-1PGDG installed
postgresql-contrib.x86_64 8.3.13-1PGDG installed
postgresql-libs.x86_64 8.3.13-1PGDG installed
postgresql-plperl.x86_64 8.3.13-1PGDG installed
postgresql-plpython.x86_64 8.3.13-1PGDG installed
postgresql-pltcl.x86_64 8.3.13-1PGDG installed
postgresql-server.x86_64 8.3.13-1PGDG installed

So yum thinks it’s installed. Let’s try removing it with yum:

# yum remove postgresql-server
Loaded plugins: rhnplugin, security

============================================================================================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================================================================================
Removing:
postgresql-server x86_64 8.3.13-1PGDG installed 12 M
Removing for dependencies:
postgresql-plperl x86_64 8.3.13-1PGDG installed 72 k
postgresql-plpython x86_64 8.3.13-1PGDG installed 49 k
postgresql-pltcl x86_64 8.3.13-1PGDG installed 50 k

Transaction Summary
============================================================================================================================================================================================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 4 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
error reading information on service postgresql: No such file or directory
Erasing : postgresql-pltcl 1/4
error: %preun(postgresql-server-8.3.13-1PGDG.x86_64) scriptlet failed, exit status 1
Erasing : postgresql-plpython 2/4
Erasing : postgresql-plperl 3/4

Removed:
postgresql-server.x86_64 0:8.3.13-1PGDG

Dependency Removed:
postgresql-plperl.x86_64 0:8.3.13-1PGDG postgresql-plpython.x86_64 0:8.3.13-1PGDG postgresql-pltcl.x86_64 0:8.3.13-1PGDG

Complete!

Well it removed the dependency language packages, but not the server package. Fair enough, the postgresql service is indeed missing but why should that stop the uninstall?

# chkconfig --list postgresql
error reading information on service postgresql: No such file or directory

I added the service back manually by recreating the /etc/init.d/postgresql file (copied a different server) and then made sure it could add and recognise the service:

# chkconfig --add postgresql
# chkconfig --list postgresql
postgresql 0:off 1:off 2:off 3:off 4:off 5:off 6:off

Now a yum remove works:

# yum remove postgresql-server
Loaded plugins: rhnplugin, security

============================================================================================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================================================================================
Removing:
postgresql-server x86_64 8.3.13-1PGDG installed 12 M

Transaction Summary
============================================================================================================================================================================================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 1 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : postgresql-server 1/1
warning: /var/lib/pgsql/.bash_profile saved as /var/lib/pgsql/.bash_profile.rpmsave

Removed:
postgresql-server.x86_64 0:8.3.13-1PGDG

Complete!

Yay, now I know what to do the next time I mess it up… in about 5 mins.

Pages:12»

Article Series

Kick Ass PostgreSQL Books

Kick Ass Oracle Books

I've read lots of Oracle books, but these are by far the best I've encountered:

Categories