1

On a Debian 7 server, apt-get was offering me to upgrate the following 2 packages: postgresql-9.1 and postgresql-client-9.1. Since I didn't want to restart the database server, I decided only to upgrade the client and ran:

sudo apt-get install --only-upgrade postgresql-client-9.1

But this resulted in postgresql-9.1 being removed. I know that postgresql-9.1 depends on postgresql-client-9.1, but why would upgrading postgresql-client remove postgresql?


The apt-get upgrade output looks fine:

~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  postgresql-9.1 postgresql-client-9.1
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/4,307 kB of archives.
After this operation, 432 kB of additional disk space will be used.
Do you want to continue [Y/n]?

But not when trying to upgrade only the client:

~$ sudo apt-get install --only-upgrade postgresql-client-9.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  postgresql-doc-9.1
The following packages will be REMOVED:
  postgresql postgresql-9.1
The following packages will be upgraded:
  postgresql-client-9.1
1 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
Need to get 0 B/996 kB of archives.
After this operation, 16.7 MB disk space will be freed.
Do you want to continue [Y/n]?
3
  • Can you post the actual apt-get output? Usually the answer is there.
    – Dan
    May 19, 2015 at 18:29
  • I've added the apt-get output. Is that ok for you or do you want the output of apt-get actually removing postgresql-9.1 ?
    – Herka
    May 20, 2015 at 14:03
  • I suspect you cannot only update the postgres client, the client and the server must have the exact same version. Therefore when you force upgrade only the client, the only solution is to remove the server.
    – Dan
    May 20, 2015 at 17:23

1 Answer 1

0

Impossible upgrade the postgresql-client without the postgresql package too. But, it's possible to make the postgresql service doesn't restart until the next OS reboot. Use policy-rc.d

cat > ./usr/sbin/policy-rc.d <<EOF
#!/bin/sh
exit 101
EOF

chmod a+x ./usr/sbin/policy-rc.d

Just remember to delete policy-rc.d if you want restart PostgreSQL service without OS reboot.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .