Configuring Glibc
We need to create the /etc/nsswitch.conf file,
because, although Glibc provides defaults when this file is missing or corrupt,
the Glibc defaults don't work well with networking. Also, our time zone needs
to be set up.
Create a new file /etc/nsswitch.conf by running the
following:
cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
publickey: files
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: db files
# End /etc/nsswitch.conf
EOF
To find out what time zone you're in, run the following script:
tzselect
When you've answered a few questions about your location, the script will
output the name of your time zone, something like EST5EDT
or Canada/Eastern. Then create the
/etc/localtime file by running:
cp --remove-destination /usr/share/zoneinfo/Canada/Eastern /etc/localtime
The meaning of the option:
--remove-destination: This is needed to
force removal of the already existing symbolic link. The reason why we copy
instead of symlink is to cover the situation where /usr is
on a separate partition. This could matter, for example, when booted into single
user mode.
Of course, instead of Canada/Eastern, fill in
the name of the time zone that the tzselect script
gave you.
Configuring Dynamic Loader
By default, the dynamic loader
(/lib/ld-linux.so.2) searches through /lib and /usr/lib for dynamic libraries that are needed
by programs when you run them. However, if there are libraries in
directories other than /lib and
/usr/lib, you need to add them to
the /etc/ld.so.conf file for the dynamic
loader to find them. Two directories that are commonly known to contain
additional libraries are /usr/local/lib and /opt/lib, so we add those directories to the
dynamic loader's search path.
Create a new file /etc/ld.so.conf by running the
following:
cat > /etc/ld.so.conf << "EOF"
# Begin /etc/ld.so.conf
/usr/local/lib
/opt/lib
# End /etc/ld.so.conf
EOF