pg_ctl: comando não encontrado, qual pacote tem este comando?

22

Instalei o pgadmin usando o centro de software do Ubuntu e estou tentando acessar um banco de dados local (baixado recentemente da Internet). Eu tentei executar o comando pg_ctl (em execução como postgres) no entanto, isso dá um erro de comando não encontrado. Eu também corri os seguintes comandos:

echo $PATH: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games 

então isso é um pouco estranho, mas ainda assim. whereis pg_ctl: pg_ctl: /usr/share/man/man1/pg_ctl.1.gz type pg_ctl: -su: , então está em algum lugar no meu sistema   type: pg_ctl: not found que parece errado

apt-cache policy postgres-xc me dá um erro No such file or directory da saída de

sudo apt-get install postgres-xc é

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package postgres-xc

sudo apt-get-q update me dá:

Get:1 http://security.ubuntu.com precise-security Release.gpg [198 B]
Get:2 http://security.ubuntu.com precise-security Release [49.6 kB]
Get:3 http://security.ubuntu.com precise-security/main Sources [93.6 kB]
Hit http://nl.archive.ubuntu.com precise Release.gpg
Hit http://nl.archive.ubuntu.com precise-updates Release.gpg
Hit http://nl.archive.ubuntu.com precise-backports Release.gpg
Hit http://nl.archive.ubuntu.com precise Release
Hit http://nl.archive.ubuntu.com precise-updates Release
Get:4 http://extras.ubuntu.com precise Release.gpg [72 B]
Hit http://nl.archive.ubuntu.com precise-backports Release
Hit http://extras.ubuntu.com precise Release
Hit http://nl.archive.ubuntu.com precise/main Sources
Hit http://nl.archive.ubuntu.com precise/restricted Sources
Hit http://nl.archive.ubuntu.com precise/universe Sources
Hit http://nl.archive.ubuntu.com precise/multiverse Sources
Hit http://nl.archive.ubuntu.com precise/main amd64 Packages
Hit http://nl.archive.ubuntu.com precise/restricted amd64 Packages
Hit http://nl.archive.ubuntu.com precise/universe amd64 Packages
Hit http://nl.archive.ubuntu.com precise/multiverse amd64 Packages
Hit http://nl.archive.ubuntu.com precise/main i386 Packages
Hit http://nl.archive.ubuntu.com precise/restricted i386 Packages
Hit http://nl.archive.ubuntu.com precise/universe i386 Packages
Hit http://nl.archive.ubuntu.com precise/multiverse i386 Packages
Hit http://nl.archive.ubuntu.com precise/main TranslationIndex
Hit http://nl.archive.ubuntu.com precise/multiverse TranslationIndex
Hit http://nl.archive.ubuntu.com precise/restricted TranslationIndex
Hit http://extras.ubuntu.com precise/main Sources
Hit http://nl.archive.ubuntu.com precise/universe TranslationIndex
Hit http://nl.archive.ubuntu.com precise-updates/main Sources
Hit http://nl.archive.ubuntu.com precise-updates/restricted Sources
Hit http://nl.archive.ubuntu.com precise-updates/universe Sources
Hit http://nl.archive.ubuntu.com precise-updates/multiverse Sources
Hit http://nl.archive.ubuntu.com precise-updates/main amd64 Packages
Hit http://extras.ubuntu.com precise/main amd64 Packages
Hit http://extras.ubuntu.com precise/main i386 Packages
Ign http://extras.ubuntu.com precise/main TranslationIndex
Hit http://nl.archive.ubuntu.com precise-updates/restricted amd64 Packages
Hit http://nl.archive.ubuntu.com precise-updates/universe amd64 Packages
Hit http://nl.archive.ubuntu.com precise-updates/multiverse amd64 Packages
Hit http://nl.archive.ubuntu.com precise-updates/main i386 Packages
Hit http://nl.archive.ubuntu.com precise-updates/restricted i386 Packages
Hit http://nl.archive.ubuntu.com precise-updates/universe i386 Packages
Hit http://nl.archive.ubuntu.com precise-updates/multiverse i386 Packages
Hit http://nl.archive.ubuntu.com precise-updates/main TranslationIndex
Hit http://nl.archive.ubuntu.com precise-updates/multiverse TranslationIndex
Get:5 http://security.ubuntu.com precise-security/restricted Sources [2,494 B]
Get:6 http://security.ubuntu.com precise-security/universe Sources [29.9 kB]
Hit http://nl.archive.ubuntu.com precise-updates/restricted TranslationIndex
Hit http://nl.archive.ubuntu.com precise-updates/universe TranslationIndex
Hit http://nl.archive.ubuntu.com precise-backports/main Sources
Hit http://nl.archive.ubuntu.com precise-backports/restricted Sources
Hit http://nl.archive.ubuntu.com precise-backports/universe Sources
Hit http://nl.archive.ubuntu.com precise-backports/multiverse Sources
Hit http://nl.archive.ubuntu.com precise-backports/main amd64 Packages
Hit http://nl.archive.ubuntu.com precise-backports/restricted amd64 Packages
Hit http://nl.archive.ubuntu.com precise-backports/universe amd64 Packages
Hit http://nl.archive.ubuntu.com precise-backports/multiverse amd64 Packages
Hit http://nl.archive.ubuntu.com precise-backports/main i386 Packages
Hit http://nl.archive.ubuntu.com precise-backports/restricted i386 Packages
Hit http://nl.archive.ubuntu.com precise-backports/universe i386 Packages
Hit http://nl.archive.ubuntu.com precise-backports/multiverse i386 Packages
Hit http://nl.archive.ubuntu.com precise-backports/main TranslationIndex
Hit http://nl.archive.ubuntu.com precise-backports/multiverse TranslationIndex
Hit http://nl.archive.ubuntu.com precise-backports/restricted TranslationIndex
Hit http://nl.archive.ubuntu.com precise-backports/universe TranslationIndex
Hit http://nl.archive.ubuntu.com precise/main Translation-en
Hit http://nl.archive.ubuntu.com precise/multiverse Translation-en
Hit http://nl.archive.ubuntu.com precise/restricted Translation-en
Hit http://nl.archive.ubuntu.com precise/universe Translation-en
Hit http://nl.archive.ubuntu.com precise-updates/main Translation-en
Get:7 http://security.ubuntu.com precise-security/multiverse Sources [1,797 B]
Get:8 http://security.ubuntu.com precise-security/main amd64 Packages [347 kB]
Hit http://nl.archive.ubuntu.com precise-updates/multiverse Translation-en
Hit http://nl.archive.ubuntu.com precise-updates/restricted Translation-en
Hit http://nl.archive.ubuntu.com precise-updates/universe Translation-en
Hit http://nl.archive.ubuntu.com precise-backports/main Translation-en
Hit http://nl.archive.ubuntu.com precise-backports/multiverse Translation-en
Hit http://nl.archive.ubuntu.com precise-backports/restricted Translation-en
Hit http://nl.archive.ubuntu.com precise-backports/universe Translation-en
Ign http://extras.ubuntu.com precise/main Translation-en_US
Ign http://extras.ubuntu.com precise/main Translation-en
Get:9 http://security.ubuntu.com precise-security/restricted amd64 Packages [4,627 B]
Get:10 http://security.ubuntu.com precise-security/universe amd64 Packages [85.4 kB]
Get:11 http://security.ubuntu.com precise-security/multiverse amd64 Packages [2,439 B]
Get:12 http://security.ubuntu.com precise-security/main i386 Packages [366 kB]
Get:13 http://security.ubuntu.com precise-security/restricted i386 Packages [4,620 B]
Get:14 http://security.ubuntu.com precise-security/universe i386 Packages [89.5 kB]
Get:15 http://security.ubuntu.com precise-security/multiverse i386 Packages [2,635 B]
Hit http://security.ubuntu.com precise-security/main TranslationIndex
Hit http://security.ubuntu.com precise-security/multiverse TranslationIndex
Hit http://security.ubuntu.com precise-security/restricted TranslationIndex
Hit http://security.ubuntu.com precise-security/universe TranslationIndex
Hit http://security.ubuntu.com precise-security/main Translation-en
Hit http://security.ubuntu.com precise-security/multiverse Translation-en
Hit http://security.ubuntu.com precise-security/restricted Translation-en
Hit http://security.ubuntu.com precise-security/universe Translation-en
Fetched 1,081 kB in 0s (1,561 kB/s)

