9 Replies Latest reply: Dec 20, 2012 4:31 PM by Catch_22 RSS

    Using YUM for Oracle Linux 6

    Jimbo
      I am trying to figure out if I can make use of YUM for my Oracle Linux 6 install. I have never used YUM so it is a bit new to me

      Q1. My first question is – if my server has no Web access ( even via proxy ) is it possible / worthwhile even trying to config or use YUM ? Should I instead just do all re-requisite package loading via RPM ( after I have manually transferred the required packages onto the server ) ?

      Q2. My intention is to install 11gR2 on OL 6 server. I have check out Oracle’s Public YUM Repository ( http://public-yum.oracle.com ). However I guess this is only useful if you are using YUM to directly download and apply the required linux packages. If as in my case I am on a server with no direct / proxy access to the web then I presume I simply have to go to a server that does have web access, search / download any required packages and then manually transfer them across to my database server ?

      I suppose the alternative is to retrieve any required packages from the source Linux DVD’s (if I have them ) ?

      Q3. Is it possible to have YUM simply download required packages without applying them – I am thinking if it is possible to use YUM on another staging server simply to get the packages and then move them across to my database server. However I am not sure that makes sense because I assume YUM will look for the dependent packages NOT installed on the current server i.e. the staging server ( as opposed to my target database server ) ? Therefore it is comparing the install state of the current staging server

      Q4. Thinking outside of the box - is it possible to configure YUM to use a local disk mount point / directory as its repository, instead of remote repository via a base URL ? i.e. could I have /etc/yum.repos.d/local.repo and populate it with something like

      [Install_Local_Disk]
      name=Local Disk Repository
      baseurl=file:///u01/yum_repos
      gpgcheck=0
      enabled = 1
      skip_if_unavailable=True

      thanks,
      Jim
        • 1. Re: Using YUM for Oracle Linux 6
          EdStevens
          Jimbo wrote:
          I am trying to figure out if I can make use of YUM for my Oracle Linux 6 install. I have never used YUM so it is a bit new to me

          Q1. My first question is – if my server has no Web access ( even via proxy ) is it possible / worthwhile even trying to config or use YUM ? Should I instead just do all re-requisite package loading via RPM ( after I have manually transferred the required packages onto the server ) ?

          Q2. My intention is to install 11gR2 on OL 6 server. I have check out Oracle’s Public YUM Repository ( http://public-yum.oracle.com ). However I guess this is only useful if you are using YUM to directly download and apply the required linux packages. If as in my case I am on a server with no direct / proxy access to the web then I presume I simply have to go to a server that does have web access, search / download any required packages and then manually transfer them across to my database server ?

          I suppose the alternative is to retrieve any required packages from the source Linux DVD’s (if I have them ) ?

          Q3. Is it possible to have YUM simply download required packages without applying them – I am thinking if it is possible to use YUM on another staging server simply to get the packages and then move them across to my database server. However I am not sure that makes sense because I assume YUM will look for the dependent packages NOT installed on the current server i.e. the staging server ( as opposed to my target database server ) ? Therefore it is comparing the install state of the current staging server

          Q4. Thinking outside of the box - is it possible to configure YUM to use a local disk mount point / directory as its repository, instead of remote repository via a base URL ? i.e. could I have /etc/yum.repos.d/local.repo and populate it with something like

          [Install_Local_Disk]
          name=Local Disk Repository
          baseurl=file:///u01/yum_repos
          gpgcheck=0
          enabled = 1
          skip_if_unavailable=True

          thanks,
          Jim
          I just googled 'configure local yum server linux' and got lots of interesting looking hits. I really have no need to actually set up a local server but have thought about doing so just for the learning exercise. I think I'll read some of those hits now ....
          Particularly this: http://www.oracle.com/technetwork/articles/servers-storage-admin/yum-repo-setup-1659167.html

          Edited by: EdStevens on Dec 20, 2012 10:47 AM
          • 2. Re: Using YUM for Oracle Linux 6
            Catch_22

            Your questions should be clear after understanding the following:

             

            RPM is the Red Hat package manager. YUM is a front-end that unlike RPM resolves software package dependencies and prevents software installation conflicts. There is generally no reason to use RPM. YUM is the standard on Enterprise Linux 5 and later to perform software installations.

             

            You can use YUM also for installing a RPM file that you have stored on disk or use URL, e.g.:

             

             

            # yum install oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64.rpm
            # yum install http://public-yum.oracle.com/repo/OracleLinux/OL6/3/base/x86_64/oracle-...rpm
            

             

             

            Software dependencies in YUM will be resolved using the channels provided in your yum repository configuration files stored in /etc/yum.repos.d.

             

            # yum repolist
            

             

            Note: oracle-rdbms-server-11gR2-preinstall is a special package that triggers YUM dependencies to fetch the required software.

             

            If you want to use YUM to only download packages:

             

             

            # yum install yum-downloadonly
             # yum install --downloadonly --downloaddir=/home/dude oracle-rdbms-server-11gR2-preinstall
            

             

            Your example to use a YUM repository on your local disk should work, provided you copy the complete structure from the installation DVD, including the repository metadata. To create your own custom software repository, you need to generate your own YUM metadata using the utilities from the createrepo package.

            • 3. Re: Using YUM for Oracle Linux 6
              Catch_22
              The instructions of the link you outlined require a ULN subscription since it attempts to keep a local YUM repository in sync with the Oracle ULN server. To setup your own YUM repository, you can either simply copy the complete contents of the installation DVD and create a YUM configuration file that points to it, or if you want to create a custom repository, use e.g. createrepo -d -s sha /home/yumrepo/ol6_mystuff to create the necessary YUM metadata.
              • 4. Re: Using YUM for Oracle Linux 6
                EdStevens
                Dude wrote:
                I think the instructions of your link require a ULN subscription since it attempts to keep a local YUM repository in sync with the Oracle ULN server.
                Yes it does. Not sure if that's a show-stopper for the OP. He seemed to indicate that he had other servers that could access the internet, and a basic ULN support contract is chump change, so it appears to be a viable solution. If the ULN is a show stopper, then yes, he could create his own local repository from the CD.

                To setup your own YUM repository, you can either simply copy the complete contents of the installation DVD and create a YUM configuration file that points to it, or if you want to create a custom repository, use e.g. createrepo -d -s sha /home/yumrepo/ol6_mystuff to create the necessary YUM metadata.
                • 5. Re: Using YUM for Oracle Linux 6
                  Jimbo
                  thanks Dude,

                  You have highlighted my dilema perfectly. I would love to be able to use Yum to download oracle-rdbms-server-11gR2-preinstall and any of its dependencies to my database server.

                  The big problem is that my database server is completed isolated from the Web, therefore I can't get to the Oracle YUM Repository from that server. If I try from another server then I am guessing the dependences downloaded will only be those that are missing from the server that I actually run the YUM command from ( i.e. a staging server ) rather than from the Database Server ?

                  Unless YUM downloads all the dependencies regardsless of whether they are installed on the current server or not ? ( is this possible ? )

                  Jim
                  • 6. Re: Using YUM for Oracle Linux 6
                    Catch_22

                    You can like I mentioned use the installation DVD (OL 6.3 and later), which contains all the required software to use YUM to install oracle-rdbms-server-11gR2-preinstall. For instance:

                    Cut and paste the following to the command prompt as root user:


                    cat > /etc/yum.repos.d/dvd.repo <<EOF
                    [Install_DVD_base]
                    name=Install DVD
                    baseurl=file:///mnt/Server
                    gpgcheck=0
                    enabled=1
                    skip_if_unavailable=True
                    $(echo)
                    [Install_DVD_uek2]
                    name=Install DVD UEK2
                    baseurl=file:///mnt/UEK2
                    gpgcheck=0
                    enabled=1
                    skip_if_unavailable=True
                    EOF
                    #


                    Then insert the OS installation DVD and mount it:

                    cd /
                    umount /dev/cdrom
                    mount -o loop -t iso9660 /dev/cdrom /mnt


                    (you will need to dismount the DVD first if you are logged in using a Gnome GUI session on your server, which automounts the media)

                    Then use YUM as usual and it should use the installation DVD as the installation source.

                    If you need errata and software updates and don't have access to the public Internet, you need to create either/maintain your own software repository or setup a central YUM repository in your LAN with a ULN subscription as mentioned in the previous post. Other servers can then access the repository from our own YUM server using NFS share, SSHFS share or web depending what services you install and configure on that server.

                    • 7. Re: Using YUM for Oracle Linux 6
                      Avi Miller-Oracle
                      Dude wrote:
                      The instructions of the link you outlined require a ULN subscription since it attempts to keep a local YUM repository in sync with the Oracle ULN server.
                      Actually, you can easily modify the script to sync from public-yum.oracle.com instead of ULN if you don't have a ULN subscription. Just remove the segment of Python code that returns a list of channels from ULN and replace it with code that outputs a list of public-yum.oracle.com channels you'd like to mirror instead.

                      So, get a list of all the repo ids of the channels that you have enabled with:
                      # yum repolist
                      You may want to check /etc/yum.repos.d/public-yum-ol6.repo to ensure the addons channel is enabled as well. Once you have a list of repo ids, edit 167283.sh as follows:

                      Remove the Python block and the first line of the while loop:
                      # easiest way to get the list of channel labels is direct from ULN via python
                      # so lets write a simple python utility locally so that we can get the info
                      (
                      cat << 'EOF'
                      #!/usr/bin/python
                      import sys
                      sys.path.append('/usr/share/rhn/')
                      from up2date_client import up2dateAuth,rpcServer
                      sid = up2dateAuth.getSystemId()
                      if sid is None:
                          print "Error: system not registered"
                          sys.exit(-1)
                      try:
                          s = rpcServer.getServer()
                          for chan in [x['label'] for x in s.up2date.listChannels(sid)]:
                              print chan
                      except:
                          print "Error: ", sys.exc_info()[1].faultString
                          sys.exit(-1)
                      EOF
                      ) > $CHAN_LIST
                      
                      chmod 777 $CHAN_LIST
                      
                      ${CHAN_LIST} | sort | while read CHANNEL ; do
                      And replace it with:
                      CHAN_LIST="ol6_latest ol6_UEK_latest ol6_addons"
                      
                      for CHANNEL in ${CHAN_LIST}; do
                      Essentially, that replaces the ULN output with a list of repos from public-yum.oracle.com output. :)

                      Alternatively, if you want to sync all enabled yum channels automatically:
                      CHAN_LIST=`yum -v repolist enabled | grep "Repo-id" | cut -d":" -f 2`
                      
                      for CHANNEL in ${CHAN_LIST}; do
                      That will use yum itself to list all enabled channels and then iterate over them.

                      Edited by: Avi Miller on Jan 4, 2013 3:41 PM to fix a variable name in the replacement code.

                      Edited by: Avi Miller on Jan 4, 2013 3:57 PM to fix the variable name and to add the automated option.
                      • 8. Re: Using YUM for Oracle Linux 6
                        Avi Miller-Oracle
                        Jimbo wrote:
                        Unless YUM downloads all the dependencies regardsless of whether they are installed on the current server or not ? ( is this possible ? )
                        That's the point of YUM. :) Essentially, you can use the script to create a local mirror of ULN or public-yum.oracle.com on a server within your environment and then use yum on all the rest of your servers to pull packages from that local mirror.
                        • 9. Re: Using YUM for Oracle Linux 6
                          Catch_22
                          Thanks for the info! I will keep a separate note for that.