Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.


  Search this Thread
Old 10-12-2009, 04:43 PM   #1
LQ Newbie
Registered: Dec 2006
Posts: 4

Rep: Reputation: 0
chapter 6, want to use bzip2 but it fails with bash: bzip2: No such file or directory

Hi everybody,

I'm having trouble using bzip2 in the chroot enviroment in chapter 6.

I compiled bzip2 in chapter 5 and it worked wounderfull. I try to execute my compiled bzip2 in the host enviroment, and all is working nicely.

But once I chroot, it stops to work and returns a error message that doesn't help me any further.

bash: bzip2: No such file or directory
I tried every thing, I went directly into the /tools/bin dir and did a
./bzip2, it returnes the same problem. Then I checked my path:
$: echo $PATH
it is like the file bzip2 doesn't exist, but it is there, I checked with a

ls -l /tools/bin/bzip2
I was so desperate, that I desided to put some lines into the main function in bzip2.c just to see if they where executed, but the program doesn't even get to that point.

What can I do?

Any help is greatly apreciated
Old 10-12-2009, 08:36 PM   #2
LQ Newbie
Registered: Dec 2006
Posts: 4

Original Poster
Rep: Reputation: 0
OK I think I found the problem. But still I'm not able to solve it.

I used the tool readelf -l /tools/bin/bzip2 to find out what libraries the binary depends on. And guess what.

it depends on a binary in the /lib/ directory which is not populated at this point. To be more speciffic it depends on wgich was present in my host system, but is not pressent in my chroot enviroment.

I think this is a bug in the LFS book, but I don't know where to post it can somebody tell me where?

Thanks for your help!!

Old 10-12-2009, 08:58 PM   #3
LQ Newbie
Registered: Dec 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Now I solved the problem, with a little hack.

I created a symbolic link inside the /lib/ directory of my chroot env, to point to /tools/lib/ and this way I got bzip2 to work propperly. Now this works fine but,you have to delete this link once you install Glibc because this packages creates the actual file in the right directory. This is why nobody has noticed this bug. The third package you install in LFS chapter 6 is Glibc

Gosh this is my first bug I find in an open source proyect, I am so happy!!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compressing directory with bzip2 Haiyadragon Linux - Newbie 4 12-19-2016 03:51 PM
bzip2: Compressed file ends unexpectedly Teenna Debian 4 03-22-2012 05:34 AM
Bzip2 and File Size Limits floog Linux - Software 3 02-27-2007 10:14 AM
change bzip2 output file permisions ricksoft Linux - Security 5 08-18-2006 04:05 PM
kdelibs missing bzip2 file cain_eve Linux - Software 2 03-08-2005 03:48 PM > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 12:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration