In page 1 of the Ubuntu Intrepid setup, we completed the ssh configuration along with a basic iptables install.
Let's move on and install some personal configuration files to make our life easier. Once done, we can update the install and create a solid base for the 'meat' of the server.
OS check and Free
First thing is to confirm what OS we're using. We know we should be using Ubuntu Intrepid but let's see:
You should get an output similar to this:
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=8.10 DISTRIB_CODENAME=intrepid DISTRIB_DESCRIPTION="Ubuntu 8.10"
Good. Memory usage should be very low at this point but let's check using 'free -m' (the -m suffix displays the result in MB's which I find easier to read):
It's nice to know what is going on so let's look at that output:
. total used free shared buffers cached Mem: 256 58 197 0 2 19 -/+ buffers/cache: 35 220 Swap: 511 0 511
The line to take notice of is the second one as the first line includes cached memory - in this demo slice I have 256MB of useable memory with 35MB actually used, 220MB free and no swap used. Nice.
Let's make the terminal a bit more attractive and a bit more informative by adding a few lines to our . bashrc file.
Add the next few lines at the end of the existing text. The following line will make the terminal show the server name in colour and display the working directory (the directory we are in) in a different colour:
export PS1='\[\033[0;35m\]\h\[\033[0;33m\] \w\[\033[00m\]: '
If you look at the existing content of the .bashrc file, you may notice some 'PS1' content already - you can change the existing content if you prefer. This method simply changes the default output.
Now we can add aliases to the file. Aliases are short cuts to commands or sequences of commands. I've included a few below but you can have as many or as few as you want.
alias free="free -m" alias update="sudo aptitude update" alias install="sudo aptitude install" alias upgrade="sudo aptitude safe-upgrade" alias remove="sudo aptitude remove"
The examples above are pretty simple. Instead of typing 'free -m' every time I want to look at the memory usage, I just type 'free. Typing 'sudo aptitude install' can get tedious, so I just type 'install'.
I still need to provide my password for the sudo command to work, but it is more productive/quicker/easier to have short cuts.
To activate the changes issue this command:
You should now see the slice name in purple and the working directory in brown.
To change the colours to your choosing, adjust the 0;35m and the 0;33m values in the 'export PS1' line of your .bashrc. For example:
export PS1='\[\033[0;32m\]\h\[\033[0;36m\] \w\[\033[00m\]: '
would give you a green and blue output.
The Ubuntu Intrepid Slice comes with a basic set of repositories but let's have a check to see what sources we are using:
sudo nano /etc/apt/sources.list
You should see the default list as follows:
deb http://archive.ubuntu.com/ubuntu/ intrepid main restricted universe deb-src http://archive.ubuntu.com/ubuntu/ intrepid main restricted universe deb http://archive.ubuntu.com/ubuntu/ intrepid-updates main restricted universe deb-src http://archive.ubuntu.com/ubuntu/ intrepid-updates main restricted universe deb http://security.ubuntu.com/ubuntu intrepid-security main restricted universe deb-src http://security.ubuntu.com/ubuntu intrepid-security main restricted universe
You can, of course, add more repositories whenever you want to but I would just give a word of caution: Some of the available repositories are not officially supported and may not receive any security updates should a flaw be discovered.
Keep in mind it is a server we are building and security and stability are paramount.
Now we can update the sources so we have the latest list of software packages:
sudo aptitude update
NOTE: If you have used the .bashrc shown above you just need to enter 'update' as the alias will use the entire command. I've put the whole thing here so you know what is happening.
Remember the Intrepid Slice is a bare bones install so we need set the system locale:
sudo locale-gen en_GB.UTF-8 ... sudo /usr/sbin/update-locale LANG=en_GB.UTF-8
NOTE: 'US' may be substituted for 'GB' if you so prefer.
Now we have updated the sources.list repositories and set the locale, let's see if there are any upgrade options:
sudo aptitude safe-upgrade
Followed by a:
sudo aptitude full-upgrade
Once any updates have been installed, we can move on to installing some essential packages.
Ubuntu Intrepid has some handy meta-packages that include a set of pre-defined programmes needed for a single purpose.
So instead of installing a dozen different package names, you can install just one meta-package. One such package is called 'build-essential'. Issue the command:
sudo aptitude install build-essential
Notice the programmes that are to be installed include gcc, make, patch and so on. All these are needed for many other programmes to install properly. A neat system indeed.
Enter 'Y' and install them.
Quite a lot happening here but now we have a secured and updated Slice.
The console is now informative and less drab, locales have been configured and the meta-package build-essential has been installed.
If you do this more than once or twice it doesn't take long at all and we now have the ideal base to install the 'meat' of our server.