Thursday, 7 June 2012

Centos 6 Minimal installation with Fluxbox

This is a tutorial on installing a Minimal Centos 6 system using Fluxbox, Thunar and Rxvt to create a lightweight, fast and very stable desktop. Access your Desktop using mainly the F1 and F2 keys for Thunar File Manager and Rxvt Terminal respectively, with other keys assigned wherever necessary to other programs you have installed.



 Centos 6 Minimal with Fluxbox, Thunar and Rxvt Terminal



It's fast and easy to use & you can make use of the command line while still retaining a graphical interface as a focal point. Compiling programs from source is mostly drama free.


Centos 6 is an enterprise level clone of RHEL with great support from the Centos team and is a revelation in free Linux distros, with a rock solid and ultra stable kernel.

It opens the door to people who wish to have more control over what goes on their system without having to endure the endless time consuming idiosyncrasies which plague many of the other lightweight distributions. 

It is an excellent choice for people who wish to keep up with its corporate brother Red Hat and want full control over what is installed on the OS, even if you have limited experience at tweaking and tuning.


The tutorial is split into 3 sections and it is fairly quick and straightforward if you just follow each part separately and then check out the optional bits further down the page.

Certification students should use the 64 bit variant because of the virtualization requirements of the exam.

I have included a short guide on updating/fixing the kernel which will help if you wish to compile your own programs from source. You may wish to skip down to this at the beginning of Part 3 then return to finish the setting up. It is a very simple procedure which , once done, will ensure you have no problems compiling programs from source or with performing rpm rebuilds.


 Installation

You will need
  • The netinstall iso
1.Basic Install

Download the iso from the link below


get the netinstall.iso at around 170-200mb

Burn it to a disk

Make sure you have an ethernet connection as although there is some wireless support, it is not guaranteed. Boot the disk taking the default option of install or upgrade existing.

First off you will have to make a few selections in text mode.

KB and language
Select default network unless you are an advanced user.

Enter the download image url below

http://mirror.centos.org/centos/6/os/i386/ 

http://mirror.centos.org/centos/6/os/x86_64/

and wait for the progress bar to complete

At the splash screen which appears you will go through the following.

Select your storage device (set target device if > 1)
Choose Fresh Installation
Set Domain (options here to set static ip etc)
Set Time
Set root password
select space on the disk (options here for advanced users)
Write changes to disk
Select the Minimal Install radio button.
Options to add more repos.
reboot

2.Fluxbox Desktop
Login with root and password.

Set up epel repo for the packages

# rpm –-import http://mirrors.coreix.net/fedora-epel/RPM-GPG-KEY-EPEL-6

# rpm -Uvh http://mirrors.coreix.net/fedora-epel/6/i386/epel-release-6-8.noarch.rpm

# rpm -Uvh http://mirrors.coreix.net/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

OR you can use wget if you install it first with

# yum -y install wget

Make sure epel repo is enabled

# cat /etc/yum.repos.d/epel.repo                if not

# vi /etc/yum.repos.d/epel.repo and set 'enabled' to '1' 

See Vim Editor for vi commands 

# yum -y update

Now install the Fluxbox Desktop with 2 commands

# yum -y groupinstall "X Window System"

# yum -y install fluxbox thunar thunar-volman rxvt wget alsa-utils pciutils usbutils xdg-utils fuse fuse-ntfs-3g ntfs-3g ntfsprogs parted udisks gvfs yum-utils bind-utils lsb wireless-tools gdm gtk2-devel zlib-devel glibc glib2 glib2-devel vim-enhanced vim-X11 rpm-build gettext-devel perl-XML-Parser xarchiver p7zip

(The above gives you a basic desktop with window manager, file manager, text editor and a terminal emulator, add any other packages that you require here)

Now set up the sudoers and inittab files. 

# visudo to open sudoers file in vi, add your user by scrolling down to the root entry and and adding underneath
<user_name> ALL=(root) NOPASSWD: ALL

(<user_name> minus the <>,this will allow the user you will create in the next step to use sudo without the password)

# vi /etc/inittab change 3 to 5. (change run level to X server)

reboot.

