Thursday, July 7, 2011

Change hostname in Linux box

1. Modify the the /etc/hosts file

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1        localhost localhost.localdomain mainc mysite.com


2. Modify the /etc/sysconfig/network file

NETWORKING=yes
HOSTNAME=mainc

Wednesday, July 6, 2011

Mounting shared folders with VirtualBox via Terminal

1. Use the GUI wizard in VirtualBox Menu

Devices -> Shared Folders..

Remember the Folder name! (lets say "SONGS")

2. Create the mount point

$sudo mkdir <mount point>

e.g $sudo mkdir /media/songs-host

3. mount the Host folder to the mount point of the Guest

$sudo mount -t vboxsf <folder name> <mount point>

e.g $sudo mount -t vboxsf SONGS /media/songs-host

How to install yum on Red Hat Enterprise Linux 4

You will not find YUM in the Red Hat Linux 4 distributions by default. So you have to install it manually.


Follow the given steps.

[Worked fine with Red Hat Enterprise Linux ES release 4 (Nahant Update 8) ]

1. Download the RPMs

***YUM base package***
$wget http://dag.wieers.com/rpm/packages/yum/yum-2.4.2-0.4.el4.rf.noarch.rpm

***Sqlite***
$wget ftp://fr2.rpmfind.net/linux/freshrpms/redhat/7.3/sqlite/sqlite-2.8.15-1.i386.rpm

***Python-sqlite***
$wget ftp://rpmfind.net/linux/dag/redhat/el4/en/i386/dag/RPMS/python-sqlite-0.5.0-1.2.el4.rf.i386.rpm

***Python-urlgrabber***
$wget ftp://rpmfind.net/linux/dag/redhat/el4/en/x86_64/dag/RPMS/python-urlgrabber-2.9.7-1.2.el4.rf.noarch.rpm

***Python-element tree***
$wget ftp://fr2.rpmfind.net/linux/dag/redhat/el4/en/i386/dag/RPMS/python-elementtree-1.2.6-7.el4.rf.i386.rpm


2. Install the RPMs

$rpm -ivh sqlite-2.8.15-1.i386.rpm
$rpm -ivh python-elementtree-1.2.6-7.el4.rf.i386.rpm
$rpm -ivh python-urlgrabber-2.9.7-1.2.el4.rf.noarch.rpm 
$rpm -ivh python-sqlite-0.5.0-1.2.el4.rf.i386.rpm
$rpm -ivh yum-2.4.2-0.4.el4.rf.noarch.rpm


3. add the following lines to the /etc/yum.conf file

[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1

[base]
name=CentOS-$releasever – Base
baseurl=http://mirror.centos.org/centos/4/os/i386/
gpgcheck=1

[updates]
name=Red Hat Linux $releasever – Updates
baseurl=http://mirror.centos.org/centos/4/updates/i386/
gpgcheck=1

5. Update the packages

$yum update

Cheers!!!