1

When I hit the command yum remove mysql I get the following error:

Loaded plugins: fastestmirror
Setting up Remove Process
No Match for argument: mysql
Error: File contains no section headers.
file: file:///etc/yum.repos.d/mysql-community-source.repo, line: 1
'mysql-connectors-community-source]\n'

I then proceed to yum list installed | grep mysql after wich I get:

mysql-community-common.x86_64
                     5.7.9-1.el6        @mysql57-community
mysql-community-libs.x86_64
                     5.7.9-1.el6        @mysql57-community
mysql-community-libs-compat.x86_64
                     5.7.9-1.el6        @mysql57-community
mysql57-community-release.noarch
                     el6-7              @/mysql57-community-release-el6-7.noarch

When I try to individually remove these with the command yum remove mysql-community-common.x86_64, I get:

enter image description here

How do I get rid of this error?

File contains no section headers.
file: file:///etc/yum.repos.d/mysql-community-source.repo, line: 1
'mysql-connectors-community-source]\n'

I even deleted the yum.repos for mysql but it didnt help, and because I didnt save it I had to recreate them from another virtual machine and copy pasted them....

The hole point of this is so I can install a fresh installation of mysql but I cant because of the dependencies...

EDIT1This is what I just tried and it failed as you can see:

[root@centos ~]# yum autoremove mysql
Loaded plugins: fastestmirror
No such command: autoremove. Please use /usr/bin/yum --help
[root@centos ~]# yum install autoremove
Loaded plugins: fastestmirror
Setting up Install Process
Error: File contains no section headers.
file: file:///etc/yum.repos.d/mysql-community-source.repo, line: 1
'mysql-connectors-community-source]\n'
[root@centos ~]#
EEAA
  • 109,363
  • 18
  • 175
  • 245
Vrankela
  • 113
  • 1
  • 6

1 Answers1

3

First of all, you don't need to delete a repo to uninstall the relevant pakages.

It's not working, because you have messed up your repo file for the relevant pakages and that's why yum can not work.

See the error log again, it clearly states, the file is faulty, it is missing the header section.

Error: File contains no section headers. file: file:///etc/yum.repos.d/mysql-community-source.repo, line: 1 'mysql-connectors-community-source]\n'

So you need to check the file /etc/yum.repos.d/mysql-community-source.repo and correct it.

I guess, while doing copy-pasting it didn't got pasted fully.

See below a repo file contents for MySQL 5.7 Community Server. Your file is missing the [mysql57-community] section I suppose.

[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Diamond
  • 9,001
  • 3
  • 24
  • 38
  • My mistake, I didnt copy paste it right. Although autoremove didnt work (centos doesnt recognize and cant install the command), I had to manually remove each of those 3 components... – Vrankela Nov 26 '15 at 12:28