3. Set up the Desktop
 
Login (automatically as root) where you will be asked to create a user and set time and date, create the same user you entered into the sudoers file earlier, then login as the new user.

(At this point you may wish to set up the kernels to ensure smooth compiling, if so, scroll down to the kernels section below then return here, otherwise continue).

If the first run splash screen fails as has been known, then you can create your user manually, do the following

Hit Alt+F4 to exit X server and login as root

To set up the directory, shell and user

# useradd -d /home/<user_name> -s /bin/bash -g users <user_name>

to set up the password

# passwd <user_name> 
    
Then reboot to your gdm screen and login as new user

Fluxbox key bindings

Hit Alt+F2 to run Thunar, check the 'show hidden files' box from the 'view' menu and browse to the .fluxbox directory which is normally hidden.

Open the 'keys' file with vi and add at the top 'F1 : ExecCommand thunar' + copy/paste it 10-12 times.

Change the other F1 entries to F2 etc and change the program it runs, for eg F2 : ExecCommand rxvt
F6 : ExecCommand emacs
F9 : ExecCommand google-chrome
F10 : ExecCommand firefox

Thats fine to start with, save the file, close off thunar and restart fluxbox to register the shortcuts (right click and select restart, change styles here also - try zinek_darkblue).

More fluxbox options available at /usr/share/fluxbox + info at http://fluxbox.org/ 
 
Fluxbox is highly customisable and the F1 - F12 shortcut keys open your most used programs very quickly. (Alt+F2 to run others or you can create shortcut/symlinks in the Desktop folder by cd Desktop sudo ln -s /usr/bin/<prog_name>)

More Keyboard Shortcuts & Autostart


If you have set the fluxbox shortcuts as above, hit F2 to run rxvt terminal, set up your sound and install firefox and google-chrome.

$ alsactl init                           sets up sound
$ alsamixer                              adjust levels

I'd recommend installing Firefox even if you prefer other browsers simply because it has the required plugins directory which many other browsers depend on.

$ sudo yum -y install firefox

Open firefox (F10) and browse to and download google-chrome rpm package from their site, install it with $sudo rpm -ivh<rpm_file_name>

(If you have problems with the latest google-chrome release try Chromium, which works well with the Flash and Java plugins)

If you need alternative browsers you can try QtWeb, Midori & Seamonkey, SwiftfoxFlock, Dillo and Elinks in addition to the above. 

Kernels


Now fix the kernels and install basic compile tools as below.

Nvidia graphics users should follow the below sections on kernels and install original Nvidia drivers . Ideally, you should make it part of the installation procedure above, although I have not done that to avoid confusion for non Nvidia users, who should just fix the kernel files.

To ensure smooth compiling we fix the kernel files. It is best to do this before you install original Nvidia drivers if you use them.

There may have been a kernel update since the last release
meaning you have got 2 different ones installed 

$ rpm -qa | grep kernel  

shows the kernel files you have, similar to below

kernel-firmware-2.6.32-279.1.1.el6.noarch
dracut-kernel-004-284.el6_3.noarch
kernel-2.6.32-279.1.1.el6.i686  New
kernel-2.6.32-279.el6.i686      Old

With old from the original install
and new fom the epel repo

(The new one should match your kernel-firmware)

Reboot, press space bar + boot from new kernel 

remove the old one

$ sudo yum -y remove kernel-2.6.32-279.el6.i686
And add matching headers and devel

$ sudo yum -y install kernel-headers kernel-devel

Repeat the command to check they match as below

kernel-devel-2.6.32-279.1.1.el6.i686
kernel-headers-2.6.32-279.1.1.el6.i686
kernel-firmware-2.6.32-279.1.1.el6.noarch
dracut-kernel-004-284.el6_3.noarch
kernel-2.6.32-279.1.1.el6.i686


Now you have a correct /usr/src/kernels folder

Then you can install gcc etc

$ sudo yum -y install gcc gcc-c++ automake autoconf make + any others that you require, you should be able to compile without kernel errors.

Other Repositories

SMPlayer & Codecs

Beaver Text Editor












No comments:

Post a Comment