Saturday 1 March 2014

Procedure to upgrade Linux 6.1 to 6.4 without CD from a local repository

We are doing an upgrade of RHEL 6.1 to 6.4. It is applicable to other versions and distributions like CentOS.
1) Create a local repository to have all the packages of the new version available.
Create a file called /etc/yum.repos.d/server64.repo with the following contents:
[server64x64]
name=Red Hat Enterprise Linux 6.4 x64
baseurl=ftp://ftprepo.domain.local/RHEL/rhel64x64/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

2) Verify what is the current running version and kernel.
# uname -a
Linux SERVER1.domain.local 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.1 (Santiago)

3) List the available packages and specially the kernel version. Limit yum to use the new repository only.
yum --disablerepo="*" --enablerepo="server64x64" list available
yum --disablerepo="*" --enablerepo="server64x64" list kernel

4) Run the update command and wait it for completion.
For interactive mode, when questions have to be answered to proceed with the update, use:
yum --disablerepo="*" --enablerepo="server64x64" update
For automated mode, assuming all questions will be answered as “yes”, use:
yum –y --disablerepo="*" --enablerepo="server64x64" update

Example of what will be presented on the screen:
Transaction Summary
================================================================================
Install      21 Package(s)
Upgrade     278 Package(s)

Total download size: 224 M
Is this ok [y/N]:

Replaced:
  abrt-plugin-logger.x86_64 0:1.1.16-3.el6
  abrt-plugin-mailx.x86_64 0:1.1.16-3.el6
  abrt-plugin-rhtsupport.x86_64 0:1.1.16-3.el6
  abrt-plugin-sosreport.x86_64 0:1.1.16-3.el6
  libjpeg.x86_64 0:6b-46.el6

Complete!

5) Verify the new version of the OS
# uname -a
Linux SERVER1.domain.local 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
#cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.4 (Santiago)

6) Reboot to finish the process and to allow the new kernel and configuration be activated.

PS: RHEL 6.4 ships samba version 3.6. It has different configuration parameters in /etc/samba/smb.conf file when doing authentication thru AD.
Below are the required changes:

Before:

;    idmap uid = 10000-20000
;    idmap gid = 10000-20000
;    idmap backend = rid:DOMAIN=10000-20000

After:

    idmap config * : backend = tdb
    idmap config * : range = 20001-30000
    idmap config DOMAIN : backend = rid
    idmap config DOMAIN : range = 10000-20000
    idmap config DOMAIN : base_rid = 0

(Replace DOMAIN with the short name of your domain name)

7) End