1

I'm using Ubuntu 16.04. Currently, I have MySQL 5.7.31. I need to install MySQL 8 on my laptop. I tried installing that in Ubuntu 16.04.

 $ wget https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb

--2020-10-29 13:41:01-- https://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb Resolving dev.mysql.com (dev.mysql.com)... 137.254.60.11 Connecting to dev.mysql.com (dev.mysql.com)|137.254.60.11|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://repo.mysql.com//mysql-apt-config_0.8.15-1_all.deb [following] --2020-10-29 13:41:09-- https://repo.mysql.com//mysql-apt-config_0.8.15-1_all.deb Resolving repo.mysql.com (repo.mysql.com)... 49.44.146.86 Connecting to repo.mysql.com (repo.mysql.com)|49.44.146.86|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 35532 (35K) [application/x-debian-package] Saving to: ‘mysql-apt-config_0.8.15-1_all.deb’

mysql-apt-config_0. 100%[===================>] 34.70K --.-KB/s in 0.08s

2020-10-29 13:41:13 (453 KB/s) - ‘mysql-apt-config_0.8.15-1_all.deb’ saved [35532/35532]

$ sudo dpkg -i mysql-apt-config_0.8.15-1_all.deb sudo: unable to resolve host sanmitha-sadhishkumar (Reading database ... 208892 files and directories currently installed.) Preparing to unpack mysql-apt-config_0.8.15-1_all.deb ... Unpacking mysql-apt-config (0.8.15-1) over (0.8.10-1) ... Setting up mysql-apt-config (0.8.15-1) ... OK

~$ sudo apt update Get:1 http://repo.mysql.com/apt/ubuntu xenial InRelease [21.6 kB]
Hit:2 http://linux.teamviewer.com/deb stable InRelease
Hit:3 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:6 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:7 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial InRelease
Fetched 21.6 kB in 4s (4,912 B/s) Reading package lists... Done Building dependency tree
Reading state information... Done 393 packages can be upgraded. Run 'apt list --upgradable' to see them.

~$ sudo apt install mysql-server sudo: unable to resolve host sanmitha-sadhishkumar Reading package lists... Done Building dependency tree
Reading state information... Done mysql-server is already the newest version (5.7.32-1ubuntu16.04). The following packages were automatically installed and are no longer required: gksu libgksu2-0 pencil2d snapd-login-service Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 393 not upgraded.

I'm not getting MySQL 8.0 instead 5.7.31 gets retained. What to do next so that I get 8.0 version of MySQL?

1 Answers1

1

Try the following steps to add the MySQL repository to your list and install MySQL 8.0. I have not tested this, but according to the docs it should work (unless I made a typing mistake).

Install the MySQL GPG Public key to your APT keyring: (also see this post)

sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 5072E1F5

Add the MySQL Xenial Repo to your repo list: (according to this guide)

sudo add-apt-repository "deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-8.0"

Update package list:

sudo apt-get update

Install MySQL 8.0:

sudo apt-get install mysql-server
Artur Meinild
  • 26,018
  • Are there 4 commands enough?? Or I need to add any other commands mentioned in the question? – Sanmitha Sadhishkumar Oct 29 '20 at 13:07
  • As far as I can see, these 4 commands should do. I provided link to the guides to give you background information on why. Also, if this somehow does not work, there are alternate ways. So please try the above and report back if it works, and if you get an error report that too. – Artur Meinild Oct 29 '20 at 13:08
  • You can also run sudo apt policy mysql-server to see the package versions of the different repos. – Artur Meinild Oct 29 '20 at 13:17
  • Before running that one, I got another error: https://askubuntu.com/questions/1288036/no-answer-for-modulenotfounderror-no-module-named-apt-pkg-in-ubuntu-16-04-in – Sanmitha Sadhishkumar Oct 29 '20 at 15:50