dpkg make failed

Asked by curiogeo

I have tried to install dpkg from a tarball and was able to:
./configure
successfully.

When I run the make command I get the following errors:
echo "#define DPKG_VERSION \"1.10.27\" /* This line modified by Makefile */" > version.h
make all-include all-optlib all-lib all-dpkg-deb all-split all-scripts all-utils all-main all-dselect all-po all-methods all-man all-doc
make[1]: Entering directory `/root/dpkg/dpkg-1.10.27ubuntu1.1'
make -w -C "include" "all"
make[2]: Entering directory `/root/dpkg/dpkg-1.10.27ubuntu1.1/include'
sed -e 's,#CONFIGDIR#,/usr/etc/dpkg,' \
                -e 's,#ADMINDIR#,/usr/lib/db,' \
                -e 's,#LIBDIR#,/usr/lib/dpkg,' dpkg.h.in > dpkg.h
make[2]: Leaving directory `/root/dpkg/dpkg-1.10.27ubuntu1.1/include'
make -w -C "optlib" "all"
make[2]: Entering directory `/root/dpkg/dpkg-1.10.27ubuntu1.1/optlib'
gcc -g -O2 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast -Wcast-qual -Wcast-align -Winline -Wmissing-noreturn -Wsign-compare -DHAVE_CONFIG_H -D_GNU_SOURCE -DLOCALEDIR=\"/usr/share/locale\" -I../intl -I../intl -I../include -I.. -I. -I../include -I.. -I. -I../optlib -DUSE_ZLIB -DUSE_BZ2LIB -c getopt.c
gcc -g -O2 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast -Wcast-qual -Wcast-align -Winline -Wmissing-noreturn -Wsign-compare -DHAVE_CONFIG_H -D_GNU_SOURCE -DLOCALEDIR=\"/usr/share/locale\" -I../intl -I../intl -I../include -I.. -I. -I../include -I.. -I. -I../optlib -DUSE_ZLIB -DUSE_BZ2LIB -c getopt1.c
gcc -g -O2 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast -Wcast-qual -Wcast-align -Winline -Wmissing-noreturn -Wsign-compare -DHAVE_CONFIG_H -D_GNU_SOURCE -DLOCALEDIR=\"/usr/share/locale\" -I../intl -I../intl -I../include -I.. -I. -I../include -I.. -I. -I../optlib -DUSE_ZLIB -DUSE_BZ2LIB -c long-options.c
gcc -g -O2 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast -Wcast-qual -Wcast-align -Winline -Wmissing-noreturn -Wsign-compare -DHAVE_CONFIG_H -D_GNU_SOURCE -DLOCALEDIR=\"/usr/share/locale\" -I../intl -I../intl -I../include -I.. -I. -I../include -I.. -I. -I../optlib -DUSE_ZLIB -DUSE_BZ2LIB -c closeout.c
gcc -g -O2 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast -Wcast-qual -Wcast-align -Winline -Wmissing-noreturn -Wsign-compare -DHAVE_CONFIG_H -D_GNU_SOURCE -DLOCALEDIR=\"/usr/share/locale\" -I../intl -I../intl -I../include -I.. -I. -I../include -I.. -I. -I../optlib -DUSE_ZLIB -DUSE_BZ2LIB -c obstack.c
ar r libopt.a getopt.o getopt1.o long-options.o closeout.o obstack.o
ar: creating libopt.a
ranlib libopt.a
make[2]: Leaving directory `/root/dpkg/dpkg-1.10.27ubuntu1.1/optlib'
make -w -C "lib" "all"
make[2]: Entering directory `/root/dpkg/dpkg-1.10.27ubuntu1.1/lib'
gcc -g -O2 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast -Wcast-qual -Wcast-align -Winline -Wmissing-noreturn -Wsign-compare -DHAVE_CONFIG_H -D_GNU_SOURCE -DLOCALEDIR=\"/usr/share/locale\" -I../intl -I../intl -I../include -I.. -I. -I../include -I.. -I. -I../optlib -DUSE_ZLIB -DUSE_BZ2LIB -DCOPYINGFILE=\"/usr/share/doc/dpkg/copyright\" -c compat.c
gcc -g -O2 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast -Wcast-qual -Wcast-align -Winline -Wmissing-noreturn -Wsign-compare -DHAVE_CONFIG_H -D_GNU_SOURCE -DLOCALEDIR=\"/usr/share/locale\" -I../intl -I../intl -I../include -I.. -I. -I../include -I.. -I. -I../optlib -DUSE_ZLIB -DUSE_BZ2LIB -DCOPYINGFILE=\"/usr/share/doc/dpkg/copyright\" -c compression.c
compression.c:12:19: error: bzlib.h: No such file or directory
compression.c: In function âdecompress_catâ:
compression.c:67: error: âBZFILEâ undeclared (first use in this function)
compression.c:67: error: (Each undeclared identifier is reported only once
compression.c:67: error: for each function it appears in.)
compression.c:67: error: âbzfileâ undeclared (first use in this function)
compression.c:67: warning: implicit declaration of function âBZ2_bzdopenâ
compression.c:67: warning: nested extern declaration of âBZ2_bzdopenâ
compression.c:68: warning: implicit declaration of function âBZ2_bzreadâ
compression.c:68: warning: nested extern declaration of âBZ2_bzreadâ
compression.c:71: warning: implicit declaration of function âBZ2_bzerrorâ
compression.c:71: warning: nested extern declaration of âBZ2_bzerrorâ
compression.c:71: warning: initialization makes pointer from integer without a cast
compression.c: In function âcompress_catâ:
compression.c:164: error: âBZFILEâ undeclared (first use in this function)
compression.c:164: error: âbzfileâ undeclared (first use in this function)
compression.c:173: warning: implicit declaration of function âBZ2_bzwriteâ
compression.c:173: warning: nested extern declaration of âBZ2_bzwriteâ
compression.c:176: warning: initialization makes pointer from integer without a cast
compression.c:177: error: âBZ_IO_ERRORâ undeclared (first use in this function)
compression.c:186: warning: implicit declaration of function âBZ2_bzcloseâ
compression.c:186: warning: nested extern declaration of âBZ2_bzcloseâ
make[2]: *** [compression.o] Error 1
make[2]: Leaving directory `/root/dpkg/dpkg-1.10.27ubuntu1.1/lib'
make[1]: *** [all-lib] Error 2
make[1]: Leaving directory `/root/dpkg/dpkg-1.10.27ubuntu1.1'
make: *** [all-recursive] Error 2

