5

I am using "mysql 5.7" in my "gitlab-ci" file and use "apt-get -y install mysql-client" to install sql client but it is always giving me error.

ERROR : "Package mysql-client 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". 

This script is running on gitlab pipeline and that is were I am getting this error. When I push the code to my branch, a pipeline runs which installs all the dependencies first where this fails.

Ishan Sharma
  • 51
  • 1
  • 3
  • You haven't told us your flavor/release of Ubuntu but I see the following `mysql-client` package/releases (https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=mysql-client) so I'd check your release, sources and then mirror you use (*is it up-to-date, or reasonably so*; https://launchpad.net/ubuntu/+archivemirrors). You've provided us little, so I can't provide more. – guiverc Jul 24 '19 at 06:33
  • I am writing these scripts in the **gitlab-ci.yml** file for automated testing of my code. I am using **golang 1.12**. These errors come up when I push my code and pipeline runs on gitlab – Ishan Sharma Jul 24 '19 at 06:39

1 Answers1

7

I happen to run into the same error. In my case i'm using docker with python:3.7 which used to be based on debian stretch but is now updated to debian buster (10). This newer debian version doesn't have the package mysql-client -> https://packages.debian.org/search?searchon=names&keywords=mysql-client

Could it be that you're using docker to load golang:1.12? They actually use debian instead of ubuntu and have recently moved to debian 10. To fix this error install default-mysql-client instead.

(This should be a comment but I don't have 50 rep points yet and I do believe this helps you out because of the exact timing)

Jeroen M
  • 71
  • 2
  • I just resolved this issue. Yes it was due to the OS version on which **GitLab Runners** were trying to run these scripts and just had to make changes to it and the thing started working fine. – Ishan Sharma Jul 24 '19 at 11:19
  • Does anyone know why the name of the package changed to add 'default-' as a prefix? – B Johnson Sep 18 '19 at 21:29