Bug #83046 Unable to install mysql-server-5.6 from official MySQL APT Repo
Submitted: 20 Sep 2016 7:16 Modified: 7 Oct 2016 6:50
Reporter: Cédric Bruderer Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Package Repos Severity:S3 (Non-critical)
Version: OS:Ubuntu (16.04 LTS)
Assigned to: Lars Tangvald CPU Architecture:Any

[20 Sep 2016 7:16] Cédric Bruderer
Description:
The problem occurs, when using the official apt repository provided on the MySQL download page.

https://dev.mysql.com/downloads/repo/apt/

I had no success in re-installing or reconfiguring the package.

Details from the console:

wookie@ubuntu1604:~$ sudo -s
[sudo] password for wookie: 
root@ubuntu1604:~# apt-get update 
Hit:1 http://ch.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://ch.archive.ubuntu.com/ubuntu xenial-updates InRelease                            
Hit:3 http://ch.archive.ubuntu.com/ubuntu xenial-backports InRelease                          
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]                   
Hit:5 http://repo.mysql.com/apt/ubuntu xenial InRelease                                       
Fetched 94.5 kB in 0s (205 kB/s)                                                   
Reading package lists... Done

root@ubuntu1604:~# apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libaio1 libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.0-5 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libtimedate-perl liburi-perl mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7
Suggested packages:
  libdata-dump-perl libipc-sharedcache-perl libwww-perl mailx tinyca
The following NEW packages will be installed:
  libaio1 libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.0-5 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libtimedate-perl liburi-perl mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server mysql-server-5.7 mysql-server-core-5.7
0 upgraded, 21 newly installed, 0 to remove and 0 not upgraded.
Need to get 18.7 MB of archives.
After this operation, 162 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
root@ubuntu1604:~#

root@ubuntu1604:~# apt-get install mysql-server-5.6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package mysql-server-5.6 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  percona-xtradb-cluster-server-5.6:i386 percona-server-server-5.6:i386 mysql-testsuite-5.7:i386 mariadb-server-10.0:i386 percona-xtradb-cluster-server-5.6 percona-server-server-5.6 mysql-testsuite-5.7 mariadb-server-10.0 mysql-server-core-5.7:i386 mysql-server-5.7:i386 mysql-server-core-5.7 mysql-server-5.7

E: Package 'mysql-server-5.6' has no installation candidate
root@ubuntu1604:~#

root@ubuntu1604:~# dpkg -l | grep mysql
ii  mysql-apt-config                   0.8.0-1                         all          Auto configuration for MySQL APT Repo.

root@ubuntu1604:~# uname -a
Linux ubuntu1604 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

root@ubuntu1604:~# vi /etc/apt/sources.list.d/mysql.list
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out entries below, but any other modifications may be lost.
# Use command 'dpkg-reconfigure mysql-apt-config' as root for modifications.
deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-apt-config
deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-5.6
deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-tools
#deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-tools-preview
deb-src http://repo.mysql.com/apt/ubuntu/ xenial mysql-5.6

How to repeat:
- Install the repo.
- Choose "MySQL 5.6" as default server version.
- Execute the command "apt-get update"

- Execute the command "apt-get install mysql-server", I only have the option to install mysql-server-5.7
- Execute the commant "apt-get install mysql-server-5.6", the command fails with the error "Package 'mysql-server-5.6' has no installation candidate"

Suggested fix:
Currently, I have no suggestion for a fix.
[20 Sep 2016 8:47] Lars Tangvald
Hi,

This is a limitation in the current version of apt-config. MySQL 5.6 is not officially supported on Ubuntu 16.04, so the repo is empty, but the config package does not give a proper indication of this.

You can use the Ubuntu 14.04 packages, but be aware it's not supported.
In the file /etc/apt/sources.list.d/mysql.list, which is generated by apt config,
you'll see a line like:
deb http://repo.mysql.com/apt/ubuntu xenial mysql-5.6
If you replace "xenial" with "trusty" and run apt-get update it will instead link to the Ubuntu 14.04 repo for 5.6, and you should be able to install it.
[7 Oct 2016 6:50] MySQL Verification Team
Thank you Cédric for the report.
Verifying based on Lars comment.

Thanks,
Umesh
[19 Oct 2016 7:15] Baruch Youssin
I suspect that this is not a limitation of apt-config as Lars says; after all, any package may be added to a repository even if it is not officially supported by Ubuntu.
I found that the package lists downloaded from repo.mysql.com have formats different from the lists downloaded from archive ubuntu.com.
I have found all file lists in /var/lib/apt/lists.
The list from repo.mysql.com (I am submitting it) does not list mysql-server package.  It has only one-line entries like this one:
 da39a3ee5e6b4b0d3255bfef95601890afd80709 0 mysql-5.6/binary-amd64/Packages
