Unreadable CentOS-Base.repo

Issues related to applications and software problems
Post Reply
pldm
Posts: 2
Joined: 2022/04/07 01:22:31

Unreadable CentOS-Base.repo

Post by pldm » 2022/04/07 01:29:51

I used sudo yum update apache and I get this output regarding my CentOS-Base.repo file. I searched for answers but they all require legible lines from the CentOS-Base.repo file. Where do I go from here?
Attachments
unreadable CentOS-Base.repo.png
unreadable CentOS-Base.repo.png (39.65 KiB) Viewed 2514 times

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Unreadable CentOS-Base.repo

Post by TrevorH » 2022/04/07 08:18:01

This is my CentOS 7 file. It may have some changes over the defaults but better than yours which appears to have been overwritten.

Code: Select all

[root@centos7 ~]# cat /etc/yum.repos.d/CentOS-Base.repo 
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled = 1

#released updates 
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled = 1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled = 1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
keepcache = 0
priority=1
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Unreadable CentOS-Base.repo

Post by jlehtone » 2022/04/07 09:17:26

pldm wrote:
2022/04/07 01:29:51
I used sudo yum update apache and ...
Neither CentOS 7 repos nor EPEL contain package named "apache". That is, even if your repo files were ok, that command should error ...
... unless you have some other, less known repo that provides apache.

Overall, sudo yum update should be a better practice; install all available updates.

pldm
Posts: 2
Joined: 2022/04/07 01:22:31

Re: Unreadable CentOS-Base.repo

Post by pldm » 2022/04/07 16:12:03

TrevorH wrote:
2022/04/07 08:18:01
This is my CentOS 7 file. It may have some changes over the defaults but better than yours which appears to have been overwritten.

Code: Select all

[root@centos7 ~]# cat /etc/yum.repos.d/CentOS-Base.repo 
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled = 1

#released updates 
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled = 1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled = 1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
keepcache = 0
priority=1
So, am I supposed to wipe my repo and replace it with something similar to yours? I noticed my other files in /etc/yum.repos.d are all unreadable. What does this mean and what do people do in this situation?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Unreadable CentOS-Base.repo

Post by TrevorH » 2022/04/07 16:36:29

Having unreadable files in there is not a normal occurrence. The only time I've ever seen anything like this before has been with user error but the contents of them in that case was not binary unreadable gobbledegook like yours. However, since I can only see the complaints that yum made about the files and not the actual files themselves I can't really speculate on the cause. Since the screenshot you posted complains about lines 3, 4, 10, 18 and 19, I do not know if the other lines that were not mentioned looked like they were valid or not.

These files should not be things that are frequently written. They get installed at install time and belong to the package 'centos-release' and will be updated whenever that package is updated. Since all the .repo files that package supplies are marked as "config,noreplace" if you modified them prior to any update then your modified files would be left alone and the update would create .repo.rpmnew files instead. Really the only time they get modified other than package update is when an admin with root edits them.

You might try running file -s /etc/yum.repos.d/CentOS-Base.repo and see if the file has been overwritten by something that 'file' recognises as being a totally different file type. Or look at the contents of the file and see if it contains any hint as to what it might have been. I'd speculate that the most likely cause is someone redirecting the output from some other command over the top of them by mistake or perhaps they have been compressed by accident or maybe you had disk problems and fsck has done something weird. Without knowing what the contents of the file really is, it's impossible to tell.
am I supposed to wipe my repo and replace it with something similar to yours?
Yours are totally corrupt so you either replace that CentOS-Base.repo with the contents of mine or you download the centos-release package manually from one of the mirrors and reinstall it then move the .repo.rpmnew file over the top of the corrupt one. And it's not a repo in its own right, it's a file that points to an online yum repo.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply