Install GNOME or KDE desktop environment from the CLI mode
Install GNOME or KDE desktop environment from the CLI mode
Yesterday I got a request from my user that they need graphical interface to be installed in the server as they require this for their project work. I knew that this is very simple to install using yum groupinstall but the problem I faced was terrific. As this was our internal server it was not connected the internet and it was a VM on VMware. Hence no physical optical drive was present. I am giving below the steps how I got that thing to work.
-
Mount the ISO image of CD/DVD to your system. If you have a physical system you can insert the CD/DVD and mount or else you have to virtually mount this.
mount /dev/cdrom /mnt
-
Create one directory and put all the contents of the Server directory into it.
mkdir /repository
cp -rvf /mnt/Server/* /repository/
- Unmount the CD/DVD drive.
umount /mnt
If you face any problem in unmounting you can use the command
umount -l /mnt
-
Go inside the /repositories folder and install all the createrepo packages.
rpm –ivh createrepo*
-
Now go inside the folder/etc/yum.repos.d/ and create a file called myrepo and put the following contents to the file
[base] name=Red Hat Enterprise Linux $releasever - $basearch - Debug baseurl=file:///repository/ enabled=1 gpgcheck=0
-
Now Go inside /repository folder and check for a specific package yum-utils is present there or not.
cd /repository ls –l| grep yum-utils
This package is responsible for making group of packages.
- If it is not there you have to download this, keep inside this folder (/repository) and install it. You can download it from http://rpm.pbone.net/ .This website has the option of advanced search where you can download packages specific to particular OS version.
- Use createrepo command to create your repository
createrepo /repository/
- Now after creation of repository and installation of the package yum-utils you can try the command
yum grouplist
The output will list you some groups like given below
Loading "rhnplugin" plugin Loading "installonlyn" plugin Setting up Group Process Setting up repositories rhel-debuginfo 100% |=========================| 1.1 kB 00:00 Installed Groups: MySQL Database Editors System Tools FTP Server Network Servers Printing Support Mail Server Server Configuration Tools Available Groups: Administration Tools GNOME Software Development X Software Development GNOME Desktop Environment Authoring and Publishing Games and Entertainment X Window System KDE Software Development KDE (K Desktop Environment) Sound and Video Graphical Internet Done
- If you are not able to see output like given above then you need one xml file called comp.xml to create your own group.Below.If you don’t know how to create the xml file you can use the following link to create the comp.xml file.
- After placing the comp.xml file inside /repository directories you have to recreate the repository.createrepo /repository
-
Now run the command yum grouplist and you will see the output as below
yum grouplist
Sample output:
Setting up Group Process Setting up repositories rhel-debuginfo 100% |=========================| 1.1 kB 00:00 Installed Groups: Printing Support Available Groups: GNOME Desktop Environment X Window System Graphical Internet Done
- Now you can install the groups listed above. To install GNOME desktop Environment you can use the simple command
http://cooker.wbitt.com/index.php/Example_comps.xml_file
yum groupinstall "GNOME Desktop Environment"
Now you can use startx to see your graphical GNOME desktop screen.
Simillarly you can install KDE desktop environment.Just you need to change the xml file and give the command
yum groupinstall "KDE (K Desktop Environment)"