For comparison, the list from archive.ubuntu.com has an entry for mysql-server which has a different format:

Package: mysql-server
Priority: optional
Section: database
Installed-Size: 180
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>
Architecture: all
Source: mysql-5.7
Version: 5.7.11-0ubuntu6
Depends: mysql-server-5.7
Filename: pool/main/m/mysql-5.7/mysql-server_5.7.11-0ubuntu6_all.deb
Size: 10128
MD5sum: 7fc525a0e6aa6969855a8080eeb73bf8
SHA1: be3f5f662ade14c52e966e6f17ad274f17cb0236
SHA256: 67b3359a60ed3c215c276956563baec47c9437b72858bc09bc74a101c0cb219c
Description: MySQL database server (metapackage depending on the latest version)
Homepage: http://dev.mysql.com/
Description-md5: b8b44aa3bf1e86bb2834ded6d9d869b5
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: lamp-server, mythbuntu-frontend, mythbuntu-desktop, mythbuntu-backend-slave, mythbuntu-backend-master, mythbuntu-backend-master

So it appears to me that the problem is with the repo.mysql.com repository.
Please fix this bug as there appears to be no reliable way of installing mysql 5.6 on Ubuntu 16.04.
[19 Oct 2016 7:18] Baruch Youssin
File list from repo.mysql.com - see my comment October 19

Attachment: repo.mysql.com_apt_ubuntu_dists_xenial_InRelease (application/octet-stream, text), 13.86 KiB.

[19 Oct 2016 7:34] Baruch Youssin
Correction: the attachment is not a file list but rather a package list.  Sorry for confusion.
[19 Oct 2016 8:12] Lars Tangvald
"Official support" here is meant to be what Oracle supports, not Ubuntu (we have 5.7 packages available for 14.04, while Ubuntu doesn't).

The 5.6 package list for Ubuntu 16 being empty (note the file size is 0) is deliberate while the 5.6 package list not being removed is so the limitation in apt-config won't cause errors with apt update.

So currently Oracle does not provide 5.6 packages for Ubuntu 16, but we will consider the request to do so.
[19 Oct 2016 12:02] Baruch Youssin
Lars,
Thanks for clarifying it.
This has been unclear for me from the above discussion where by "limitation of apt-config" you apparently meant the limitation of the apt-config file provided by Oracle and not the limitation of apt-config utility of Ubuntu as I thought originally.
This has also been unclear from the page at https://dev.mysql.com/downloads/repo/apt/ and at https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/ where Ubuntu 16.04 is listed among the supported Linux Distros and MySQL 5.6 is listed among the included packages.  Both of these pages do not suggest that some of the packages are not provided for some of the distributions.
The apt-config file also creates the impression that mysql 5.6 would be provided.
So it is great that you have clarified it; but it may be a good idea to indicate it on the above two pages, listing in a table which of the packages is provided for which distro. 
But even better, provide MySQL 5.6 for Ubuntu 16.04.
[5 Dec 2016 12:42] Van Stokes
We too have the same problem. I do not understand why Oracle would choose to restrict support of 5.6 on a specific platform when 5.6 is still an active and supported release. If 5.6 is EOL the you need to expressly state it. Otherwise, Oracle should continue to make 5.6 binaries available for Ubuntu. Please fix this immediately or publicize 5.6 EOL.
[6 Dec 2016 13:18] Lars Tangvald
The reason we stopped supporting the 5.6 packages on Ubuntu 16.04 and later (they are still available and updated on 12.04 and 14.04), is because the native MySQL packages for Ubuntu 16 were transitioned to 5.7.

This transition involved fairly significant changes to other Ubuntu packages that depend on MySQL, and most of these packages will no longer work with 5.6, or they may give unpredictable results. 
Our assumption was that it would be preferable for users to upgrade to 5.7 rather than deal with these issues, and we would be unable to provide support for incompatibilities with other packages.

Do you have particular concerns blocking you from upgrading MySQL to 5.7?
[10 Dec 2016 16:56] Baruch Youssin
@Lars Tangvald
I do not want to upgrade to MySQl 5.7 on my home comp as I am maintaining a localhost copy of my live website to test any changes before I make them on the live, and I want this copy to be as close as possible.  My web hosting provider uses 5.6.
[14 Mar 2017 9:38] MySQL Verification Team
Bug #84848 marked as duplicate of this