cat /etc/apt/sources.list me dá:

#deb cdrom:[Ubuntu 12.04.3 LTS _Precise Pangolin_ - Release amd64 (20130820.1)]/ dists/precise/main/binary-i386/

#deb cdrom:[Ubuntu 12.04.3 LTS _Precise Pangolin_ - Release amd64 (20130820.1)]/ dists/precise/restricted/binary-i386/
#deb cdrom:[Ubuntu 12.04.3 LTS _Precise Pangolin_ - Release amd64 (20130820.1)]/ precise main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://nl.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://nl.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://nl.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise universe
deb http://nl.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://nl.archive.ubuntu.com/ubuntu/ precise multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise multiverse
deb http://nl.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://nl.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main
    
por Thijser 03.12.2013 / 13:51

3 respostas

14

Você deve editar seu caminho:

$ cd ~
$ vim .profile
PATH=$PATH:/usr/lib/postgresql/{version}/bin
export PATH
$ . ~/.profile

Substitua {version} pelo número correto da versão.

E agora você pode executar o comando a partir do shell:

pg_ctl --help
pg_ctl is a utility to initialize, start, stop, or control a PostgreSQL server.
    
por JohnMerlino 13.03.2014 / 05:21
21

Você não deve executar pg_ctl diretamente no Ubuntu / Debian. Use pg_ctlcluster , que é instalado por postgresql-common . Veja sua página de manual para documentação.

    
por Peter Eisentraut 04.12.2013 / 15:29
3

Preciso (12,04)

Preciso não inclui o pacote postgres-xc , mas o pacote postgresql-9.1 inclui o binário pg_ctl , mas em um diretório não padrão!

sudo apt-get install postgresql-9.1
/usr/lib/postgresql/9.1/bin/pg_ctl

Então, depois de instalar o pacote postgres, você deve encontrar o binário no diretório acima, adicionando-o ao seu caminho deve ser um não-brainer export PATH=$PATH:/usr/lib/postgresql/9.1/bin/ .

Quantico e mais recente (& gt; 12.10)

Instale o pacote postgres-xc :

sudo apt-get install postgres-xc

Esse pacote é o que fornece o binário pg_ctl . Depois de ter instalado, use o caminho completo:

/usr/bin/pg_ctl

Dessa forma, você evita o erro de comando não encontrado.

    
por Braiam 03.12.2013 / 14:43
3

use este código:

sudo pg_ctlcluster 'cluster_version' 'cluster-name' 'action'

onde:

/etc/postgresql/**cluster-version**/**cluster-name**/start.conf

onde ação:

start|stop|restart|reload|status|promote

exemplo meu código:

/etc/postgresql/9.5/main/pg_hba.conf

sudo pg_ctlcluster 9.5 main reload
    
por volitilov 10.03.2018 / 08:03

Tags