$ sudo apt-get install mysql-server
[sudo] password for user: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package mysql-server

I am using Ubuntu 14.04.

  • How can i resolve this problem?
    – Rahul
    Nov 16 '17 at 17:13
  • Please run sudo apt-get update, then apt-cache search mysql-server Nov 16 '17 at 17:16
  • Then what is the next step?
    – Rahul
    Nov 16 '17 at 17:20
  • What were the results of those command? Nov 16 '17 at 17:21
  • First command is still running
    – Rahul
    Nov 16 '17 at 17:23

mysql-server is a metapackage depending on the latest version of mysql-server, so it doesn't need to be installed. Open the terminal and type:

sudo apt-get update
sudo apt-get install aptitude
sudo aptitude install mysql-server-5.5 mysql-server-core-5.5
  • I would argue there's probably no need to install aptitude just for this?
    – José Luis
    Nov 16 '17 at 17:30
  • The reason why I included aptitude is to get more verbose error messages than apt provides in case the commands didn't work, however since the commands did work you're right, there was no need to install aptitude in this case.
    – karel
    Nov 16 '17 at 17:31

You should first check whether the package you are searching for exists by opening the terminal and typing:

apt search <your package name>

Select the package you want to install by typing

sudo apt-get install <the package name you found after searching>

You can do this also in the synaptic package manager app.

  • How can i install mysql?
    – Rahul
    Nov 16 '17 at 17:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.