RHEL6 Beta: HowTo Use yum Command To Install Packages Without RHN

Posted on in Categories last updated July 15, 2010

I‘m testing Redhat Enterprise Linux 6 for our apps. However, RHN do not support beta RHEL 6 software. How do I use yum command to install additional software without using DVD ROM?

You need to enable beta repo by editing /etc/yum.repos.d/rhel-beta.repo file, enter:
# vi /etc/yum.repos.d/rhel-beta.repo
Make sure enable is set to 1:

[rhel-beta]
name=Red Hat Enterprise Linux $releasever Beta - $basearch
#baseurl=ftp://ftp.redhat.com/pub/redhat/rhel/beta/$releasever/$basearch/os/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=rhel-$releasever-beta&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta

[rhel-beta-optional]
name=Red Hat Enterprise Linux $releasever Beta (Optional) - $basearch
#baseurl=ftp://ftp.redhat.com/pub/redhat/rhel/beta/$releasever/optional/$basearch/os/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=rhel-optional-$releasever-beta&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta

Save and close the file. Now, you can access software without RHN for testing purpose under RHEL 6.0 beta.
# yum list | less
# yum search php

Sample outputs:

Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
=============================================================================================================== Matched: php ================================================================================================================
php.x86_64 : PHP scripting language for creating dynamic web sites
php-bcmath.x86_64 : A module for PHP applications for using the bcmath library
php-cli.x86_64 : Command-line interface for PHP
php-common.x86_64 : Common files for PHP
php-dba.x86_64 : A database abstraction layer module for PHP applications
...

You can install php as follows:
# yum install php
Sample outputs:

Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.3.2-3.el6 set to be updated
--> Processing Dependency: php-cli = 5.3.2-3.el6 for package: php-5.3.2-3.el6.x86_64
--> Processing Dependency: php-common = 5.3.2-3.el6 for package: php-5.3.2-3.el6.x86_64
--> Running transaction check
---> Package php-cli.x86_64 0:5.3.2-3.el6 set to be updated
---> Package php-common.x86_64 0:5.3.2-3.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================
 Package            Arch           Version             Repository         Size
===============================================================================
Installing:
 php                x86_64         5.3.2-3.el6         rhel-beta         1.1 M
Installing for dependencies:
 php-cli            x86_64         5.3.2-3.el6         rhel-beta         2.2 M
 php-common         x86_64         5.3.2-3.el6         rhel-beta         515 k

Transaction Summary
===============================================================================
Install       3 Package(s)
Downloading Packages:
(1/2): php-cli-5.3.2-3.el6.x86_64.rpm                   | 2.2 MB     00:03     
(2/2): php-common-5.3.2-3.el6.x86_64.rpm                | 515 kB     00:00     
-------------------------------------------------------------------------------
Total                                          284 kB/s | 2.7 MB     00:09     
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID f21541eb: NOKEY
rhel-beta/gpgkey                                        | 6.6 kB     00:00 ... 
Importing GPG key 0xF21541EB "Red Hat, Inc. (beta key 2) " from /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
Is this ok [y/N]: y
Importing GPG key 0x897DA07A "Red Hat, Inc. (Beta Test Software) " from /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : php-common-5.3.2-3.el6.x86_64                           1/3 
  Installing     : php-cli-5.3.2-3.el6.x86_64                              2/3 
  Installing     : php-5.3.2-3.el6.x86_64                                  3/3 

Installed:
  php.x86_64 0:5.3.2-3.el6                                                     

Dependency Installed:
  php-cli.x86_64 0:5.3.2-3.el6         php-common.x86_64 0:5.3.2-3.el6        

Complete!

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

20 comment

  1. Setting “enabled=1” is not sufficient. I made this change, and still cannot use “yum list” or other commands. I’m running the most current 64 bit version of RHEL6 beta.

  2. it doesn’t work for me.
    1/ I enabled as the following:

    [rhel-source]
    name=Red Hat Enterprise Linux $releasever - $basearch - Source
    baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    
    [rhel-source-beta]
    name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
    baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    --- when run 'yum list | less'
    Got error:
    Loaded plugins: refresh-packagekit, rhnplugin
    ftp://ftp.redhat.com/pub/redhat/linux/beta/6Server/en/os/SRPMS/repodata/repomd.xml: [Errno 14] PYCURL ERROR 9 - "Server denied you to change to the given directory"
    Trying other mirror.
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-source-beta. Please verify its path and try again
    
    2/ when I change the mirror as yours:
    [rhel-source]
    name=Red Hat Enterprise Linux $releasever - $basearch - Source
    # baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
    mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=rhel-$releasever-beta&arch=$basearch
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    
    [rhel-source-beta]
    name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
    # baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
    mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=rhel-optional-$releasever-beta&arch=$basearch
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    But got error:
    Loaded plugins: refresh-packagekit, rhnplugin
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-source. Please verify its path and try again
    Could not parse metalink https://mirrors.fedoraproject.org/metalink?repo=rhel-6Server-beta&arch=x86_64 error was 
    No repomd file
    
    3/ Then I cp your rhel-source.repo, but still got error:
    Loaded plugins: refresh-packagekit, rhnplugin
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhel-beta. Please verify its path and try again
    Could not parse metalink https://mirrors.fedoraproject.org/metalink?repo=rhel-6Server-beta&arch=x86_64 error was 
    No repomd file
    
  3. The instructions are for the beta with following /etc/yum.repos.d/rhel-beta.repo RHEL6 non beta sees the repositories. I’m not sure if they’ll work

    [rhel-beta]
    name=Red Hat Enterprise Linux $releasever Beta - $basearch
    #baseurl=ftp://ftp.redhat.com/pub/redhat/rhel/beta/$releasever/$basearch/os/
    mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=rhel-6-beta&arch=$basearch
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
    
    [rhel-beta-optional]
    name=Red Hat Enterprise Linux $releasever Beta (Optional) - $basearch
    #baseurl=ftp://ftp.redhat.com/pub/redhat/rhel/beta/$releasever/optional/$basearch/os/
    mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=rhel-optional-6-beta&arch=$basearch
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
    
  4. When am trying with RHEL-5 same error occurring….

    [[email protected] yum.repos.d]# yum install wget samba
    Loading “rhnplugin” plugin
    Loading “installonlyn” plugin
    This system is not registered with RHN.
    RHN support will be disabled.
    Setting up Install Process
    Setting up repositories
    Reading repository metadata in from local files
    Parsing package install arguments
    No Match for argument: wget
    No Match for argument: samba
    Nothing to do
    vi /etc/yum.repos.d/rhel-debuginfo.repo

    [rhel-debuginfo]
    name=Red Hat Enterprise Linux $releasever – $basearch – Debug
    baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

    Any suggestions ??

  5. This will not work. You cant use RHN repos without a valid RHN subscription.

    The best workaround is to use the CentOS repo that correspond with your current rhel version. i.e. CentOS 6 repo with rhel 6.

  6. how to install the development tools for rhel6.4 ,please tell me [[email protected] ~]# yum groupinstall ‘Development Tools’
    Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
    Setting up Group Process
    Warning: Group Development Tools does not exist.
    No packages in any requested group available to install or update
    [[email protected] ~]#

Leave a Comment