Wednesday, May 30, 2012

CentOS 6 How to renew DHCP and restart NIC

To release the DHCP address on the system
dhclient -r

To obtain a new address
dhclient

To check the new IP
ifconfig

To restart network service
ifdown eth0
ifup eth0
/etc/init.d/network restart

CentOS 6: Install Packages Via yum Command Using DVD / CD as Repo

Open up the repo file and edit
vi /etc/yum.repos.d/CentOS-Media.repo
read the content carefully

set enabled to 1
enabled=1

Might want to add file:///media/CentOS_6.2_Final on the baseurl

so baseurl would look like this after it is added, the last line woth bold idicated that it is added.

baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
file:///media/CentOS_6.2_Final/

Install a package with only the CDROM repo

# yum --disablerepo=\* --enablerepo=c6-media install pacakge-name