CentOS 6 OS Install

This post is in the category: Guides

Posts here are mostly step-by-step guides on how to replicate something I have set up in the past. Read over my About page to see how I show commands/output and read the disclaimer.

Before I had my Kickstart templates created, I went through manual installs. This guide is here to remind me of some steps to keep consistent systems.

Base OS Install

Boot the installer.

If within range of the local mirror, select HTTP as the mirror and use this URL:


DHCP Hostname Fix

The hostname is not correctly registered with DHCP by default. We need to add a line to /etc/sysconfig/network in order for the hostname to resolve from other LAN machines.

[root]$ echo "DHCP_HOSTNAME=`hostname`" >> /etc/sysconfig/network

The file should now look something like this:

[root]$ cat /etc/sysconfig/network

Some Config Settings

Manually download some configs.

[root]$ wget https://raw.github.com/atw527/dotfiles/master/.vimrc
[root]$ cp .vimrc /etc/skel/

Change some bash prompts. If doing the server install, no users were created yet. Update your root prompt:

[root]$ echo "PS1='[\[\e[01;31m\]\u@\h \w\[\e[0m\]]\$ '" >> ~/.bashrc

Update the skel prompt for users:

[root]$ echo "PS1='[\u@\h \w]\$ '" >> /etc/skel/.bashrc

Logout and back in to see the new prompt.

Local Mirror and Updates

I have a local mirror. I believe the correct way to set a local mirror is in the /etc/yum.repos.d/CentOS-Base.repo. The file needs to have the baseurl lines uncommented and changed to the local mirror path.

[root]$ sed -i s@#baseurl=http://mirror.centos.org@baseurl=http://mirror/mirrors@g /etc/yum.repos.d/CentOS-Base.repo

Consider disabling fastmirror.

[root]$ vim /etc/yum/pluginconf.d/fastestmirror.conf

Clean any cached yum files:

[root]$ yum clean all

Import the main key to prevent a warning on the first update:

[root]$ rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Now let’s run a system update. Make sure the mirrors used is the local server. The update mirror will show up in the first few lines as shown below.

[root]$ yum update
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: s10-deploy
 * extras: s10-deploy
 * updates: s10-deploy

RPMForge Mirror Setup

I prefer htop for my text-based process manager. It is unfortunately not available in the main repositories.

[root]$ wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.`uname -i`.rpm

Import the key.

[root]$ rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

Verify the package.

[root]$ rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm

Install it.

[root]$ rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm

Install htop.

[root]$ yum install htop


– http://wiki.centos.org/TipsAndTricks/KickStart – http://www.centos.org/docs/5/html/Installation_Guide-en-US/ch-redhat-config-kickstart.html

This entry was posted in Guides on by .

About Andrew Wells

I have been developing on the LAMP stack since about 2006. I run Ubuntu XFCE on my desktop and have a history of managing Ubuntu and CentOS servers. I code web applications mostly in PHP but have experience with other languages as well. When I'm not working, I can be found working in my home lab or out snowboarding, hiking, camping, or biking depending on the season.

Leave a Reply

Your email address will not be published. Required fields are marked *