[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problem installing postgresql new packages.



I get the same error as this; I assumed it was a corrupted .deb,
which is probably not the case!

Note I'm ccing the bug I opened, 20123.

> adavis@netpci.com wrote:
>   >I haven't done anything with the old postgresql, but I started the (poorly
>   >typeset) tutorial in the Linux Journal.  Now I figure I might as well
>   >install the new version.  
>   >
>   >libpgsql won't install.  I get an error that the preinstall script exits
>   >with an error of, let's see:
>   >
>   >maan:~# dpkg -i libpgsql*
>   >Selecting previously deselected package libpgsql.
>   >(Reading database ... 42934 files and directories currently installed.)
>   >Unpacking libpgsql (from libpgsql_6.3-2.deb) ...
>   >
>   >dpkg: error processing libpgsql_6.3-2.deb (--install):
>   > subprocess pre-installation script returned error exit status 1
>   > Errors were encountered while processing:
>   >  libpgsql_6.3-2.deb
> 
> My guess is that the data directory is still there but with no PG_VERSION
> file in it, so that
>    installed=`cat ${PGDATA}/PG_VERSION 2>/dev/null`
> gives a return code of 1.

Not so:

root@burrito:/home/apharris/uld# cat /var/lib/postgresql/data/PG_VERSION 
6.1

However, you are correct anyhow, since the script apparently isn't
reading PGDATA from /etc/postgresql apparantly.  Doing a test run on
the script:

root@burrito:/home/apharris/uld# sh -x libpgsql.preinst upgrade 6.3-1
[...]
+ '[' -d /var/postgres/data ']'
++ cat /var/postgres/data/PG_VERSION
+ installed=

*booom*

root@burrito:/home/apharris/uld# echo $?
1

Some more clues:

root@burrito:/home/apharris/uld# grep PGDATA /etc/postgresql/postgresql.env
PGDATA=${POSTGRES_DATA:-/var/lib/postgresql/data}
export PGLIB PGDATA
root@burrito:/home/apharris/uld# ls /var/lib/postgresql/data
PG_VERSION      pg_defaults     pg_group        pg_log          pg_time
base            pg_demon        pg_hba.conf     pg_magic        pg_user
pg_database     pg_geqo.sample  pg_hosts        pg_server       pg_variable
root@burrito:/home/apharris/uld# ls /var/postgresql/data
ls: /var/postgresql/data: No such file or directory

>  The `set -e' at the top of the script would
> then make it abort.  I'm fixing this in 6.3-3.  In the meantime, since
> you never used the old postgresql, you won't have any data, so just delete
> the $PGDATA directory and reinstall.  You may need to recreate $PGDATA
> afterwards.

I guess the solution would be to pull PGDATA from the conf file.

I was able to workaround by doing:

cd /var/postgres
rmdir data	# this dir was empty
ln -s ../lib/postgresql/data data

Now the script seems to run fine.

.....A. P. Harris...apharris@onShore.com...<URL:http://www.onShore.com/>


--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: