Trouble with Yum

Hi,

Having some troube with Yum cahce-
Tried to install the VM manager and got the red sign with the massage :

" File contains no section headers. file: file:///etc/yum.repos.d/mssql-server.repo, line: 1 ‘\r\n’

The install/update may have failed due to metadata caching issues. Please clean the cache by clicking the button below and retry the install/update operation."

Tried to press the Clear Yum Cache with no success.
Any ideas ?

Thank you.

Please try to clear it at command line:

yum clean all

1 Like

Tried it.
The same message appears about “file contains no section headers” both in CMD and GUI

cat /etc/yum.repos.d/mssql-server.repo
At least it will be visible the file which claim to have issues…

1 Like

I had a problem familiar to your, I could not clear the cache so I used this command

rm -f /var/lib/rpm/__db.[0-9][0-9]*
rpm --quiet -qa
yum clean all

1 Like

Your repo file starts with a blank line or is missing some content. As said by @pike, look at the file content. You might have to remove the blank line or recreate the file.

How should I do that ? I’m new to linux

curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo

As per this guide:

1 Like

but it’s not about the SQLserver.
It happend after I tried to install the VM manager

If I’m not wrong, yum checks all the repos to build the cache. The error refers to that repo file so it seems the file could have been corrupted. If you post the content of that file we can see what’s wrong.

2000 - max5

This is the result after perfoming the commmand which was given above

The file contents are wrong. It seems when you used curl to download the repo file it failed to find it (maybe a missing letter or something of that sort).
If you are using Microsoft SQL Server, you can recreate it as instructed above.
It should look like:

[packages-microsoft-com-mssql-server-2017]
name=packages-microsoft-com-mssql-server-2017
baseurl=https://packages.microsoft.com/rhel/7/mssql-server-2017/
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
2 Likes

tried to reinstall and the same message appear.
Is there a way to erase the file and reinstall ?

Delete the file(s):

rm -f /etc/yum.repos.d/mssql-server*.repo

Recreate it:

curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo
1 Like

A new message appear after this :
rmpdb open failed

Maybe you need a clean all again…

yum clean all

problem solved

this is what I did :

rm -f /var/lib/rpm/__db
rm -f /etc/yum.repos.d/mssql-server.repo
db_verify /var/lib/rpm/Packages
rpm --rebuilddb
rm -rf /var/cache/yum
clicked the red banner in the GUI
checked SQL status and it’s running so maybe there was a double configuration in some way

1 Like

If you have a use for Microsoft SQL you won’t receive updates for it, as the repoditory file has been deleted.