1

I am following "Linux from Scratch" book version 8.0, and I reached section (5.7. Glibc-2.25). When trying to configure glibc I get this error:

These critical programs are missing or too old: gawk

when I write gawk in the terminal, I get this result :

Command 'gawk' is available in '/usr/local/bin/gawk'
The command could not be located because '/usr/local/bin' is not included in the PATH environment variable.
gawk: command not found

Earlier in the book in section 4.5 on page 31, It said:

Create the .bashrc file now:

cat > ~/.bashrc << "EOF"
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
LFS_TGT=$(uname -m)-lfs-linux-gnu
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL LFS_TGT PATH
EOF

which I did.

Update:

Running version-check.sh script from section 2.2 in the book as user lfs gives:

bash, version 4.3.46(1)-release  
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Ubuntu) 2.27
version-check: line 10: bison: command not found
/usr/bin/yacc -> /usr/bin/bison
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.25
diff (GNU diffutils) 3.3
find (GNU findutils) 4.7.0-git
version-check: line 22: gawk: command not found
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
g++ (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
(Ubuntu GLIBC 2.24-3ubuntu1) 2.24
grep (GNU grep) 2.25
gzip 1.6
Linux version 4.8.0-41-generic (buildd@lgw01-18) (gcc version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12) ) #44-Ubuntu SMP Fri Mar 3 15:27:17 UTC 2017
m4 (GNU M4) 1.4.17
GNU Make 4.1
GNU patch 2.7.5
Perl version='5.22.2';
sed (GNU sed) 4.2.2
tar (GNU tar) 1.29
version-check: line 42: makeinfo: command not found
xz (XZ Utils) 5.1.0alpha
g++ compilation OK

but running the same script as user root gives :

bash, version 4.3.46(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Ubuntu) 2.27
bison (GNU Bison) 2.3
/usr/bin/yacc -> /usr/bin/bison
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.25
diff (GNU diffutils) 3.3
find (GNU findutils) 4.7.0-git
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
g++ (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005
(Ubuntu GLIBC 2.24-3ubuntu1) 2.24
grep (GNU grep) 2.25
gzip 1.6
Linux version 4.8.0-41-generic (buildd@lgw01-18) (gcc version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12) ) #44-Ubuntu SMP Fri Mar 3 15:27:17 UTC 2017
m4 (GNU M4) 1.4.17
GNU Make 4.1
GNU patch 2.7.5
Perl version='5.22.2';
sed (GNU sed) 4.2.2
tar (GNU tar) 1.29
texi2any (GNU texinfo) 6.3
xz (XZ Utils) 5.1.0alpha
g++ compilation OK

It seems to me thats because /usr/local/bin is not included in PATH environment variable,But the the book didn't say to add it.

English is not my mother language.

6
  • Have you tried adding '/usr/local/bin' to PATH and see what happens? It doesn't hurt to add it in.
    – sbtkd85
    Mar 15, 2017 at 15:10
  • @sbtkd85 If that is the reason, So why didn't they put it in the book. I don't know if this is a mistake in the book or there is another mistake that I did.
    – Amr Nasser
    Mar 15, 2017 at 15:37
  • I'm not familiar with the book, so I don't know, maybe it is a typo that is fixed in a newer version? Bottom line is, /usr/local/bin is usually where you can put local system-wide binaries/scripts so that all users can execute them. Generally packages don't usually install there, but they can. Having it in your PATH doesn't hurt, especially if you add your own binaries or scripts to there in the future.
    – sbtkd85
    Mar 15, 2017 at 15:39
  • What is your host OS? Also, what are the permissions on /usr/bin/gawk and /usr/bin/texi2any?
    – Munir
    Mar 17, 2017 at 1:29
  • @Munir I'm using ubuntu 16.10. 'gawk' and 'texi2any' are not in '/usr/bin/' they are in '/usr/local/bin'. Should they be in '/usr/bin/' ?
    – Amr Nasser
    Mar 17, 2017 at 1:44

1 Answer 1

1

It's the first pass to build toolchain, so your environment is highly dependant on your host OS.

In chapter 2.2 Host System Requirements there are two scripts:

  • version-check.sh - which prints versions of all packages important to lfs
  • library-check.sh - to check for gmp, mpfr and mpc libs

Did you run both and checked results against versions provided in the book?

Because the error you get:

These critical programs are missing or too old: gawk

is as simple as it is - your host OS has too old gawk.

EDIT: Thanks for update. So gawk version on your host OS is OK. But the problem still is your host OS - for some strange reason some packages are unaccessible for normal (lfs) user, so your host OS doesn't meet system requirements. There is nothing on lfs side to fix. You have to fix your host OS, maybe reinstall those packages?

2
  • updated the question with the results from 'version-chec.sh' script
    – Amr Nasser
    Mar 15, 2017 at 23:00
  • @AmrNasser ok, so gawk version on your host OS is ok. the problem still is your host OS - for some strange reason some packages are unaccessible for normal (lfs) user, so your host OS doesn't meet system requirements. there is nothing on lfs side to fix. you have to fix your host OS, maybe reinstall those packages?
    – rsm
    Mar 15, 2017 at 23:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .