2
$ apt install postgresql-11
$ apt purge postgresql-11
$ apt autoremove

if you execute these commands on a fresh Ubuntu or Debian installation you will find that a dependency named postgresql-client-11 wasn't autoremoved along with other the dependencies despite having no dependents.

$ apt rdepends postgresql-client-11 --installed

returns nothing!

Same for postgresql-12.

This doesn't happen with aptitude.

Can anyone explain why?

  • Use what is described here man apt-get | less -p fix-broken maybe... – Hannu Jan 14 at 16:41
  • unfortunately, didn't work. – mweisz Jan 14 at 16:52
  • Did you try dpkg --remove too? It is in the same text. – Hannu Jan 14 at 21:18
  • I'm able to remove the package manually. What I want to know is why "apt autoremove" doesn't remove it. – mweisz Jan 14 at 21:37
  • 1
    I can confirm the issue. Probably it is a bug. – pa4080 Jan 15 at 19:07
1

postgresql-common configures apt to not autoremove postgresql packages.

/etc/apt/apt.conf.d/01autoremove-postgresql:

APT
{
  NeverAutoRemove
  {
    "^postgresql-";
  };
};

https://www.apt-browse.org/browse/ubuntu/trusty/main/all/postgresql-common/154/file/etc/apt/apt.conf.d/01autoremove-postgresql

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.