9

I installed ubuntu 16.04, after that when i try to install mysql it shows error as

$ sudo apt-get update
[sudo] password for mcerc: 
Reading package lists... Done
mcerc@mcerc-ThinkCentre-M72e:~$ sudo apt-get install mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package mysql
mcerc@mcerc-ThinkCentre-M72e:~$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package mysql-server
mcerc@mcerc-ThinkCentre-M72e:~$ ^C
mcerc@mcerc-ThinkCentre-M72e:~$ 
  • I answered your question. If you have any questions, post them as comments in the answer below. – Emad Arshad Alam Oct 5 '16 at 3:57
4
  • First, goto Ubuntu Software and in the menu there will be the option Ubuntu Software. Select it.
  • There, you will Softwares and Updates. Select it. Check if all the official repositories (under the option Ubuntu Software) are checked. If not then check them.
  • Else use the following command for installing mysql-server sudo apt install mysql-server-5.7. This should work.
  • You can't very well go to Ubuntu Software via the command line... – Chrips Nov 20 '18 at 13:49
4

Whenever u install fresh Ubuntu , you need to update and upgrade the system to install from ubuntu repositories.

sudo apt-get update && sudo apt-get dist-upgrade

Now install anything

 sudo apt-get install mysql-server

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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