Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was trying to install PostgreSQL 9.3 from the downloaded installer:

Still learning the ropes with Linux, I believe I originally installed it using an incorrect command. Afterwards it did appear to install correctly, but to avoid conflicts with the old 9.1 version, I wanted to clean out all the postgresql* packages.

In doing so, using sudo apt-get remove postgresql*, I continue to get the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package
E: Couldn't find any package by regex ''

I have tried some supposed solutions with related issues but I am unable to remove the specific packages, which doesn't seem to be valid or installed anyway, just referencing a mistake I previously tried.

How can I remove this unwanted pseudo-package?

share|improve this question
Erm...It's not a pseudo-package; it seems to be a file in your current directory. I'm not sure why that's being picked up. Instead, start with sudo apt-get remove postgresql postgresql-9.1*, and see what apt proposes to remove. – saiarcot895 Apr 12 '14 at 19:32
@SylvainPineau: He wants to remove PostgreSQL 9.1 installed from the main repos, not the PostgreSQL 9.3 he installed from the .run file. – saiarcot895 Apr 12 '14 at 19:37
@saiarcot895, I read "clean out all the postgresql packages" + "incorrect installation attempt". I removed my vote. For the record, this is the link I wanted to share:… – Sylvain Pineau Apr 12 '14 at 19:42

The .run file is a binary that installs packages outside of the package manager. apt-get wouldn't be able to remove them since it never installed them (unless the .run file manually adds the repos, and then just pulls down the packages. It might do this, I've never used it.)

Postgres provides their own repos for Ubuntu, and that is the preferred method to use it, so that you get security updates directly from Postgres when they release them.

Instructions to do that can be found at which has a handy selector and copy/paste blocks.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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