CVS 20020914 bzip2 install failure

Bill Maltby LFS Related lfsbill at
Mon Sep 16 20:50:04 PDT 2002

I don't know if I'm going about this right - first time submitting what I
*think* is a problem. Tried to install bzip2 in chapter 06. Ran the fol-
lowing. Had a failure the first time through.

  make -f Makefile-libbz2_so &&
  make &&
  make PREFIX=/usr install &&
  cp bzip2-shared /bin/bzip2 &&
  ln -s &&
  cp -a* /lib &&
  rm /lib/ &&
  ln -s ../../lib/ /usr/lib/ &&
  rm /usr/bin/{bunzip2,bzcat,bzip2} &&
  mv /usr/bin/{bzip2recover,bzless,bzmore} /bin &&
  ln -s bzip2 /bin/bunzip2 &&
  ln -s bzip2 /bin/bzcat

Tail of the results are below.

if ( test ! -d /usr/include ) ; then mkdir -p /usr/include ; fi
cp -f bzip2 /usr/bin/bzip2
cp -f bzip2 /usr/bin/bunzip2
cp -f bzip2 /usr/bin/bzcat
cp -f bzip2recover /usr/bin/bzip2recover
chmod a+x /usr/bin/bzip2
chmod a+x /usr/bin/bunzip2
chmod a+x /usr/bin/bzcat
chmod a+x /usr/bin/bzip2recover
cp -f bzip2.1 /usr/man/man1
chmod a+r /usr/man/man1/bzip2.1
cp -f bzlib.h /usr/include
chmod a+r /usr/include/bzlib.h
cp -f libbz2.a /usr/lib
chmod a+r /usr/lib/libbz2.a
cp -f bzgrep /usr/bin/bzgrep
ln /usr/bin/bzgrep /usr/bin/bzegrep
ln: `/usr/bin/bzegrep': File exists
make: *** [install] Error 1
===> End bzip2 RC=1 bzip2 real 0m52.327s user 0m50.330s sys 0m1.960s <===

I removed the file /usr/bin/bzegrep, did fresh untar and ran again. Same
result. In the top Makefile, at line 81 is

  ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep

Another file, bzgrep.1 is the only other place a grep -rl shows
referencing bzegrep. An ls of /usr/bin/bzegrep and bzgrep shows that they
are hardlinked together with bzfgrep too. Removed all three and reran.
Same results.

I am not sure if all this results from a failure on the initial install or
not. I think not, because it happened (IIRC) when I removed the files
before restart.

The README instructions have some differences to the LFS book. The most
significant is that it claims the default install directory is /usr, so
apparently the PREFIX=/usr is not needed?

BTW, the recent aggressive changing of ln -sf to ln -s is for the birds.
They are only good if you assume that /usr/bin, /bin, /lib, /usr/lib et
al will be "emptied" of the affected components before a restart is done.

Oh, wait! I see. There are to be no failures or restarts. Only brand new
installs! ;)

Anyway, I have attached a patch for the bzip2 directory, in case I got it
right (always doubtful) and a modified LFS script that applies the patch
and runs without the PREFIX=/usr. I left out my changes for handling the
hard and soft link failures. If it turns out they would be useful, I can
send them, but I took the approach of removing rather than ln -sf.

If it is confirmed that the original makefile is a problem (would be on
upgrade too?), I will be glad to do a bug report to the maintainers.

Bill Maltby
billm at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzip2-1.0.2-1.patch.bz2
Type: application/octet-stream
Size: 374 bytes
Desc: Well, shouldn't have compressed it
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzip2-script.diffs.bz2
Type: application/octet-stream
Size: 277 bytes
Desc: Another I shouldn't have compressed
URL: <>

More information about the lfs-dev mailing list