• 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

“Bad id for repo: My Repo, byte = 2” yum update error

by admin

The Problem

While executing yum commands user is getting below error:

# yum update
Bad id for repo: My Repo, byte = 2

The following is the repo file which is used for local dvd image

# cat /etc/yum.repos.d/my_repo.repo
[My Repo]
name=repo1
baseurl=file:///mnt/iso/
enabled=1
gpgcheck=0

The Solution

[My Repo] is wrong as it uses spaces between letters which are not properly translated by yum. Do not include white space in [My Repo].

So to correct it change the name file from :

# cat /etc/yum.repos.d/my_repo.repo
[My Repo]
name=repo1
baseurl=file:///mnt/iso/
enabled=1
gpgcheck=0

To

# cat /etc/yum.repos.d/my_repo.repo
[My-Repo]
name=repo1
baseurl=file:///mnt/iso/
enabled=1
gpgcheck=0

Verify

Verify the

#  yum update
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.nluug.nl
 * extras: mirror.i3d.net
 * updates: mirror.ams1.nl.leaseweb.net
base                                              | 3.6 kB  00:00:00
My-Repo                                           |  951 B  00:00:00
extras                                            | 3.4 kB  00:00:00
updates                                           | 3.4 kB  00:00:00
updates/7/x86_64/primary_db                       | 6.0 MB  00:00:01
....

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

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to delete LVM volume
  2. apt-mark Command Examples in Linux
  3. nano: command not found
  4. CentOS / RHEL 4 : How to configure interface bonding (NIC teaming)
  5. i3: command not found
  6. How to Calculate Memory Usage in Linux using sar, ps, and free
  7. nmcli Command Examples in Linux (Cheat Sheet)
  8. DNS configuration file /etc/named.conf explained
  9. setxkbmap: command not found
  10. lsof : Most commonly used examples

You May Also Like

Primary Sidebar

Recent Posts

  • ctags: Generates an index (or tag) file of language objects found in source files for many popular programming languages
  • csvtool: Utility to filter and extract data from CSV formatted sources
  • csvstat: Print descriptive statistics for all columns in a CSV file
  • csvsql: Generate SQL statements for a CSV file or execute those statements directly on a database

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright