Tuesday, April 28, 2009

CentOS DVD Repositary

After downloaded CentOS 5.3 dvd iso image, there is no issue for me to install it. Later when I decide to add more software from the DVD, the "Add/Remove Software" program (yum) was always trying to download the package from the net instead of installing directly from my DVD.

After reading the document about yum and repositary, I found I need to update the setting for CentOS media. The reason: The DVD image was mounted as /media/CentOS_5.3_final. Actually this is the label of the DVD image. (I forget, or maybe it's CentOS_5.3_Final. Check it under /media dir after CentOS auto mount it.)

There are two ways to do this:
1. edit /etc/yum.repos.d/CentOS-Media.repo file directly, add a new line under baseurl:
file:///media/CentOS_5.3_final/
then start "Add / Remove Software".
2. Or after start "Add/Remove Software", edit the repositary setting. Just modify the CentOS-Media and add file:///media/CentOS_5.3_final/ to the value. This time dont forget separate the values with ,

Of course you need to uncheck other repositaries. Otherwise yum is still trying to get the package from net.