can not install postgresql-8.2 on amd 64 on ubuntu 7.04

Asked by parvez

I was trying to installing postgresql-8.2 on AMD64 bit Machine on Ubuntu 7.04. But its broken in the middle of the installation processes. The out put is below:

~# apt-get install postgresql-8.2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
 postgresql-common
Suggested packages:
 oidentd ident-server
The following NEW packages will be installed
 postgresql-8.2 postgresql-common
0 upgraded, 2 newly installed, 0 to remove and 9 not upgraded.
Need to get 0B/3798kB of archives.
After unpacking 18.6MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
Selecting previously deselected package postgresql-common.
(Reading database ... 113340 files and directories currently installed.)
Unpacking postgresql-common (from .../postgresql-common_73_all.deb) ...
Selecting previously deselected package postgresql-8.2.
Unpacking postgresql-8.2 (from .../postgresql-8.2_8.2.5-0ubuntu0.7.04.1_amd64.deb) ...
Setting up postgresql-common (73) ...
chown: `postgres:postgres': invalid group
dpkg: error processing postgresql-common (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql-8.2:
 postgresql-8.2 depends on postgresql-common (>= 63); however:
 Package postgresql-common is not configured yet.
dpkg: error processing postgresql-8.2 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 postgresql-common
 postgresql-8.2
E: Sub-process /usr/bin/dpkg returned an error code (1)

I will be very grateful if anybody can fix this problem.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu postgresql-8.2 Edit question
Assignee:
No assignee Edit question
Solved by:
Andrea Corbellini
Solved:
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

Try to add postgres user:

sudo adduser postgres

Hope This Help

Revision history for this message
parvez (golam-parvez) said :
#2

This does not solve my problem. User postgres is already there. I want a clean installation which will not broke the installation processes. Here is the output about user postgres.

~# id -u postgres
1004

it means that user postgres is there.

I think the problem is about group and ownership.

Anybody can help????

Revision history for this message
Andrea Corbellini (andrea.corbellini) said :
#3

It says the *group* postgres is missed, not the *user* ;)
I hope this will help!

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#4

Are you using the root user to install package...?

sudo apt-get install postgresql-8.2

May help you

Revision history for this message
parvez (golam-parvez) said :
#5

I think Andrea Corbellini is right its a problem with groups. I tryed with this command:

# id -u postgres
1004

That means group "postgres" is already there. Then I tryed with others:

# dpkg --configure postgresql-common
Setting up postgresql-common (73) ...
chown: `postgres:postgres': invalid group
dpkg: error processing postgresql-common (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 postgresql-common

But here its showing invalid group. If you look up in postinsta script you will find following command:
    # ensure home directory ownership
    chown postgres:postgres /var/lib/postgresql

I think which is not working. Any Idea why?

To marcobra i think I can install any package as a root it should not cause any problem.

Revision history for this message
Andrea Corbellini (andrea.corbellini) said :
#6

`id -u postgres` means the user postegres exists, not the group. Use -g instead of -u:
id -g postgres

Revision history for this message
parvez (golam-parvez) said :
#7

sorry about that. here it goes:
~# id -g postgres
100

grooup is there.

Revision history for this message
Andrea Corbellini (andrea.corbellini) said :
#8

Try to run
sudo chown postgres:postgres /var/lib/postgresql
by hand.

Revision history for this message
Andrea Corbellini (andrea.corbellini) said :
#9

Sorry, I missed `-v`:
sudo chown -v postgres:postgres /var/lib/postgresql

Revision history for this message
parvez (golam-parvez) said :
#10

I tryed with that one. And it gives me the following errors:
~# chown -v postgres:postgres /var/lib/postgresql
chown: `postgres:postgres': invalid group

I am trying to give you more information about group and user

~# id postgres
uid=1004(postgres) gid=100(users) groups=100(users)

It seems to me the installation script of postgresql-common is creating user postgres but its failing to create group call postgres. And here is the command which is using in the postinst script of postgresql-common:

    if ! getent passwd postgres > /dev/null; then
        adduser --system --quiet --home /var/lib/postgresql --no-create-home \
            --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres

I think this command is failing to create group. Any suggesion?

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#11

What is the answer of:

getent passwd postgres

if you type it from terminal

Thank you

Revision history for this message
parvez (golam-parvez) said :
#12

The answer is

~# getent passwd postgres
postgres:$2a$10$gHUOsTHtc2g00WjotW3h6.MNbBE8SION.bScdvQMK0NOGIeo1TvXy:1004:100::/home/postgres:/bin/bash

Revision history for this message
parvez (golam-parvez) said :
#13

but if I tryed with the following command it gives me something else:

~#

NO

Revision history for this message
parvez (golam-parvez) said :
#14

sorry i am typing it again

~# if ! getent passwd postgres > /dev/null; then echo YES; else echo NO; fi

NO

It seems the command from postgresql-common postinst is not executing.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#15

Try to remove postgres user and try to install:

sudo userdel postgres
sudo groupdel postgres

Hope this help

Revision history for this message
parvez (golam-parvez) said :
#16

As you said.

:~# userdel postgres
userdel: error deleting password entry
userdel: error deleting shadow password entry

:~# groupdel postgres
groupdel: group postgres does not exist

:~# apt-get install postgresql-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgresql-common is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
2 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Setting up postgresql-common (73) ...
chown: `postgres:postgres': invalid group
dpkg: error processing postgresql-common (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql-8.2:
 postgresql-8.2 depends on postgresql-common (>= 63); however:
  Package postgresql-common is not configured yet.
dpkg: error processing postgresql-8.2 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 postgresql-common
 postgresql-8.2
E: Sub-process /usr/bin/dpkg returned an error code (1)

Same problem. Any idea.

Revision history for this message
parvez (golam-parvez) said :
#17

Forgot to tell I am using nis.

Revision history for this message
Best Andrea Corbellini (andrea.corbellini) said :
#18

Try editing files /etc/group, /etc/passwd and /etc/shadow by hand.

Revision history for this message
parvez (golam-parvez) said :
#19

yes its work perfectly after creating group postgres manualy. I do not had any postgres group on nis files thats why it did not work. Thank you for your suggetion and valuable time. But I was wondering postgrsql package installation script will takecare these things by its self. Should we tell the maintainer about these problem and make him clear about the situation? What do you reckon?

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#20

I think there may be some issue related with shadow password...

HTH

Revision history for this message
Andrea Corbellini (andrea.corbellini) said :
#21

First mark the question as Solved :D
Then, if you want to make ubuntu (and postgresql) better, you can report this issue as bug.

Revision history for this message
parvez (golam-parvez) said :
#22

Thanks for your suggesion and your time.

Revision history for this message
parvez (golam-parvez) said :
#23

Thanks Andrea Corbellini, that solved my question.

Revision history for this message
parvez (golam-parvez) said :
#24

Though its solve the problem of installing postgresql packages. Still I need a clean installation because my other packages are depends on postgresql-8.2 and its scripts can not handle shadow password. i will move on this issue as a bug. But thanks you all who helped me.

Revision history for this message
parvez (golam-parvez) said :
#25

Hi

Thanks for mail. If the groups does not exits in nis or in any where, I
think it should create the groups in locally.

Md. Golam Parvez

On Feb 3, 2008 12:22 PM, Martin Pitt <email address hidden>
wrote:

> Bug #162606 status changed in postgresql-common in ubuntu:
>
> Confirmed => Incomplete
>
> Status change explanation given by Martin Pitt:
>
> So, did I understand this correctly? User postgres already existed, but
> group postgres didn't? adduser will not create the group only in this
> case.
>
> I could create the group separately, but usually this situation means
> that you have a half-broken installation already. If you use NIS
> authentication, then you should have both users and groups in nis, not
> just users. Will 'addgroup postgresql' create the group in NIS for you
> or just locally?
>
>
> https://bugs.edge.launchpad.net/ubuntu/+source/postgresql-common/+bug/162606
> "can not install postgresql-8.2 on amd 64 on ubuntu 7.04"
>
> This bug is linked to #17811.
> can not install postgresql-8.2 on amd 64 on ubuntu 7.04
> https://answers.edge.launchpad.net/ubuntu/+question/17811
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>