Error: File contains parsing errors # yum list mlocate

General support questions
Post Reply
zidan86
Posts: 12
Joined: 2018/12/03 16:34:28

Error: File contains parsing errors # yum list mlocate

Post by zidan86 » 2021/01/25 23:44:11

when Create a local RPM repository , face problem in step of # yum list mlocate

Code: Select all

  Error: File contains parsing errors: file://///etc/yum.repos.d
Screenshot from 2021-01-26 01-39-31.png
Screenshot from 2021-01-26 01-39-31.png (17.65 KiB) Viewed 154 times
what's the problem in that ...?
how do solve it ?

sml
Posts: 221
Joined: 2020/01/17 09:01:44

Re: Error: File contains parsing errors # yum list mlocate

Post by sml » 2021/01/26 10:57:04

Is your local repository a mirror of an official CentOS 7 repo? If not, why are you using the CentOS 7 GPG key? Moreover, why is the key name enclosed in <>?

I cannot say anything more without you showing the full contents of my_local_depot.repo.

zidan86
Posts: 12
Joined: 2018/12/03 16:34:28

Re: Error: File contains parsing errors # yum list mlocate

Post by zidan86 » 2021/01/26 12:13:58

Code: Select all

Is your local repository a mirror of an official CentOS 7 repo? If not, why are you using the CentOS 7 GPG key? Moreover, why is the key name enclosed in <>?
yes i copy all packages from Centos 7 DVD and create it for repository

Code: Select all

 I cannot say anything more without you showing the full contents of my_local_depot.repo.
vi /etc/yum.repos.d/my_local_depot.repo
[my_local_depot]
name=my_local_depot
baseurl=file:///depot/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/<RPM-GPG-KEY-CentOS-7>

i depended that article ::
https://sites.google.com/site/syscookbo ... repository

sml
Posts: 221
Joined: 2020/01/17 09:01:44

Re: Error: File contains parsing errors # yum list mlocate

Post by sml » 2021/01/26 12:43:29

Remove the angle brackets around RPM-GPG-KEY-CentOS-7. I don't know why they put them there in the article you linked.

zidan86
Posts: 12
Joined: 2018/12/03 16:34:28

Re: Error: File contains parsing errors # yum list mlocate

Post by zidan86 » 2021/01/26 12:51:17

removed it
and still same problem too

sml
Posts: 221
Joined: 2020/01/17 09:01:44

Re: Error: File contains parsing errors # yum list mlocate

Post by sml » 2021/01/26 12:54:43

check the line end characters and any stray control characters with

Code: Select all

cat -A my_local_depot.repo
It also looks like the text in the file doesn't start in the first position:

Code: Select all

   [my_local_depot]
   name=my_local_depot
   baseurl=file:///depot/
   enabled=1
   gpgcheck=1
   gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Then remove white space at the start of each line.

zidan86
Posts: 12
Joined: 2018/12/03 16:34:28

Re: Error: File contains parsing errors # yum list mlocate

Post by zidan86 » 2021/01/26 13:09:48

Big thanks ,

i found some space in start each line , removed it and listed that repo
and running

thanks you

Image

Post Reply

Return to “CentOS 7 - General Support”