Sunday, 23 November 2014

How To : Create a Local YUM Repository in Red Hat Enterprise Linux

    If you are having RHEL installed on your server and you wish to install new packages or update existing ones, creating local repository will be a good option. Setting up local YUM repositories will fetch the packages/updates from the local server, not only saving the bandwidth and hence the cost, but also the installation process will fasten up.


This tutorial will guide you to set up a local YUM repository on your RHEL/CentOS systems.

Step 1: Mount the DVD or ISO.

For DVD, you can run

$ mount /dev/cdrom /mnt
For ISO, you can run

$ mount -t iso9660 -o loop /path/to/iso/image /mnt
Step 2: Install the 'createrepo' package.

In order to install 'createrepo' package along with its dependencies, execute the following command:

$ cd /mnt && rpm -ivh libxml2-python* deltarpm* python-deltarpm* createrepo*
Step 3: Move the packages to a directory.

$ cp -ar /mnt/* /home/mandar/repos/rhel65/
Step 4: Build the local Repository

$ createrepo -v /home/mandar/repos/rhel65/
Step 5: Create the Repository File

$ vi /etc/yum.repos.d/rhel65.repo
In that file, add following lines:

[rhel65]
name=RHEL 6.5
baseurl=file:///home/mandar/repos/rhel65
gpgcheck=0
enabled=1
Step 6: Disable all other repositories and Update repository file

If there are any other repositories, then disable them by editing them as enabled=0.
Now, you can update the repository file as follows:

$ yum clean all && yum update
In order to list all available packages, you can run:

$ yum list
Now, you can try installing the packages normally using : yum install [PackageName].

Friday, 21 November 2014

A Bash Script to Install/Upgrade to Linux Kernel 3.17.4 in Ubuntu/Linux Mint

The Linux Kernel 3.17.4 is now available for the users, announced Linus Torvalds. This Linux Kernel version comes with plenty of fixes and improvements. The following BASH script, when executed, despite of the system architecture (valid only for i386, i686 and x86_64 based systems), installs Linux kernel 3.17.4 in your Linux systems.



Note: Make sure that you execute this script as a ROOT user.

Usage:

./script_name.sh
Script:

#!/bin/sh

# Check if the user is ROOT
if [ $(id -u) -ne 0 ]
then
    echo "You are not ROOT! Please login as ROOT."
    exit
fi

# Latest Available Kernel version
LatestKernel="3.17.4-031704-generic"

# Required Packages
Headers_All="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.4-vivid/linux-headers-3.17.4-031704_3.17.4-031704.201411211317_all.deb"
Headers_i386="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.4-vivid/linux-headers-3.17.4-031704-generic_3.17.4-031704.201411211317_i386.deb"
Image_i386="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.4-vivid/linux-image-3.17.4-031704-generic_3.17.4-031704.201411211317_i386.deb"
Headers_amd64="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.4-vivid/linux-headers-3.17.4-031704-generic_3.17.4-031704.201411211317_amd64.deb"
Image_amd64="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.4-vivid/linux-image-3.17.4-031704-generic_3.17.4-031704.201411211317_amd64.deb"

# Debian Packages
DEB="linux-headers-3.17.4*.deb linux-image-3.17.4*.deb"

# Currently Installed Kernel Version
CurrentKernel_release=$(uname -r) 

# System Architecture
SystemArch=$(uname -i)

# Check if System already has latest kernel installed
if [ "$CurrentKernel" = "$LatestKernel" ]
then
    echo "Wow! Your System is Already Updated to Latest Available Kernel Version!"
    echo "Program will now exit..."
    sleep 2s
    exit
fi

# If latest kernel is not available, then check the system architecture and download necessary packages

# For 32-bit Systems

if [ $SystemArch = "i386" ] || [ $SystemArch = "i686" ]
then

    echo "Kernel upgrade process for 32-bit systems will now start..."
    sleep 2s
    echo "Downloading required packages.."
    sleep 2s

    wget $Headers_All
    wget $Headers_i386
    wget $Image_i386

    echo "Download process completed. Packages are present in $(pwd) directory"
    sleep 2s

    echo "Installing the packages..."
    dpkg -i $DEB

# For 64-bit Systems
elif [ $SystemArch = "x86_64" ]
then
    echo "Kernel upgrade process for 64-bit systems will now start..." 
    sleep 2s

    wget $Headers_All
    wget $Headers_amd64
    wget $Image_amd64

    echo "Download process completed. Packages are present in $(pwd) directory"
    sleep 2s

    echo "Installing the packages..."
    dpkg -i $DEB

# If system architecture is not compatible
else
    echo "Packages for following system architecture not found :  $SystemArch"
    echo "Program will now exit..."
    sleep 2s
exit
fi

    echo "Your system has been successfully upgraded to latest kernel version $(LatestKernel)."
    echo "System will now reboot."
    sleep 5s
    shutdown -r now
NOTE: Above script worked perfectly on my i386 system. I need confirmation from i686 and x86_64 users, if it works fine for them. Please suggest any changes to be incorporated.

How To : Install Linux Kernel 3.17.4 in Ubuntu/Linux Mint Systems

    The Linux Kernel 3.17.4 is now available for the users, announced Linus Torvalds. This Linux Kernel version comes with plenty of fixes and improvements. This article will guide you to install or upgrade to Linux Kernel 3.17.4 in your Ubuntu or Linux Mint system.


Installation

For 32-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.4-vivid/linux-headers-3.17.4-031704_3.17.4-031704.201411211317_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.4-vivid/linux-headers-3.17.4-031704-generic_3.17.4-031704.201411211317_i386.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.4-vivid/linux-image-3.17.4-031704-generic_3.17.4-031704.201411211317_i386.deb
Install them.

$ sudo dpkg -i linux-headers-3.17.4*.deb linux-image-3.17.4*.deb
Reboot the system.

sudo reboot

For 64-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.4-vivid/linux-headers-3.17.4-031704_3.17.4-031704.201411211317_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.4-vivid/linux-headers-3.17.4-031704-generic_3.17.4-031704.201411211317_amd64.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.4-vivid/linux-image-3.17.4-031704-generic_3.17.4-031704.201411211317_amd64.deb
Install them.

$ sudo dpkg -i linux-headers-3.17.4*.deb linux-image-3.17.4*.deb
Reboot the system.

sudo reboot

To uninstall,

sudo apt-get remove 'linux-headers-3.17.4*' 'linux-image-3.17.4*'

Monday, 17 November 2014

How To : Install/Upgrade to Linux Kernel 3.18-RC5 in Ubuntu/Linux Mint Systems

    The Linux Kernel 3.18-RC5 is now available for the users, announced Linus Torvalds. This Linux Kernel version comes with plenty of fixes and improvements. This article will guide you to install or upgrade to Linux Kernel 3.18-RC5 in your Ubuntu or Linux Mint system.


Installation

For 32-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc5-vivid/linux-headers-3.18.0-031800rc5_3.18.0-031800rc5.201411162035_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc5-vivid/linux-headers-3.18.0-031800rc5-generic_3.18.0-031800rc5.201411162035_i386.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc5-vivid/linux-image-3.18.0-031800rc5-generic_3.18.0-031800rc5.201411162035_i386.deb
Install them.

$ sudo dpkg -i linux-headers-3.18*.deb linux-image-3.18*.deb
Reboot the system.

$ sudo reboot

For 64-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc5-vivid/linux-headers-3.18.0-031800rc5_3.18.0-031800rc5.201411162035_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc5-vivid/linux-headers-3.18.0-031800rc5-generic_3.18.0-031800rc5.201411162035_amd64.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc5-vivid/linux-image-3.18.0-031800rc5-generic_3.18.0-031800rc5.201411162035_amd64.deb
Install them.

$ sudo dpkg -i linux-headers-3.18*.deb linux-image-3.18*.deb
Reboot the system.

$ sudo reboot

To uninstall,

$ sudo apt-get remove 'linux-headers-3.18*' 'linux-image-3.18*'

Friday, 14 November 2014

A Bash Script to Install/Upgrade to Linux Kernel 3.17.3 in Ubuntu/Linux Mint

The Linux Kernel 3.17.3 is now available for the users, announced Linus Torvalds. This Linux Kernel version comes with plenty of fixes and improvements. The following BASH script, when executed, despite of the system architecture (valid only for i386, i686 and x86_64 based systems), installs Linux kernel 3.17.3 in your Linux systems.


Note: Make sure that you execute this script as a ROOT user.

Usage:

./script_name.sh
Script:

#!/bin/sh

# Check if the user is ROOT
if [ $(id -u) -ne 0 ]
then
    echo "You are not ROOT! Please login as ROOT."
    exit
fi

# Latest Available Kernel version
LatestKernel="3.17.3-031703-generic"

# Required Packages
Headers_All="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.3-vivid/linux-headers-3.17.3-031703_3.17.3-031703.201411141335_all.deb"
Headers_i386="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.3-vivid/linux-headers-3.17.3-031703-generic_3.17.3-031703.201411141335_i386.deb"
Image_i386="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.3-vivid/linux-image-3.17.3-031703-generic_3.17.3-031703.201411141335_i386.deb"
Headers_amd64="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.3-vivid/linux-headers-3.17.3-031703-generic_3.17.3-031703.201411141335_amd64.deb"
Image_amd64="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.3-vivid/linux-image-3.17.3-031703-generic_3.17.3-031703.201411141335_amd64.deb"

# Debian Packages
DEB="linux-headers-3.17.3*.deb linux-image-3.17.3*.deb"

# Currently Installed Kernel Version
CurrentKernel_release=$(uname -r) 

# System Architecture
SystemArch=$(uname -i)

# Check if System already has latest kernel installed
if [ "$CurrentKernel" = "$LatestKernel" ]
then
    echo "Wow! Your System is Already Updated to Latest Available Kernel Version!"
    echo "Program will now exit..."
    sleep 2s
    exit
fi

# If latest kernel is not available, then check the system architecture and download necessary packages

# For 32-bit Systems

if [ $SystemArch = "i386" ] || [ $SystemArch = "i686" ]
then

    echo "Kernel upgrade process for 32-bit systems will now start..."
    sleep 2s
    echo "Downloading required packages.."
    sleep 2s

    wget $Headers_All
    wget $Headers_i386
    wget $Image_i386

    echo "Download process completed. Packages are present in $(pwd) directory"
    sleep 2s

    echo "Installing the packages..."
    dpkg -i $DEB

# For 64-bit Systems
elif [ $SystemArch = "x86_64" ]
then
    echo "Kernel upgrade process for 64-bit systems will now start..." 
    sleep 2s

    wget $Headers_All
    wget $Headers_amd64
    wget $Image_amd64

    echo "Download process completed. Packages are present in $(pwd) directory"
    sleep 2s

    echo "Installing the packages..."
    dpkg -i $DEB

# If system architecture is not compatible
else
    echo "Packages for following system architecture not found :  $SystemArch"
    echo "Program will now exit..."
    sleep 2s
exit
fi

    echo "Your system has been successfully upgraded to latest kernel version $(LatestKernel)."
    echo "System will now reboot."
    sleep 5s
    shutdown -r now
NOTE: Above script worked perfectly on my i386 system. I need confirmation from i686 and x86_64 users, if it works fine for them. Please suggest any changes to be incorporated.

How To : Install Linux Kernel 3.16.7-CKT1 in Ubuntu/Linux Mint Systems

The Linux Kernel 3.16.7-CKT1 is now available for the users, announced Luis Henriques. The 3.16.y-ckt extended stable tree is maintained by the Canonical Kernel Team. This article will guide you to install or upgrade to Linux Kernel 3.16.7-CKT1 in your Ubuntu or Linux Mint system.


Installation

For 32-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16.7-ckt1-utopic/linux-headers-3.16.7-031607_3.16.7-031607.201411141035_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16.7-ckt1-utopic/linux-headers-3.16.7-031607-generic_3.16.7-031607.201411141035_i386.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16.7-ckt1-utopic/linux-image-3.16.7-031607-generic_3.16.7-031607.201411141035_i386.deb
Install them.

$ sudo dpkg -i linux-headers-3.16.7*.deb linux-image-3.16.7*.deb
Reboot the system.

sudo reboot

For 64-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16.7-ckt1-utopic/linux-headers-3.16.7-031607_3.16.7-031607.201411141035_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16.7-ckt1-utopic/linux-headers-3.16.7-031607-generic_3.16.7-031607.201411141035_amd64.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16.7-ckt1-utopic/linux-image-3.16.7-031607-generic_3.16.7-031607.201411141035_amd64.deb
Install them.

$ sudo dpkg -i linux-headers-3.16.7*.deb linux-image-3.16.7*.deb
Reboot the system.

sudo reboot

To uninstall,

sudo apt-get remove 'linux-headers-3.16.7*' 'linux-image-3.16.7*'

How To : Install Linux Kernel 3.17.3 in Ubuntu/Linux Mint Systems

    The Linux Kernel 3.17.3 is now available for the users, announced Linus Torvalds. This Linux Kernel version comes with plenty of fixes and improvements. This article will guide you to install or upgrade to Linux Kernel 3.17.3 in your Ubuntu or Linux Mint system.


Installation

For 32-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.3-vivid/linux-headers-3.17.3-031703_3.17.3-031703.201411141335_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.3-vivid/linux-headers-3.17.3-031703-generic_3.17.3-031703.201411141335_i386.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.3-vivid/linux-image-3.17.3-031703-generic_3.17.3-031703.201411141335_i386.deb
Install them.

$ sudo dpkg -i linux-headers-3.17.3*.deb linux-image-3.17.3*.deb
Reboot the system.

sudo reboot

For 64-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.3-vivid/linux-headers-3.17.3-031703_3.17.3-031703.201411141335_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.3-vivid/linux-headers-3.17.3-031703-generic_3.17.3-031703.201411141335_amd64.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.17.3-vivid/linux-image-3.17.3-031703-generic_3.17.3-031703.201411141335_amd64.deb
Install them.

$ sudo dpkg -i linux-headers-3.17.3*.deb linux-image-3.17.3*.deb
Reboot the system.

sudo reboot

To uninstall,

sudo apt-get remove 'linux-headers-3.17.3*' 'linux-image-3.17.3*'

How To : Install NVIDIA 340.58 Graphics Drivers in Ubuntu/Linux Mint Systems

    The latest version of Nvidia Graphics driver for Linux which is Nvidia 340.58 has been released and is available for download. It comes with plenty of fixes and changes. This article will guide you to install Nvidia 340.58 in Ubuntu and Linux Mint systems.


Fixes

  • Added support for the following GPUs:
    • GeForce GT820M
      GeForce GTX 760A
      GeForce GTX 850A
      GeForce 810A
      GeForce 820A
      GeForce 840A
  • Fixed a bug that could cause VT-switching to fail following a suspend, resume, and driver reload sequence.
  • Fixed a bug that caused incorrect colors to be displayed on X screens running at depth 8 on some GPUs.
  • Fixed a bug that prevented GPUs from being correctly recognized in MetaMode strings when identified by UUID.
  • Implemented support for disabling indirect GLX context creation using the -iglx option available on X.Org server release 1.16 and newer.  Note that future X.Org server releases may make the -iglx option the default. To re-enable support for indirect GLX on such servers, use the +iglx option.
  • Added the "AllowIndirectGLXProtocol" X config option. This option can be used to disallow use of GLX protocol. See "Appendix B. X Config Options" in the README for more details.
More details in the Release Notes.

Installation

Remove currently installed graphics drivers.

sudo apt-get purge nvidia*
End the graphic session with the appropriate command from the list of commands given below:

# For Ubuntu LightDM [DEFAULT]
sudo service lightdm stop

#For Gnome GDM
sudo service gdm stop

#For Linux Mint MDM
sudo service mdm stop
Download the appropriate driver from the source. Here are the download links:
Make the installer file executable.

chmod +x ~/Downloads/NVIDIA-Linux-*-340.58.run
Run the executable installer file.

sudo sh ~/Downloads/NVIDIA-Linux-*-340.58.run
This will start the installation process. Follow the on-screen instructions to complete the process.

Note : Do not delete the installer file. It will be needed while removing/uninstalling the Nvidia 340.58 driver if it fails to work properly.

To uninstall,

sudo sh ~/Downloads/NVIDIA-Linux-*-340.58.run --uninstall

Tuesday, 11 November 2014

How To : Install/Upgrade to Linux Kernel 3.18-RC4 in Ubuntu/Linux Mint Systems

    The Linux Kernel 3.18-RC4 is now available for the users, announced Linus Torvalds. This Linux Kernel version comes with plenty of fixes and improvements. This article will guide you to install or upgrade to Linux Kernel 3.18-RC4 in your Ubuntu or Linux Mint system.


Installation

For 32-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc4-vivid/linux-headers-3.18.0-031800rc4_3.18.0-031800rc4.201411091835_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc4-vivid/linux-headers-3.18.0-031800rc4-generic_3.18.0-031800rc4.201411091835_i386.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc4-vivid/linux-image-3.18.0-031800rc4-generic_3.18.0-031800rc4.201411091835_i386.deb
Install them.

$ sudo dpkg -i linux-headers-3.18*.deb linux-image-3.18*.deb
Reboot the system.

sudo reboot

For 64-Bit Systems

Download the .deb packages.

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc4-vivid/linux-headers-3.18.0-031800rc4_3.18.0-031800rc4.201411091835_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc4-vivid/linux-headers-3.18.0-031800rc4-generic_3.18.0-031800rc4.201411091835_amd64.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc4-vivid/linux-image-3.18.0-031800rc4-generic_3.18.0-031800rc4.201411091835_amd64.deb
Install them.

$ sudo dpkg -i linux-headers-3.18*.deb linux-image-3.18*.deb
Reboot the system.

sudo reboot

To uninstall,

sudo apt-get remove 'linux-headers-3.18*' 'linux-image-3.18*'

    Total Pageviews