3

After an import of another database, the mysql root@localhost was not taking. I know that it worked because the data got imported and I was able to change the password of the user that was imported using root. However, after a day running, I tried to login as root and I couldn't. I tried a bunch of other web suggestions, etc., but none worked. I was running mysql-server-5.7. Anyway, since I knew that I just needed to recover the data, I said let me reinstall it and I would be on my way. WEll, I was wrong. For some reason, I was not able to uninstall it, nor install it back. Finding a few web suggestions, I am now at this state where when I type,

apt-get install mysql-server

I get.

root@GBRTEF01LX005:/home/bzadmin# apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mysql-server

Any other suggestions? Thanks.

josé

12
  • 1
    Please add output of apt-cache policy mysql-server to your question.
    – N0rbert
    Feb 23, 2018 at 20:40
  • Oh yeah, I tried apt-get update && apt-get dist-upgrade and no go.
    – jicman
    Feb 23, 2018 at 20:40
  • apt-cache policy mysql-server<br/> N: Unable to locate package mysql-server
    – jicman
    Feb 23, 2018 at 20:42
  • Which Ubuntu version do you have? Try sudo add-apt-repository main.
    – N0rbert
    Feb 23, 2018 at 20:43
  • 4.4.0-116-generic #140-Ubuntu
    – jicman
    Feb 23, 2018 at 20:45

1 Answer 1

4

It seems that your /etc/apt/sources.list is absolutely broken.

Try to fill it with the following contents:

deb http://archive.ubuntu.com/ubuntu xenial main restricted universe
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe

deb http://archive.ubuntu.com/ubuntu xenial multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates multiverse

deb http://archive.ubuntu.com/ubuntu xenial-security main restricted universe
deb http://archive.ubuntu.com/ubuntu xenial-security multiverse

deb http://archive.canonical.com/ubuntu xenial partner

Then run:

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install mysql-server
2
  • Thank you so much. This did it. I am wondering why this happened. I appreciate your help. mysql-server is installed. Thanks again. By the way, how do I enter a new line here? I tried two spaces and that didn't work.
    – jicman
    Feb 23, 2018 at 21:09
  • If I understand correctly new lines in comments are not supported.
    – N0rbert
    Feb 23, 2018 at 21:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .