Wednesday, 14 January 2015

How to install Google Chrome on RHEL/CentOS 6 or 7

How to install Google Chrome 28+ on RHEL/CentOS 6 or 7

The problem

Google developers seem to think that Red Hat Enterprise Linux 6 - aka RHEL 6 - and its free equivalents (e.g. CentOS 6 and Scientific Linux 6) are no longer worth supporting at all w.r.t. their Google Chrome browser from version 28 onwards. This is mainly because Google are using very recent Linux build systems which produce backwards-incompatible binaries, which is not a wise move when you're shipping closed source binaries.
It seems Google missed the fact that RHEL/CentOS 6 are both fully supported by their respective maintainers until November 2020 (they're the only Linux distros offering a decade of support). It's equally bad that the latest Mozilla Firefox and Opera browsers run happily on the platforms, providing short shrift for any excuses the Google folks have come up with to justify their somewhat blinkered support stance.
I've built Chromium from regularly pulled source code in the past for CentOS 5 and it's a tough job on that platform and I didn't want to do it again for CentOS 6. Note that RHEL/CentOS 7 users are also catered for, so please keep reading if you're on that platform.

The solution

By using libraries from a more recent Linux distro and putting them in a tree exclusively picked up by Google Chrome, you can indeed run the latest Google Chrome on RHEL/CentOS 6.5 or later. I've picked Fedora 15 and 17 RPMs to extract the libraries from because they're close to RHEL/CentOS 6's libraries and the newest ones to actually work with the latest Google Chrome release on RHEL/CentOS 6.

The download

Please update your bash and wget packages now
There were vulnerabilities in bash and wget that were recently fixed in RHEL/CentOS 6 and 7. Please update your system (e.g. "yum update bash wget") as soon as possible.
install_chrome.sh 6.10 (29th August 2014 - redirected stderr/stdout to /dev/null in google-chrome script, added Obsoletes: line to RPM spec file)
It's a bash shell script, so you download and run it as root as follows:
wget http://chrome.richardlloyd.org.uk/install_chrome.sh
chmod u+x install_chrome.sh
./install_chrome.sh
The script has optional command line arguments - here's the output of "./install_chrome.sh -h":
Syntax: ./install_chrome.sh [-b] [-d] [-f [-f [-f]]] [-h] [-n] [-q] [-s]
        [-t tmpdir] [-u] [-U]

-b (or --beta) will switch to beta versions (google-chrome-beta).
-d (or --delete) will delete the temporary directory used for downloads
   if an installation was successful.
-f (or --force) forces an automatic "y" for any interactive prompting
   except for OS mismatch/OS upgrade/reboot prompts. Specify -f twice to force
   it for OS mismatches or OS upgrades as well and three times for reboots
   on top of that.
-h (or -? or --help) will display this syntax message.
-n (or --dryrun) will show what actions the script will take,
   but it won't actually perform those actions.
-q (or --quiet) will switch to "quiet mode" where minimal info is displayed.
   Specify -q twice to go completely silent except for errors.
-s (or --stable) will switch to stable versions (google-chrome-stable),
   which is the default if -b or -U haven't previously been specified.
-t tmpdir (or --tmpdir tmpdir) will use tmpdir as the temporary directory
   parent tree rather than $TMPDIR (if set) or /tmp.
-u performs an uninstallation of Google Chrome and chrome-deps rather the
   default action of an installation.
-U (or --unstable) will switch to unstable versions (google-chrome-unstable).
I would recommend you read the comments at the top of the script and inspect the code carefully since you need to run it as root. It will perform a fair number of downloads to obtain what it needs and if it finishes successfully, you should be able to run the "google-chrome" command (or select it from the Internet category in your GNOME main menu) as a non-root user.

Tuesday, 13 January 2015

Adding EPEL repository to RHEL 6.5

What is EPEL


EPEL (Extra Packages for Enterprise Linux) is open source and free community based repository project from Fedora team which provides 100% high quality add-on software packages for Linux distribution including RHEL (Red Hat Enterprise Linux), CentOS, and Scientific Linux. Epel project is not a part of RHEL/Cent OS but it is designed for major Linux distributions by providing lots of open source packages like networking, sys admin, programming, monitoring and so on. Most of the epel packages are maintained by Fedora repo.
Why we use EPEL repository?

    Provides lots of open source packages to install via Yum.
    Epel repo is 100% open source and free to use.
    It does not provide any core duplicate packages and no compatibility issues.
    All epel packages are maintained by Fedora repo.

RHEL/CentOS 7 64 Bit

## RHEL/CentOS 7 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
# rpm -ivh epel-release-7-2.noarch.rpm


RHEL/CentOS 6 32-64 Bit

## RHEL/CentOS 6 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

How Do I Verify EPEL Repo?

You need to run the following command to verify that the EPEL repository is enabled. Once you ran the command you will see epel repository.

# yum repolist

Sample Output

Loaded plugins: downloadonly, fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: centos.aol.in
 * epel: ftp.cuhk.edu.hk
 * extras: centos.aol.in
 * rpmforge: be.mirror.eurid.eu
 * updates: centos.aol.in
Reducing CentOS-5 Testing to included packages only
Finished
1469 packages excluded due to repository priority protections
repo id                           repo name                                                      status
base                              CentOS-5 - Base                                               2,718+7
epel Extra Packages for Enterprise Linux 5 - i386 4,320+1,408
extras                            CentOS-5 - Extras                                              229+53
rpmforge                          Red Hat Enterprise 5 - RPMforge.net - dag                      11,251
repolist: 19,075


How Do I Use EPEL Repo?

You need to use YUM command for searching and installing packages. For example we search for Zabbix package using epel repo, lets see it is available or not under epel.

# yum --enablerepo=epel info zabbix

Sample Output

Available Packages
Name       : zabbix
Arch       : i386
Version    : 1.4.7
Release    : 1.el5
Size       : 1.7 M
Repo : epel
Summary    : Open-source monitoring solution for your IT infrastructure
URL        : http://www.zabbix.com/
License    : GPL
Description: ZABBIX is software that monitors numerous parameters of a network.


Let’s install Zabbix package using epel repo option –enablerepo=epel switch.

# yum --enablerepo=epel install zabbix

Note: The epel configuration file is located under /etc/yum.repos.d/epel.repo.
This way you can install as many as high standard open source packages using EPEL repo.