I haven't done this with real, live RHEL, but I have pried X out of CentOS 5.1 and 5.2. (I've been pulling X off of Redhat-derived distros for years... ever since the dependencies were made such that you, basically, had to install X, whether you wanted it or not.)
I don't recall the exact dependencies, but, as I recall, there are some annyoing dependencies that require a "--nodeps" argument to RPM in order to get the offending RPMs to remove. I just start ripping out packages I don't need, adding more and more packages to the "rpm -e" command-line, and finally adding "--nodeps" when necessary.
I don't know that I'd recommend doing this for production machines. I don't deploy any quantity of CentOS in production environments, so it's probably alright that I potentially screw up my installation. In a production environment, disk space is cheap. I don't like having unnecessary software installed, from a security perspective, but The Right Thing(tm) is probably to rebuild the packages with offending dependencies (without the offending dependencies, obviously) rather than just ripping out and potentially making a system unusable.
Hey after searching around I was able to find a better understanding answer to this problem.
Make a mount point for your iso:
mkdir /mnt/pen
Mount the OS installation iso like normal:
mount -o loop rhel.iso /mnt/pen/
Create a details entry for your repository (add a file in the /etc/yum.repos.d directory e.g. rhel.repo):
[rhel-cd]
name=Red Hat OS CD
baseurl=file:///mnt/pen/Server
enabled=1
gpgcheck=0
Clean your cache:
yum clean all
You should now have your repository visible in Add/Remove Programs.
NOTE: You might want to consider automounting your iso.
Best Answer
On Centos, you would go:
If you registered for the RHN trial, it may be the same command. However, it may be simpler just to install Centos 5.x instead.