2

Just installed Ubuntu 20.04.2 and MySQL 5.7. It asks for update to 8.0, but I do not want it. How to hold package to keep getting updates for 5.7, but do not make it update to 8.0?

sudo apt-mark hold <package-name> will stop all future updates. Need to get the updates for 5.7, amnyway.

Ran sudo dpkg-reconfigure mysql-apt-config and selected only 5.7, but apt still wants to update to 8.0!?

svet0slav
  • 161
  • 1
  • 1
  • 7
  • 3
    Does this answer your question? [Is it possible to install MySQL Server 5.7 on Ubuntu 19.10?](https://askubuntu.com/questions/1199495/is-it-possible-to-install-mysql-server-5-7-on-ubuntu-19-10) See [NSwanson7's answer](https://askubuntu.com/a/1209971/816190). – Kulfy Feb 04 '21 at 10:14
  • Yes. Thanks! Posting answer... – svet0slav Feb 04 '21 at 10:45

1 Answers1

8

How I made it work thanks to Kulfy...

sudo nano /etc/apt/preferences.d/mysql 

Added following code and saved.

Package: mysql-server
Pin: version 5.7*
Pin-Priority: 1001

Package: mysql-client
Pin: version 5.7*
Pin-Priority: 1001

Package: mysql-community-server
Pin: version 5.7*
Pin-Priority: 1001

Package: mysql-community-client
Pin: version 5.7*
Pin-Priority: 1001

Package: libmysqlclient-dev
Pin: version 5.7*
Pin-Priority: 1001

Now apt no longer annoys me with mysql 8.0 updates... Great!

svet0slav
  • 161
  • 1
  • 1
  • 7