install mysql 5.7 to linux 6 - yum tries to install 5.7 el7?

6,627

I had this problem too and it took me days to figure out. I, too, thought I was on an EL 7 OS, but I was on 6. I tried to install MySQL EL7 package and received the errors about needing systemd. This was the first clue that the package was incorrect.

I removed the EL7 packages with

sudo yum remove mysql57-community-release-el7-9.noarch

and installed EL6, but when running

sudo yum install mysql-community-server

it defaulted back to installing EL7 packages. I checked my /etc/yum.repos.d/mysql-community.repo, but all of that pointed to 6, not 7.

After days of fighting with this,

sudo yum clean all 

and

sudo yum update 

fixed the problem. After that, sudo yum install mysql-community-server worked perfectly.

Share:
6,627

Related videos on Youtube

goredwards
Author by

goredwards

Updated on September 18, 2022

Comments

  • goredwards
    goredwards over 1 year

    I'm following the instructions here to install MySQL-Community-Server onto a linux 6 aws instance.

    Basic commands:
    wget http://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm
    sudo yum localinstall mysql57-community-release-el6-8.noarch.rpm

    then when I search for mysql57 within my 'new' yum repo with yum list all |grep mysql57 i get the following:

    mysql57-community-release.noarch       el6-8                        @/mysql57-community-release-el6-8.noarch
    mysql-community-client.i686            5.7.13-1.el7                 mysql57-community
    mysql-community-client.x86_64          5.7.13-1.el7                 mysql57-community
    mysql-community-common.i686            5.7.13-1.el7                 mysql57-community
    mysql-community-common.x86_64          5.7.13-1.el7                 mysql57-community
    mysql-community-devel.i686             5.7.13-1.el7                 mysql57-community
    mysql-community-devel.x86_64           5.7.13-1.el7                 mysql57-community
    mysql-community-embedded.i686          5.7.13-1.el7                 mysql57-community
    mysql-community-embedded.x86_64        5.7.13-1.el7                 mysql57-community
    mysql-community-embedded-compat.i686   5.7.13-1.el7                 mysql57-community
    mysql-community-embedded-compat.x86_64 5.7.13-1.el7                 mysql57-community
    mysql-community-embedded-devel.i686    5.7.13-1.el7                 mysql57-community
    mysql-community-embedded-devel.x86_64  5.7.13-1.el7                 mysql57-community
    mysql-community-libs.i686              5.7.13-1.el7                 mysql57-community
    mysql-community-libs.x86_64            5.7.13-1.el7                 mysql57-community
    mysql-community-libs-compat.i686       5.7.13-1.el7                 mysql57-community
    mysql-community-libs-compat.x86_64     5.7.13-1.el7                 mysql57-community
    mysql-community-release.noarch         el7-7                        mysql57-community
    mysql-community-server.x86_64          5.7.13-1.el7                 mysql57-community
    mysql-community-test.x86_64            5.7.13-1.el7                 mysql57-community
    mysql57-community-release.noarch       el7-7                        mysql57-community
    

    so it appears that the el6-8 link is installing references to el7 ???

    when I try to install mysql with sudo yum install mysql i get the following errors

    Downloading packages:
    http://repo.mysql.com/yum/mysql-5.7-community/el/6/x86_64/mysql-community-client-5.7.13-1.el7.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://repo.mysql.com/yum/mysql-5.7-community/el/6/x86_64/mysql-community-common-5.7.13-1.el7.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    http://repo.mysql.com/yum/mysql-5.7-community/el/6/x86_64/mysql-community-libs-5.7.13-1.el7.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    

    when I try sudo yum install mysql-community-server i get error:

    Error: Package: mysql-community-server-5.7.13-1.el7.x86_64 (mysql57-community)
               Requires: systemd
    

    ...which is a common error when trying to install el7 on el6 linux (which doesn't use systemd)

    In both cases yum is trying to download the el7 package from the el6-8 repo...

    how do I correct this ?

    PS I've tried editing the /etc/yum.repos.d/mysql-community.repo file but there's nothing that specifies the linux version
    PPS I've also completely uninstalled the yum repo and tried yum clean all - then check yum list all |grep mysql57 which gives no results - followed by a fresh install = same result

    UPDATE
    the contents of my /etc/yum.repos.d/mysql-community.repo file confirms that the repo is set up to load el6 mysql:

    [mysql-connectors-community]
    name=MySQL Connectors Community
    baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/6/$basearch/
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    
    [mysql-tools-community]
    name=MySQL Tools Community
    baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/6/$basearch/
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    
    # Enable to use MySQL 5.5
    [mysql55-community]
    name=MySQL 5.5 Community Server
    baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    
    # Enable to use MySQL 5.6
    [mysql56-community]
    name=MySQL 5.6 Community Server
    baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    
    [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
    
    [mysql-tools-preview]
    name=MySQL Tools Preview
    baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/6/$basearch/
    enabled=0
    gpgcheck=1
    gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
    
    • jerichorivera
      jerichorivera almost 8 years
      what does your /etc/yum.repos.d/mysql-community.repo contain? can you paste it here?
    • jerichorivera
      jerichorivera almost 8 years
      additionally can you try to yum clean all first and then yum update, lastly make sure you're not on el7?
  • goredwards
    goredwards over 7 years
    thanks for the response - however I knew my server was el6 the whole time and was trying to install el6 packages - but the el6 yum links (listed in the question UPDATE section) consistently downloaded el7 packages. I had also tried the sudo yum clean all followed by fresh install & sudo yum update as noted in the question. from memory (it's a a couple of months ago now) the repos were updated and the links corrected within a few days of posting the question.
  • Michael Hampton
    Michael Hampton over 7 years
    +1, because I am blind as a bat, and didn't notice that you (@goredwards) had both the mysql release packages for el7 and el6 installed. Removing the el7 release package should indeed solve the problem.