Flexion.Org
Bad grammar and typos for total strangers
Wiki › Debian Essentials
Wiki Index All Recent Edit Bottom

Debian Essentials

1.   The Essentials
1.1   Linode Stuff
1.2   Essential Stuff
1.3   Time
1.4   File Compression Tools
1.5   Colourised Prompt
1.6   Syntax Highlighting

The Essentials

Some essential tools and configurations I need in my life :-P

Linode Stuff

I have a Linode VPS and the Ubuntu image requires some love ;-)

Ubuntu Minimal and Standard

I have a Linode VPS and the Ubuntu image doesn't include the minimal and standard meta packages.

 aptitude install ubuntu-minimal ubuntu-standard

Kernel Modules

The Linode server also need a directory creating so that 'depmod' works.

 mkdir -p /lib/modules/`uname -r`
 depmod -a

Locale

When some packages were being installed/upgraded the following warning was being displayed.

 perl: warning: Setting locale failed.
 perl: warning: Please check that your locale settings:
 	LANGUAGE = (unset),
 	LC_ALL = (unset),
 	LANG = "en_GB.UTF-8"
     are supported and installed on your system.
 perl: warning: Falling back to the standard locale ("C").

This is a common problem with installations that used 'debootstrap'.

First make sure the locales packages are installed

 aptitude install locales localeconf

Find out which locale your system is currently configure to use.

 dpkg-reconfigure locales

Generate the locale your system is configure to use. In my case, from the original error above...

 sudo locale-gen en_GB.UTF-8

Finally, create '/etc/default/locale'.

 nano /etc/default/locale

Add the following, then save the file.

 LANG="en_GB.UTF-8"

References

Essential Stuff

These are tools I have found I use on a daily basis or just can't do without. They may or may not be installed by default, it depends on the distro and/or image used.

 aptitude install curl dnsutils file ftp less loco pciutils psmisc screen sudo telnet tree vim wget

Time

If the timezone is not set or is wrong, the root user can run 'tzconfig' to configure it after installation or on Debian and Ubuntu you can run the following...

 dpkg-reconfigure tzdata

If you do not have root privileges or want to set for yourself a different timezone than the one the system uses, you can set the environment variable TZ. Use the command 'tzselect' to show you what changes you need to make.

 tzselect

You should install an NTP client to synchronise your clock to a few tens of milliseconds precision periodically.

VMWare Guests

Enable...

 tools.syncTime = "TRUE"

...in the .vmx for the virtual machine.

Turn on the following kernel options in '/boot/grub/menu.lst' for the virtual machine.

 clock=pit nosmp noapic nolapic

References

High RAM Servers

If your server has > 128MB RAM, then just use 'ntp' to keep your server clock in sync.

 aptitude install ntp

That's it, job done.

Low RAM Servers

I prefer using ntpdate on low RAM system to avoid have a daemon running in memory all the time.

 aptitude install ntpdate

Now configure ntpdate.

 vi /etc/default/ntpdate

Find...

 NTPDATE_USE_NTP_CONF=yes

...and change it to...

 NTPDATE_USE_NTP_CONF=no

Create an hourly cron job for ntpdate.

 vi /etc/cron.hourly/ntpdate
 chmod 755 /etc/cron.hourly/ntpdate

Sample

Add a User

Simply run the following and answer the questions when prompted.

 adduser fred

Now add 'fred' the the 'admin group.

 addgroup fred admin

Sudo

 visudo

Add a line something like the one below to define which users can sudo.

Sample

 username  ALL=(ALL) ALL

File Compression Tools

OK, so a good deal of these I do not need on a daily basis. Some, I need extremely rarely. So, why are they here? Well, some anti virus and and spam applications use them so I get them installed early on to ensure I have what I need

 aptitude install arc arj bzip2 cabextract cpio lha lzop pax p7zip p7zip-full rar sharutils tnef unrar unzip unzoo zip zoo

Colourised Prompt

'root' Account

To add a colourised prompt to the 'root' account do the following...

 nano /root/.bashrc

Find the following and uncomment it.

 # Comment in the above and uncomment this below for a color prompt
 #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

Syntax Highlighting

Syntax highlighting is an essential feature of any editor, it can often help identify typos and omissions. vim and nano are the two editors I use and both need syntax highlighting enabled.

vim

 nano /usr/share/vim/vimrc

Change the following settings.

 " Vim5 and later versions support syntax highlighting. Uncommenting the next
 " line enables syntax highlighting by default.
 syntax on
 set background=dark

nano

nano needs a little extra help to get syntax highlighting enabled for everything I might edit.

 wget -c http://bigvo.dyndns.org/nanosyntax.tar.bz2
 tar jxvf nanosyntax.tar.bz2
 cp nanosyntax/nanorc /etc
 cp nanosyntax/nano/*.nanorc /usr/share/nano

References

$Id: DebianEssentials,v 1.29 2008/08/31 09:13:43 martin Exp $

Wiki Index All Recent Edit Top
 
Valid XHTML Valid CSS Hacker