
Em um servidor Debian 7, o apt-get estava me oferecendo a atualização dos 2 pacotes a seguir: postgresql-9.1 e postgresql-client-9.1. Como não queria reiniciar o servidor de banco de dados, decidi apenas atualizar o cliente e executei:
sudo apt-get install --only-upgrade postgresql-client-9.1
Mas isso resultou na remoção do postgresql-9.1. Eu sei que o postgresql-9.1 depende do postgresql-client-9.1, mas por que a atualização do postgresql-client removeria o postgresql?
A apt-get upgrade
saída parece boa:
~$ 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]?
Mas não ao tentar atualizar apenas o cliente:
~$ 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]?
Responder1
Impossível atualizar o postgresql-client sem o pacote postgresql também. Porém, é possível fazer com que o serviço postgresql não seja reiniciado até a próxima reinicialização do sistema operacional. Usarpolítica-rc.d
cat > ./usr/sbin/policy-rc.d <<EOF
#!/bin/sh
exit 101
EOF
chmod a+x ./usr/sbin/policy-rc.d
Apenas lembre-se de excluir policy-rc.d se desejar reiniciar o serviço PostgreSQL sem reiniciar o sistema operacional.