Error: File contains no section headers. File: file: /////etc/yum.repos.d/CentOS-Base.repo, line: 1 solution

error

"Let's connect to a virtual machine" https://dotinstall.com/lessons/basic_vagrant/24106

While learning the above lesson with dot installation

$ sudo yum -y install httpd 

After entering the command [vagrant @ localhost ~]

Error: File contains no section headers.
file: file://///etc/yum.repos.d/CentOS-Base.repo, line: 1

I got an error like this.

Solution

https://centossrv.com/bbshtml/webpatio/1350.shtml

When I referred to the above article, I found that the error was "The first line of etc/yum.repos.d/CentOS-Base.repo is strange".

$ sudo vi /etc/yum.repos.d/CentOS-Base.repo

When I executed and looked at the data inside, the first line was something like entOS-Base.repo. It should be # CentOS-Base.repo (don't forget the space after #!), Change it and try again.

$ sudo yum -y install httpd

After executing, I was able to successfully complete!

Summary

There are many things I can't do at all when resolving errors, but most of them are typos, so be sure to check carefully.

Recommended Posts

Error: File contains no section headers. File: file: /////etc/yum.repos.d/CentOS-Base.repo, line: 1 solution
Solution for "Import Error: No module named requests"