• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Configure YUM to connect to Oracle Public Repository in Oracle Enterprise Linux

by admin

This post will assist you in configuring an OEL system to connect to the Oracle Public YUM repositories. Your OEL System must have a working connection to the internet for YUM to work correctly. If your system is isolated from the internet due to security policies, you will need to set up a local repository and populate it manually.

To configure your OEL system to use the Oracle Public YUM Repository, accomplish the following actions as root.

1. Checking YUM Configuration

1. Change to the /etc directory.

# cd /etc

2. Ensure the contents of the yum.conf file look like the following. Make any changes necessary before proceeding to step 3.

[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h

# Default.
# installonly_limit = 3

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
# Never update kernel and kernel-uek
installonlypkgs=kernel kernel-smp kernel-bigmem kernel-enterprise kernel-debug kernel-unsupported kernel-uek
exclude=up2date

NOTE: If your system needs to use a proxy to access the internet, add the following line to the yum.conf file:

proxy=http://[url.to.proxy]:[port]

For example:

proxy=http://www.myproxy.com:80

You can also use an IP address in place of the URL.

3. Change to the /etc/yum.repos.d directory.

# cd /etc/yum.repos.d

4. List the contents of the yum.repos.d directory. Repository configuration files have a file extension of .repo. If the only files in the directory are Exadata-computenode.repo.sample and/or ULN-Base.repo, go on to the “2. Creating a Repo File” section. If there are more files than just Exadata-computenode.repo.sample and/or ULN-Base.repo, go on to the “3. Adding a Repository Configuration” section.

2. Creating a Repo File

1. In /etc/yum.repos.d, edit a new file called oracle-public-yum-ol6.repo.

2. In the new file, add the following lines:

# vi /etc/yum.repos.d/oracle-public-yum-ol6.repo
[public_ol6_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
gpgcheck=1
enabled=1

3. Save the file.

4. Go to the “4. Test the Repository” section.

3. Adding a Repository Configuration

1. Review each of the repo files in the /etc/yum.repos.d. Look for section that looks similar to this:

[public_ol6_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/$basearch/
gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
gpgcheck=1
enabled=1

If you do not see this in any of the repo files, accomplish the steps in the “2. Creating a Repo File” section. If you do see this in one of the repo files, go to next step below.

2. Ensure the enabled line is set to 1 (active):

enabled=1

If not set to 1, make the change and save the file. If set to 1, you are already configured to access the Oracle Public YUM Repository.

3. Go to the “4. Test the Repository” section.

4. Test the Repository

Issue the following command:

# yum repolist

You should see the list of repositories that you added using this post. For any errors, first go back and retrace your steps to ensure all of the above steps were correctly accomplished. If the configuration is confirmed good, check the list of common errors below for a possible solution.

Filed Under: Linux, OEL 6

Some more articles you might also be interested in …

  1. enum4linux Command Examples in Linux
  2. How to change the default IP address of docker bridge
  3. lslogins Command Examples in Linux
  4. Nginx load balancing
  5. run-mailcap: command not found
  6. How To Configure SNMP Daemons: snmpd and snmptrapd on CentOS/RHEL 5,6 and 7
  7. ndctl: command not found
  8. CentOS / RHEL : anacron basics (What is anacron and how to configure it)
  9. Understanding /etc/xinetd.conf file in Linux
  10. How to effectively use Man Pages under Linux

You May Also Like

Primary Sidebar

Recent Posts

  • batch: Execute commands at a later time when the system load levels permit
  • bat: Print and concatenate files
  • bastet: Clone of the game Tetris in the terminal
  • bashmarks: Save and jump to commonly used directories using 1 character commands

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright