Abhishek Singh Bailoo

Weblog

Sep 24

Centos Single CD Install and Networking

Here is how to do Single CD Install and Networking configuration from command line of Centos

1. Install Centos Single CD

Download CD from here. Please check if you need 32-bit or 64-bit CD

http://isoredirect.centos.org/centos/5/isos/i386/

http://isoredirect.centos.org/centos/5/isos/x86_64/

You need to download only the First CD named *-bin-1of8.iso

(The following is taken from here http://www.montanalinux.org/centos5-debian-style.html)

Insert CD 1 and boot

The goal of this exercise is to do a minimal install using CD 1 only, and then post-install, install a fairly full desktop system including GNOME, KDE, graphical Internet applications, text Internet applications, utilities, development tools… you name it. This is not a HOWTO so I WILL NOT be going through every single step. The install process of Red Hat based distros is so easy now, a chicken could almost do it by pecking the enter key on the keyboard.

The default package selection for CentOS 5 is basically a GNOME based desktop environment with OpenOffice.org and several common graphical Internet applications… and this default install actually requires CDs 1-5. If you don’t want the default install, you have to manually select “Customize now” at the bottom of the installation type screen… which will take you to a package selection screen. While previous releases had options for “Install everything” and “Minimal install” at the bottom of the package list, the package selection screen has been completely redesigned. With the addition of Virtualization, Clustering, and Cluster Storage options, the “Install everything” option no longer makes much sense… but it is unfortunate that the “Minimal install” option isn’t there anymore. With this release they have also added the option to include additional, network-based package repositories if desired.

So, without a “Minimal install” option, just how does one accomplish a minimal install? It isn’t too difficult. You just have to select each package group on the left side of the screen and make sure to remove all checkmarks in the sub-groups on the right. This means you have to do a bit of clicking… by working through each section and removing all checkmarks. When I say remove all check marks, I mean it… with the exception of “Base” in the “Base System” group… although for an even lighter-weight install, you can even remove that checkmark too.

All about the dependencies

Package GroupsPackage GroupsAfter making your package selections, or in this case, de-selections, clicking Next will produce a pop that says, “Checking dependencies in packages selected for installation…”. If you were successful at unchecking every package group and sub-group, you will be rewarded by the installer not even telling you how many CDs are needed.

A typical minimal install takes 5 minutes or so… with more time spent entering information on the various screens rather than in package installation. If you left “Base” checked, it equals 340 rpms taking up 881MB of disk space. If you didn’t leave “Base” checked, it equals 144 rpms taking up 616MB of disk space.

Post-install party

Ok, the install is done and system rebooted. The grub menu comes up, the kernel boots, and shortly thereafter you are presented with the console login screen. You login and the command prompt blinks at you with anticipation. What do you do now? Remember, the goal of this experiment was to end up with a GUI desktop with everything… GNOME, KDE, GUI apps, Development tools, etc.

yum stands for Yellowdog Updater Modified… and it is the higher-level package management tool offered by most Red Hat based distros these days. By higher-level I mean that when you want to install something, yum figures out all of the dependencies and downloads everything for you. In contrast to yum is the venerable rpm command. Debian and/or Ubuntu users can relate as follows… rpm is to yum as dpkg is to apt-get.

yum is typically used to install one or more packages by name… but it has lesser used package group functionality as well. Want to know what groups are available? Then try:

yum grouplist

From a minimal install you should get something like:

Installed Groups:
System Tools
Dialup Networking Support
Network Servers
Mail Server
Available Groups:
Office/Productivity
Engineering and Scientific
MySQL Database
Development Libraries
Editors
GNOME Software Development
Text-based Internet
X Software Development
Virtualization
Legacy Network Server
DNS Name Server
GNOME Desktop Environment
Authoring and Publishing
FTP Server
Games and Entertainment
Legacy Software Development
Java
Java Development
Emacs
Legacy Software Support
X Window System
Graphics
Web Server
Ruby
Windows File Server
Printing Support
KDE Software Development
KDE (K Desktop Environment)
Server Configuration Tools
Sound and Video
PostgreSQL Database
Administration Tools
News Server
Development Tools
Yum Utilities
FreeNX and NX
Graphical Internet

Notice that the vast majority of group names are multiple words with spaces included. As a result, you have to put them in double quotes so the spaces in their names won’t be interpreted as separators.

Ok, let’s install all of the stuff I want with the following yum commandline:

yum groupinstall \
"Office/Productivity" "Development Libraries" Editors \
"GNOME Software Development" "Text-based Internet" \
"X Software Development" "GNOME Desktop Environment" \
"Games and Entertainment" "Legacy Software Development" \
Java "Java Development" Emacs "Legacy Software Support" \
"X Window System" Graphics Ruby "Printing Support" \
"KDE Software Development" "KDE (K Desktop Environment)" \
"Sound and Video" "Administration Tools" "Development Tools" \
"Graphical Internet"

Please note that is really one line but the \ has been used to separate it across multiple lines for readability. \ in shell syntax means continued on next line.

After doing that, yum spewed out a lot of text, figured out all of the dependencies and gave me a transaction summary that said it was going to install 688 packages, update 4 packages and remove 0 packages with a total download size of 904MB. Depending on updates and whether or not you had “Base” selected in the initial install (I did), the exact figures may vary but you get the point. Luckily I setup my own package repositories so downloading all of this stuff over the LAN was probably faster than having all of the physical CDs or the DVD. This article isn’t intended to be a HOWTO so install what you want rather than what I’ve specified above.

It will take a while but after it is all said and done, everything will be there all happy like.

Why would you want to do it this way?

As time goes on, there are going to be more and more package updates. Installing this way lets you do a minimal install which will require a minimal amount of updates AND all of the packages you install post-install should check updates so it won’t install anything that needs updating.

Having local repositories on the LAN really made it fast but I’m not sure I’d like to have to download 904MB of packages over the greater Internet… although in most cases it shouldn’t be a problem… although on the same day or week of a new distro release it might be problematic.

I guess I’m just old fashioned. I like to download the whole distro and pick all of the stuff I want to install during the install. Sure that means a lot of updates but RHEL/CentOS do release updated install media (aka respins) as minor versions of the distro and as long as you have the most recent install media, you shouldn’t have too terribly many packages to update… knock on wood. Even with Fedora, that has the rapid 6 month development cycle, there is a group that produces respins every so often to cut down on the number of updates needed after a fresh install.

Draw backs to the minimal install method

If you do a default install or add packages beyond the default install, you’ll have a GUI system to begin with… and that includes the firstboot wizard that runs when you boot for the first time after installation. firstboot does things for you like configuring X, adding a user account, setting up a firewall, configuring your sound card, etc. With a minimal install you don’t get that firstboot experience so you’ll have a little work ahead of you after everything is installed. Luckily there are packages that will do everything firstboot does… just with each function as a separate program you have to run. For configuring X there is system-configure-display. There are several different apps you can use to add a user account. For your sound card there is system-configure-soundcard. While many users aren’t familiar with these utilities it doesn’t hurt to get to know them. Do you know how to change your default runlevel? If not, you should.

2. Configure Networking

The following is taken from http://www.cyberciti.biz/faq/rhel-centos-fedoracore-linux-network-card-configuration/

Edit configuration files stored in /etc/sysconfig/network-scripts/

You can configure network card by editing text files stored in /etc/sysconfig/network-scripts/ directory. First change directory to /etc/sysconfig/network-scripts/:
# cd /etc/sysconfig/network-scripts/
You need to edit / create files as follows:

  • /etc/sysconfig/network-scripts/ifcfg-eth0 : First Ethernet card configuration file
  • /etc/sysconfig/network-scripts/ifcfg-eth1 : Second Ethernet card configuration file

To edit/create first NIC file, type command:
# vi ifcfg-eth0
Append/modify as follows:

# Intel Corporation 82573E Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:30:48:56:A6:2E
IPADDR=10.10.29.66
NETMASK=255.255.255.192
ONBOOT=yes

Save and close the file. Define default gateway (router IP) and hostname in /etc/sysconfig//network file:
# vi /etc/sysconfig/network
Append/modify configuration as follows:
NETWORKING=yes
HOSTNAME=www1.nixcraft.in
GATEWAY=10.10.29.65

Save and close the file. Restart networking:
# /etc/init.d/network restart

Make sure you have correct DNS server defined in /etc/resolv.conf file:
# vi /etc/resolv.conf
Setup DNS Server as follows:
nameserver 10.0.80.11
nameserver 10.0.80.12
nameserver 202.67.222.222

Save and close the file. Now you can ping the gateway/other hosts:
$ ping 10.0.80.12
Output:

PING 10.0.80.12 (10.0.80.12) 56(84) bytes of data.
64 bytes from 10.0.80.12: icmp_seq=1 ttl=251 time=0.972 ms
64 bytes from 10.0.80.12: icmp_seq=2 ttl=251 time=1.11 ms

You can also check for Internet connectivity with nslookup or host command:
$ nslookup cyberciti.biz
Output:

Server:         10.0.80.11
Address:        10.0.80.11#53

Non-authoritative answer:
Name:   cyberciti.biz
Address: 75.126.43.232

You can also use host command:
$ host nixcraft.in
Output:

nixcraft.in has address 75.126.43.232
nixcraft.in mail is handled by 10 mail.nixcraft.in.