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

The Geek Diary

CONCEPTS | BASICS | HOWTO

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

Getting “parsing errors” When Running ‘yum repolist’

By admin

The Problem

When adding an extra repository of the public yum into existing yum repository configuration file, the following errors are shown:

# yum repolist
Loaded plugins: langpacks, ulninfo
File contains parsing errors: file:///etc/yum.repos.d/public-yum-ol7.repo
[line 91]: name=Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux 7Server (x86_64)
[line 92]: baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/UEKR4/x86_64/
[line 93]: gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
[line 94]: gpgcheck=1
[line 95]: enabled=1

The following stanzas were added to /etc/yum.repos.d/public-yum-ol7.repo

 [ol7_UEKR4]
 name=Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux $releasever ($basearch)
 baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/UEKR4/$basearch/
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
 gpgcheck=1
 enabled=1

The Solution

There is a space at the beginning of each line of the new entries. The file looks like:

[ol7_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol7_UEKR3]
name=Latest Unbreakable Enterprise Kernel Release 3 for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/UEKR3/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

 [ol7_UEKR4]
 name=Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux $releasever ($basearch)
 baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/UEKR4/$basearch/
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
 gpgcheck=1
 enabled=1

Follow the steps outlined below to resolve the issue:

1. Edit the yum repo file /etc/yum.repos.d/public-yum-ol7.repo.

# vi /etc/yum.repos.d/public-yum-ol7.repo

2. Delete the space at the beginning of each line:

[ol7_UEKR4]
name=Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux $releasever ($basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/UEKR4/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

3. Save and quit.

4. Check that the stanzas were saved properly:

# less /etc/yum.repos.d/public-yum-ol7.repo

5. Proceed to run ‘yum repolist’ again:

# yum repolist

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to prioritize the devices used for swap partition
  2. CentOS / RHEL 7 : Chrony V/s NTP (Differences Between ntpd and chronyd)
  3. Linux / UNIX : How to find files which has SUID/SGID set
  4. How to Enable FTP in CentOS/RHEL 5 and 6
  5. How to increase swap space on Linux
  6. CentOS / RHEL : Converting an Existing Root Filesystem to LVM Partition
  7. How to use “yum downloadonly” to download a package without installing it
  8. How to extract RAR files in CentOS/RHEL 7 and 8
  9. How to Create and Query a BTRFS File System
  10. How to extract RPM package without installing it

You May Also Like

Primary Sidebar

Recent Posts

  • Basics of client connectivity in Oracle Data Guard configuration
  • ORA-354 ORA-353 and ORA-312: Possible corruption in Online Redo Log File Members in a Redo Log Group
  • How to relocate the redo log files to a different location on disk
  • Oracle Database: Redo log operations (Add/Drop/Change Location)
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary