“mysql-server-5.1 but it is not going to be installed” error

This post looks at the error message "mysql-server : Depends: mysql-server-5.1 but it is not going to be installed" when attempting to install MySQL on a fresh install of Debian 6, when Debian 7 is the current up to date distro.

I needed to test something with MySQL on Debian 6 in a test environment (which I can them implement later on some production servers), so downloaded the 1st CD ISO only and installed it into a VMWare Virtual Machine.

When I went to install MySQL, I got this error message:

$ apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
mysql-server : Depends: mysql-server-5.1 but it is not going to be installed
E: Broken packages

It would appear that Debian 6 now only gets security updates and you need to fix/adjust the sources list to be able to install new software.

Edit the /etc/apt/sources.list file and add the following line

deb http://ftp.us.debian.org/debian/ squeeze main

Then run:

$ apt-get update

and you should be able to install software. I was personally then able to install MySQL and run my tests on this older OS installation.

Check this forum thread on the Debian User Forums for more information http://forums.debian.net/viewtopic.php?f=5&t=83989