invoke-rc.d: could not determine the current runlevel












0















I uninstalled MySQL because I was having a problem with the root user password not working. Now I can't reinstall. I've tried reading through some similar posts but frankly they're beyond my level or not quite what I'm dealing with. Here's the full output of commands used:



bigbossNP@LenovoY2P:~$ sudo apt-get install mysql-server                                                                
[sudo] password for bigbossNP:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to
correct the problem.
bigbossNP@LenovoY2P:~$ sudo dpkg --configure -a
Setting up mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ...
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ]
Renaming removed key_buffer and myisam-recover options (if present)
invoke-rc.d: could not determine current runlevel
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ]


After this I don't get the command prompt back so I have to shut down the terminal and reopen. What do I need to do to get it reinstalled and running correctly again?










share|improve this question
















bumped to the homepage by Community 12 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 1





    Please edit your question with the full output of the commands you ran

    – M. Becerra
    Jan 23 '18 at 8:19
















0















I uninstalled MySQL because I was having a problem with the root user password not working. Now I can't reinstall. I've tried reading through some similar posts but frankly they're beyond my level or not quite what I'm dealing with. Here's the full output of commands used:



bigbossNP@LenovoY2P:~$ sudo apt-get install mysql-server                                                                
[sudo] password for bigbossNP:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to
correct the problem.
bigbossNP@LenovoY2P:~$ sudo dpkg --configure -a
Setting up mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ...
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ]
Renaming removed key_buffer and myisam-recover options (if present)
invoke-rc.d: could not determine current runlevel
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ]


After this I don't get the command prompt back so I have to shut down the terminal and reopen. What do I need to do to get it reinstalled and running correctly again?










share|improve this question
















bumped to the homepage by Community 12 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 1





    Please edit your question with the full output of the commands you ran

    – M. Becerra
    Jan 23 '18 at 8:19














0












0








0








I uninstalled MySQL because I was having a problem with the root user password not working. Now I can't reinstall. I've tried reading through some similar posts but frankly they're beyond my level or not quite what I'm dealing with. Here's the full output of commands used:



bigbossNP@LenovoY2P:~$ sudo apt-get install mysql-server                                                                
[sudo] password for bigbossNP:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to
correct the problem.
bigbossNP@LenovoY2P:~$ sudo dpkg --configure -a
Setting up mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ...
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ]
Renaming removed key_buffer and myisam-recover options (if present)
invoke-rc.d: could not determine current runlevel
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ]


After this I don't get the command prompt back so I have to shut down the terminal and reopen. What do I need to do to get it reinstalled and running correctly again?










share|improve this question
















I uninstalled MySQL because I was having a problem with the root user password not working. Now I can't reinstall. I've tried reading through some similar posts but frankly they're beyond my level or not quite what I'm dealing with. Here's the full output of commands used:



bigbossNP@LenovoY2P:~$ sudo apt-get install mysql-server                                                                
[sudo] password for bigbossNP:
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to
correct the problem.
bigbossNP@LenovoY2P:~$ sudo dpkg --configure -a
Setting up mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ...
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ]
Renaming removed key_buffer and myisam-recover options (if present)
invoke-rc.d: could not determine current runlevel
invoke-rc.d: could not determine current runlevel
* Stopping MySQL database server mysqld [ OK ]


After this I don't get the command prompt back so I have to shut down the terminal and reopen. What do I need to do to get it reinstalled and running correctly again?







mysql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 23 '18 at 18:41







nicolep2609

















asked Jan 23 '18 at 8:09









nicolep2609nicolep2609

112




112





bumped to the homepage by Community 12 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 12 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 1





    Please edit your question with the full output of the commands you ran

    – M. Becerra
    Jan 23 '18 at 8:19














  • 1





    Please edit your question with the full output of the commands you ran

    – M. Becerra
    Jan 23 '18 at 8:19








1




1





Please edit your question with the full output of the commands you ran

– M. Becerra
Jan 23 '18 at 8:19





Please edit your question with the full output of the commands you ran

– M. Becerra
Jan 23 '18 at 8:19










1 Answer
1






active

oldest

votes


















0














0) I am guessing you have tried
sudo apt-get install -f



1) Back up your existing MySQL files. You can find out where your data directory is in /etc/mysql/my.cnf



https://stackoverflow.com/questions/26402884/where-does-mysql-store-data



You can use mysqldump to backup.



https://www.techrepublic.com/article/how-to-back-up-mysql-databases-from-the-command-line-with-linux/



2) Run these commands



sudo apt-get remove --purge 'mysql*'
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mysql-server





share|improve this answer
























  • Every time I use sudo it results in the same request to manually run 'sudo dpkg --configure -a' which leads to the errors listed in my original post. Every fix I've found has required use of sudo command. At this point would it work to completely uninstall everything (down to Ubuntu) and start over?? If so can someone direct me to an article showing how to do that?

    – nicolep2609
    Jan 24 '18 at 17:56











  • What is the output of ps aux | grep dpkg

    – TheCabDriverCheatedMeToday
    Jan 25 '18 at 4:46











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f998926%2finvoke-rc-d-could-not-determine-the-current-runlevel%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














