Install all software as an unprivileged user When you are logged in as root during chapter 5, it is possible that some files of your host system will be overwritten by the ones you'll build in chapter 5. There can be all kinds of reasons for this to happen, for example because the $LFS environment variable is not set. Overwriting some files from your host system will most likely cause all kinds of problems, so it's a good idea to be logged in as an unprivileged user during chapter 5. To make sure the environment is as clean as possible, we'll create a new user "lfs" that can be used while building the static installation. Issuing the following commands as root will create a new user "lfs": useradd -s /bin/bash -m lfs && passwd lfs Now we need to give proper permissions to the $LFS/static directory so user "lfs" can write to it: chown -R lfs $LFS/static Now you can login as user "lfs". You can do this two ways: either the normal way through the console or the display manager, or with su - lfs. When you're working as user "lfs", type the following commands to set up a good environment to work in: cat > ~/.bash_profile << "EOF" umask 022 LFS=/mnt/lfs LC_ALL=POSIX export LFS LC_ALL EOF source ~/.bash_profile This profile makes sure the umask is set to 022 so newly created files and directories will have the correct permissions. It is advisable to keep this setting throughout your LFS installation. Also, the $LFS and $LC_ALL environment variables are set. $LFS has been explained in previous chapters already. $LC_ALL is a variable that is used for internationalization. When your host distribution uses a glibc version older than 2.2.4, having $LC_ALL set to something else than "C" or "POSIX" while working through chapter 5 may cause trouble when you exit the chroot environment of chapter 6 and try to return to it. By setting this to "POSIX" ("C" is an alias for "POSIX") we ensure that everything will work as expected in the chroot environment.