Should I submit this as a bug or is my OS the root cause of this problem?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jayson Vaughn (thedonvaughn) said :
#1

Hello,
Thank you for your question. It looks like according to your error, that it can not find bzlib.h . Do you have zlib1g-dev package installed? I believe that is required to to compile against bzlib

Revision history for this message
Jayson Vaughn (thedonvaughn) said :
#2

Correct, install "libbz2-dev" . My apologizes

Revision history for this message
Benoit Malet (benoit-malet) said :
#3

Hello !

If you want to get dpkg, maybe the easiest way is to get it via Synaptic ...

As for your compilation problem, my guess is that you don't have bz2lib installed (or at least not at the expected place)

Regards,
Benoît

Revision history for this message
Jayson Vaughn (thedonvaughn) said :
#4

...Meant to say correction. I'm on a roll :)

Revision history for this message
Jayson Vaughn (thedonvaughn) said :
#5

Might I ask btw, why are you needing to re-install dpkg?
It should already be installed with Ubuntu. One easy solution, if you have aptitude: "sudo aptitude reinstall dpkg"

If you need to compile it, just install "libbz2-dev" package for bzlib.h

Revision history for this message
curiogeo (damani-best) said :
#6

I am reinstalling because my original dpkg is corrupt and i cannot use aptitude, apt-get or synaptic to download packages.

I am getting a segmentation fault when I try to run dpkg so i was hoping to remove it and reinstall it.

How do I remove a program in ubuntu?

So here are the results of the attempt to install dpkg after a makeinstall of libbz2-dev:

/dpkg-1.10.27ubuntu1.1# make
make all-include all-optlib all-lib all-dpkg-deb all-split all-scripts all-utils all-main all-dselect all-po all-methods all-man all-doc
make[1]: Entering directory `/root/dpkg/dpkg-1.10.27ubuntu1.1'
make -w -C "include" "all"
make[2]: Entering directory `/root/dpkg/dpkg-1.10.27ubuntu1.1/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/dpkg/dpkg-1.10.27ubuntu1.1/include'
make -w -C "optlib" "all"
make[2]: Entering directory `/root/dpkg/dpkg-1.10.27ubuntu1.1/optlib'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/dpkg/dpkg-1.10.27ubuntu1.1/optlib'
make -w -C "lib" "all"
make[2]: Entering directory `/root/dpkg/dpkg-1.10.27ubuntu1.1/lib'
gcc -g -O2 -Wall -Wwrite-strings -Wpointer-arith -Wimplicit -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast -Wcast-qual -Wcast-align -Winline -Wmissing-noreturn -Wsign-compare -DHAVE_CONFIG_H -D_GNU_SOURCE -DLOCALEDIR=\"/usr/share/locale\" -I../intl -I../intl -I../include -I.. -I. -I../include -I.. -I. -I../optlib -DUSE_ZLIB -DUSE_BZ2LIB -DCOPYINGFILE=\"/usr/share/doc/dpkg/copyright\" -c dump.c
In file included from dump.c:37:
../include/parsedump.h:33: error: array type has incomplete element type
dump.c: In function âw_charfieldâ:
dump.c:95: warning: cast discards qualifiers from pointer target type
dump.c: In function âw_booleandefnoâ:
dump.c:133: warning: cast discards qualifiers from pointer target type
make[2]: *** [dump.o] Error 1
make[2]: Leaving directory `/root/dpkg/dpkg-1.10.27ubuntu1.1/lib'
make[1]: *** [all-lib] Error 2
make[1]: Leaving directory `/root/dpkg/dpkg-1.10.27ubuntu1.1'
make: *** [all-recursive] Error 2

Doesn't seem drastic but I still cannot deciper it.

Revision history for this message
Benoit Malet (benoit-malet) said :
#7

Hello !

Did you do a make clean before trying to compile again ?

Regards,
Benoît

Can you help with this problem?

Provide an answer of your own, or ask curiogeo for more information if necessary.

To post a message you must log in.