Ubuntu 11.04 Generic - The SysAdmin Way - Page 5
03.01 Extended Generic Ubuntu Installation
Now that we have a nice clean installation, we will do some basic system configuration and tuning. Let's start with /etc/default and the files located in that folder.
Log in using root account, or a normal user account if you created one. Since all steps in this part of installation require elevated privileges, for normal user you will have to add sudo in front of every command. If using normal user account, you can become root by typing
sudo su
To enable root account type the following
sudo passwd root
Type in the root password. Now you can directly log in as root.
Customize /etc/default
Let's start with /etc/default/bootlogd. Bootlogd runs in the background and copies all strings sent to the /dev/console device to a logfile. This is useful if you want to check that all services you configured to start with the system are really started. You can do this by listing the content of /var/log/boot.log file.
vi /etc/default/bootlogd
#Run bootlogd at startup ? BOOTLOGD_ENABLE=Yes |
Next we are going to edit /etc/default/ntpdate. There are several packages related to NTP in the Ubuntu archive, probably the simplest is the client ntpdate. We will configure it to use our local time provider (mine is zg1.ntp.carnet.hr).
vi /etc/default/ntpdate
Locate and edit the following line:
# List of NTP servers to use (Separate multiple servers with spaces.) # Not used if NTPDATE_USE_NTP_CONF is yes. NTPSERVERS="zg1.ntp.carnet.hr" |
Next we are going to reduce the number of active consoles at the startup. We will never use all the virtual consoles (TTY) that is provided with most Linux distribution. Why leave it there and let it eat memory. You can decrease startup time by removing unwanted virtual console or TTY.
vi /etc/default/console-setup
Locate and edit the following line:
# Setup these consoles. Most people do not need to change this. ACTIVE_CONSOLES="/dev/tty[1-2]" |
Now we need to turn off those extra consoles from actually starting themselves at startup. We need to edit tty6.conf, tty5.conf, tty4.conf and tty3.conf files located at /etc/init/ folder. The procedure is the same for every file.
vi /etc/init/tty6.conf
Locate and comment the following line:
# start on runlevel [23] # stop on runlevel [!23] # respawn # exec /sbin/getty -8 38400 tty6 |
Let's edit our next file. We still don't have need for IPv6, especially for our Desktops at local networks so let's disable it at startup by editiong grub config file.
vi /etc/default/grub
Locate and edit the following line:
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1" |
Now we need to confirm this change by executing the following command:
update-grub
Now we will prevent system messages from being translated, by editing locale file.
vi /etc/default/locale
Add the following line at the bottom:
LC_MESSAGES=POSIX |
To confirm this change logout from your console and log back in again.
Next we will edit FSCKFIX line in rcS file. When Linux checks the file system, and finds error, fsck is called with -a option, and will only repair if no major damages are found, but if you want that fsck to try to fix the file system no matter the magnitude of the error, change FSCKFIX variable to yes.
vi /etc/default/rcS
Locate and edit the following line:
FSCKFIX=yes |
That's it. We are done editing /etc/default files. Now let's finish the extended step of generic installation by configuring a few more options.
Let's put it to use
We have installed Ubuntu, and we have a nice clean image so far, yey for us! But other than looking at the blinking command prompt, there is no much use from what we have. So let's make it useful! Let's start with configuration of debconf, a software utility for performing system-wide configuration tasks on Unix-like operating systems.
dpkg-reconfigure debconf
Select Dialog and press Enter.
As a Sys Admin, yes I am a control freak. So select low!
In the initial setup of our installation we have skipped package management configuration. We are going to configure it now, by editing the following file:
vi /etc/apt/sources.list
If there is any content present, delete it. All of it, and insert the following lines:
deb http://archive.ubuntu.com/ubuntu natty main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu natty-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu natty-security main restricted universe multiverse |
What we have done is enable main distribution (natty) repositories and updates/security repositories. This will be enough for most of software installations there will be needed.
If you want you can delete 10-help-text file. It prints help text associated with the distro copyright after every login. I don't like that so I delete it.
rm /etc/update-motd.d/10-help-text