0) I am guessing you have tried
sudo apt-get install -f



1) Back up your existing MySQL files. You can find out where your data directory is in /etc/mysql/my.cnf



https://stackoverflow.com/questions/26402884/where-does-mysql-store-data



You can use mysqldump to backup.



https://www.techrepublic.com/article/how-to-back-up-mysql-databases-from-the-command-line-with-linux/



2) Run these commands



sudo apt-get remove --purge 'mysql*'
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mysql-server





share|improve this answer
























  • Every time I use sudo it results in the same request to manually run 'sudo dpkg --configure -a' which leads to the errors listed in my original post. Every fix I've found has required use of sudo command. At this point would it work to completely uninstall everything (down to Ubuntu) and start over?? If so can someone direct me to an article showing how to do that?

    – nicolep2609
    Jan 24 '18 at 17:56











  • What is the output of ps aux | grep dpkg

    – TheCabDriverCheatedMeToday
    Jan 25 '18 at 4:46
















0














0) I am guessing you have tried
sudo apt-get install -f



1) Back up your existing MySQL files. You can find out where your data directory is in /etc/mysql/my.cnf



https://stackoverflow.com/questions/26402884/where-does-mysql-store-data



You can use mysqldump to backup.



https://www.techrepublic.com/article/how-to-back-up-mysql-databases-from-the-command-line-with-linux/



2) Run these commands



sudo apt-get remove --purge 'mysql*'
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mysql-server





share|improve this answer
























  • Every time I use sudo it results in the same request to manually run 'sudo dpkg --configure -a' which leads to the errors listed in my original post. Every fix I've found has required use of sudo command. At this point would it work to completely uninstall everything (down to Ubuntu) and start over?? If so can someone direct me to an article showing how to do that?

    – nicolep2609
    Jan 24 '18 at 17:56











  • What is the output of ps aux | grep dpkg

    – TheCabDriverCheatedMeToday
    Jan 25 '18 at 4:46














0












0








0







0) I am guessing you have tried
sudo apt-get install -f



1) Back up your existing MySQL files. You can find out where your data directory is in /etc/mysql/my.cnf



https://stackoverflow.com/questions/26402884/where-does-mysql-store-data



You can use mysqldump to backup.



https://www.techrepublic.com/article/how-to-back-up-mysql-databases-from-the-command-line-with-linux/



2) Run these commands



sudo apt-get remove --purge 'mysql*'
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mysql-server





share|improve this answer













0) I am guessing you have tried
sudo apt-get install -f



1) Back up your existing MySQL files. You can find out where your data directory is in /etc/mysql/my.cnf



https://stackoverflow.com/questions/26402884/where-does-mysql-store-data



You can use mysqldump to backup.



https://www.techrepublic.com/article/how-to-back-up-mysql-databases-from-the-command-line-with-linux/



2) Run these commands



sudo apt-get remove --purge 'mysql*'
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mysql-server






share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 24 '18 at 10:04









TheCabDriverCheatedMeTodayTheCabDriverCheatedMeToday

164




164













  • Every time I use sudo it results in the same request to manually run 'sudo dpkg --configure -a' which leads to the errors listed in my original post. Every fix I've found has required use of sudo command. At this point would it work to completely uninstall everything (down to Ubuntu) and start over?? If so can someone direct me to an article showing how to do that?

    – nicolep2609
    Jan 24 '18 at 17:56











  • What is the output of ps aux | grep dpkg

    – TheCabDriverCheatedMeToday
    Jan 25 '18 at 4:46



















  • Every time I use sudo it results in the same request to manually run 'sudo dpkg --configure -a' which leads to the errors listed in my original post. Every fix I've found has required use of sudo command. At this point would it work to completely uninstall everything (down to Ubuntu) and start over?? If so can someone direct me to an article showing how to do that?

    – nicolep2609
    Jan 24 '18 at 17:56











  • What is the output of ps aux | grep dpkg

    – TheCabDriverCheatedMeToday
    Jan 25 '18 at 4:46

















Every time I use sudo it results in the same request to manually run 'sudo dpkg --configure -a' which leads to the errors listed in my original post. Every fix I've found has required use of sudo command. At this point would it work to completely uninstall everything (down to Ubuntu) and start over?? If so can someone direct me to an article showing how to do that?

– nicolep2609
Jan 24 '18 at 17:56





Every time I use sudo it results in the same request to manually run 'sudo dpkg --configure -a' which leads to the errors listed in my original post. Every fix I've found has required use of sudo command. At this point would it work to completely uninstall everything (down to Ubuntu) and start over?? If so can someone direct me to an article showing how to do that?

– nicolep2609
Jan 24 '18 at 17:56













What is the output of ps aux | grep dpkg

– TheCabDriverCheatedMeToday
Jan 25 '18 at 4:46





What is the output of ps aux | grep dpkg

– TheCabDriverCheatedMeToday
Jan 25 '18 at 4:46


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f998926%2finvoke-rc-d-could-not-determine-the-current-runlevel%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

數位音樂下載

When can things happen in Etherscan, such as the picture below?

格利澤436b