When I try to install mysql-server, an error comes like:
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
What does it mean. Any ideas?
asked Apr 17, 2017 at 6:22
dpkg returning an error code 1 doesn’t mean anything specific but it usually has to do with dependency issues. In your case, you tried to install two versions/instances of the same package i.e. mysql-server and mysql-server-5.7. So do the following to remove any redundant dependency issues and install a functioning mysql package
sudo apt-get clean
sudo apt-get purge mysql*
sudo apt-get update
sudo apt-get install -f
sudo apt-get install mysql-server-5.7
sudo apt-get dist-upgrade
this should fix the problem at hand. But in the future, have care about the package names you add after sudo apt-get install since the wrong list of package names — for example redundant entries in the list — results in failure to install either of the packages or worse — you might even find yourself wading through the hellish depths of #DEPENDENCY-HELL
answered Jun 29, 2017 at 10:08
endriasendrias
7357 silver badges12 bronze badges
3
All of the answers I’ve been able to find for this question have been of the form «purge your Mysql install and re-install it.» But in my case, I already have a working/active Mysql install. For me, the reason why dpkg --configure -a fails is because Mysql is already installed. Why dpkg thinks that the postinstall script needs to be run for my already-installed-and-upgraded Mysql I may never know, but it does.
After considerable time scouring for answers, I found a solution that should work if there are others who already have a working Mysql 5.7 and just want to get past this bogus postinstall script. You can edit the postinstall script directly as (on Ubuntu):
sudo vi /var/lib/dpkg/info/mysql-server-5.7.postinst
And then, on the second line, just add exit 0 and then run dpkg again and you should get something like:
$ sudo dpkg --configure -a
Setting up mysql-server-5.7 (5.7.28-0ubuntu0.18.04.4) ...
You definitely would not want to follow these instructions if your Mysql installation had not previously completed (there’s a reason that the postinstall script insists on running). But for those who might end up with dpkg in a wonky state, as I have, the above can save you a lot of time purging and reinstalling an already-working version of Mysql.
answered Jan 6, 2020 at 19:44
wbhardingwbharding
3,8552 gold badges28 silver badges25 bronze badges
4
This should help
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get dist-upgrade
And now reinstall mysql
sudo apt-get install mysql-server
answered Jun 28, 2017 at 22:18
If you’re on a VPS or similar, your error may be due to lack of RAM.
Running apt-upgrade seems to require some RAM, so it may force-close mysql, hence the problem to recover from the error.
Try:
1) Stop mysql manually before any apt-upgrade
sudo /etc/init.d/mysql stop
2) Fix:
sudo dpkg --configure mysql-server-X.X
(if version not known, use just mysql-server to find out (will not fix error)
3) Check:
sudo apt-get upgrade
Start mysql manually if it wasn’t started by apt.
answered May 19, 2018 at 6:37
TesonTeson
6,5748 gold badges43 silver badges67 bronze badges
1
I had a similar issue. This is how I fixed mine.
- Restart MySQL service
sudo service mysql restart - Then fix broken installations
sudo apt install -f
answered Oct 25, 2018 at 8:26
My answer from askubuntu.
New Answer
kill the musql deamon and purging helps
sudo pkill mysqld # kill
sudo apt-get purge mysql-server-5.7 # Or whatever you are trying to purge.
Thanks, @endrias for the suggestion.
Old Answer
None of the apt methods worked for me, try this:
Find locking process
$ ps -eaf
root 7316 1 0 00:19 ? 00:00:00 /usr/bin/dpkg --status-fd 35 --configure --pending
root 7808 7316 0 00:19 ? 00:00:00 /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/mysql-se
root 7817 7808 0 00:19 ? 00:00:00 /bin/bash /var/lib/dpkg/info/mysql-server-5.7.postinst configure
mysql 7973 7817 0 00:20 ? 00:00:00 mysqld --user=mysql --init-file=/var/lib/mysql-files/tmp.iNyY06ty0K --so
Kill it
do sudo kill -9 7973, basically the mysql one.
Now purge
sudo apt-get purge mysql-server-5.7 # Or whatever you are trying to purge.
answered Oct 18, 2018 at 4:35
1
i face same error due to problem in my upgrade from ubuntu 18.04 to ubuntu 20.04 , what i did is get mariadb instead also make sure when you do pruge mysql that if asked you to remove dbs in the dir
tell it not to delete the dbs so you will have your old databases with no data loss
what i did was this cmds
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get dist-upgrade
sudo apt-get install mariadb-server
answered Oct 20, 2020 at 16:17
I tried almost every possible way but nothing was working for me. Then I found the problem that I was facing was due to less available ram. You can check your current ram status by free -h (in my case available was less than 1 GB). To clear ram restart your device. Then type following commands
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get dist-upgrade
then again install mysql-server by
sudo apt-get install mysql-server
answered Aug 31, 2020 at 16:40
Priyam Priyam
211 bronze badge
answered Dec 7, 2020 at 9:07
BonnBonn
18514 bronze badges
In my case I had to run:
systemctl stop mysql.service
to stop MySQL before being able to install mysql without errors using:
sudo apt-get install mysql-server
answered Feb 2, 2021 at 11:04
HéctorHéctor
6491 gold badge5 silver badges8 bronze badges
To solve the dependency issue, try:
sudo apt-get purge
sudo apt-get clean
sudo apt-get check
And reinstall the package again by: sudo apt-get install mysql-server.
Source: Thread: Dpkg: Dependency problems — leaving unconfigured.
Other commands to try:
sudo apt-get install -f
sudo apt-get autoremove
sudo dpkg --configure -a
Related: How can I Resolve dpkg dependency? at Ask Ubuntu.
answered Oct 27, 2017 at 23:19
kenorbkenorb
149k80 gold badges668 silver badges723 bronze badges
The problem can be much simpler (in my case) I had a missconfigured value in my configuration file [my.cnf] which lead to the error.
After cleaning up my.cnf mysql-server was restarted successfully
answered Sep 14, 2018 at 10:35
If you are working on Debian 10, you need to first install GNUPG:
sudo apt-get install gnupg
That’s all; now you can try dpkg again.
Das_Geek
2,6657 gold badges20 silver badges26 bronze badges
answered Feb 10, 2020 at 21:37
Also pay attention to the terminal you are using, if it is ZSH many uninstall commands will not work like: sudo apt-get purge mysql* and the reinstallation process will fail, to fix this it is simple type in your terminal the word bash so that the terminal used is Bash, run the sudo apt-get purge mysql* command again and also the following commands below to confirm that you removed everything.
sudo apt-get remove mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql
Finally, run mysql --version to make sure there is no version on your machine and you can try installing again.
answered Dec 7, 2021 at 18:58
I came across the yes Unix binary, which is incredibly stupid: it just endlessly types y (try it, you can just run yes in your terminal)
so the following just works (I used this in a dockerfile)
yes | apt-get install mysql-community-server
answered Aug 16, 2022 at 8:26
NadirNadir
6958 silver badges12 bronze badges
I had another mysql process running in background.
(ckeck if your lampp mysql server is on, Then turn it off.)
then try
sudo apt dist-upgrade
if lammp mysql is not working then,
check this command,
ps -eaf
and then look for mysql process and kill it by it’s port number
sudo kill -9
answered Sep 14, 2022 at 7:30
I was in the same situation. After completely removing MySQL, I reinstalled it, killed the PID using port 3306, and reinstalled MySQL again. It’s working now.
Das_Geek
2,6657 gold badges20 silver badges26 bronze badges
answered Nov 26, 2019 at 15:50
logbasexlogbasex
1,3921 gold badge13 silver badges18 bronze badges
0
I am getting the following error when I remove, autoremove, install, upgrade etc.. via terminal and also software updater.
The sudo apt-get autoremove result is given below. The error says dpkg error processing the mysql-server.
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.5 (5.5.49-0ubuntu0.14.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: error processing package mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
referred this link also : link
Help to reconfigure the mysql.
also tried dpkg reconfiguration. (Consider before duplicating the question)
Edit 1: My ubuntu version is 14.04 LTS
Edit 2: sudo apt-get upgrade result:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.5 (5.5.49-0ubuntu0.14.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo dpkg --configure -a result:
Setting up mysql-server-5.5 (5.5.49-0ubuntu0.14.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.5
mysql-server
sudo apt-get remove mysql-server result:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
mysql-server
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 131 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 209845 files and directories currently installed.)
Removing mysql-server (5.5.49-0ubuntu0.14.04.1) ...
Setting up mysql-server-5.5 (5.5.49-0ubuntu0.14.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)
- Печать
Страницы: [1] Вниз
Тема: mysql-server не ставится (Прочитано 6447 раз)
0 Пользователей и 1 Гость просматривают эту тему.

abaddoon
Всем привет. Имеется VPS. На нем стоит Ubuntu 16.04. Пытался поставить mariadb, что-то пошло не так. Решил удалить, apt-get навернулся, с трудом починил, пришлось выпилить вообще все пакеты связанные с mariadb и mysqд. Но некоторые проблемы остались, не могу теперь поставить mysql-server:
sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.7.20-0ubuntu0.16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 108 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Как починить — не знаю.

AnrDaemon
Вот вечно так, сами не знают, что делают, потом мучаются.
Попробуйте
apt install --reinstall mysql-common; apt install -f
Хотите получить помощь? Потрудитесь представить запрошенную информацию в полном объёме.
Прежде чем [Отправить], нажми [Просмотр] и прочти собственное сообщение. Сам-то понял, что написал?…

abaddoon
sudo apt install --reinstall mysql-common; sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 108 not upgraded.
2 not fully installed or removed.
Need to get 0 B/8,456 B of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 41196 files and directories currently installed.)
Preparing to unpack .../mysql-common_10.2.11+maria~xenial_all.deb ...
Unpacking mysql-common (10.2.11+maria~xenial) over (10.2.11+maria~xenial) ...
Setting up mysql-common (10.2.11+maria~xenial) ...
Setting up mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 108 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Пользователь добавил сообщение 20 Декабря 2017, 19:24:32:
Неужели никто не знает, как это починить?
« Последнее редактирование: 20 Декабря 2017, 19:24:32 от abaddoon »

AnrDaemon
1. Запакуйте /var/lib/mysql, чтобы ненароком не потерять базы.
2.
apt clean; apt remove mysql-common && apt update && apt install --reinstall mysql-server-5.7 mysql-common
Пользователь добавил сообщение 20 Декабря 2017, 19:35:12:
Неужели никто не знает, как это починить?
Неужели пара часов — это такой большой срок для бесплатной помощи, которую вам никто в общем-то не обязан оказывать?
Файл, который оно не может найти, это часть пакета https://packages.ubuntu.com/xenial/mysql-common
Почему он не восстановился после переустановки пакета — вопрос на сто баксов. Если и так не сработает, проверьте файловую систему на проблемы.
« Последнее редактирование: 20 Декабря 2017, 19:35:12 от AnrDaemon »
Хотите получить помощь? Потрудитесь представить запрошенную информацию в полном объёме.
Прежде чем [Отправить], нажми [Просмотр] и прочти собственное сообщение. Сам-то понял, что написал?…

abaddoon
Неужели пара часов — это такой большой срок для бесплатной помощи, которую вам никто в общем-то не обязан оказывать?
Никто не отвечал, вот я и подумал, что уже никто не ответит. Спасибо! Но не помогло, зато я уже починил зависимости, сейчас просто не находит тот файл. Смущает, что при установке mysql-common пишет:
mysql-common is already the newest version (10.2.11+maria~xenial).
При чем здесь maria? Там должно быть что-то типо mysql-common (5.7.20-0ubuntu0.16.04.1). Возможно это как-то связано с тем, что для установки mariadb я выполнял вот эти команды:
sudo apt-get install software-properties-commonКак отменить действие данных команд?
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.mephi.ru/mariadb/repo/10.2/ubuntu xenial main'
И небольшой оффтоп. Меня капча уже доканала, причем ладно бы только капча, так под ней еще и 3 поля с загадками или примером. Как спастись от этого?
Пользователь добавил сообщение 20 Декабря 2017, 23:01:22:
НУ да, убил репозиторий mariadb и та ошибка пропала, появилась другая:
sudo apt-get install mysql-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-common is already the newest version (5.7.20-0ubuntu0.16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 108 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ...
Renaming removed key_buffer and myisam-recover options (if present)
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:E: Sub-process /usr/bin/dpkg returned an error code (1)
« Последнее редактирование: 20 Декабря 2017, 23:01:22 от abaddoon »

AnrDaemon
Было уже это, смотрите форум по тексту ошибки.
Хотите получить помощь? Потрудитесь представить запрошенную информацию в полном объёме.
Прежде чем [Отправить], нажми [Просмотр] и прочти собственное сообщение. Сам-то понял, что написал?…

symon.2014
and 108 not upgraded.
sudo apt install -fЗагадки закончатся после пяти сообщений.

AnrDaemon
И, да, раз уж вы умудрились поиграться с репами, сделайте повторно
apt clean; apt update && apt install --reinstall mysql-server-5.7 mysql-common
Хотите получить помощь? Потрудитесь представить запрошенную информацию в полном объёме.
Прежде чем [Отправить], нажми [Просмотр] и прочти собственное сообщение. Сам-то понял, что написал?…

Haron Prime
- Печать
Страницы: [1] Вверх
I’m trying to install MySQL on Ubuntu 18.04. To do that, first I have donwload the package with the command:
wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb
And then, run the command:
sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb
But I’ve got a problem with dependencies and I don’t know what are these dependencies. This is part of the message that I’ve got:
Configuring mysql-community-server (8.0.15-1ubuntu18.04) ...
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-03-12 01:06:40 CET; 17ms ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 12302 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 12263 ExecStartPre=/usr/share/mysql-8.0/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 12302 (code=exited, status=1/FAILURE)
Status: "SERVER_BOOTING"
mar 12 01:06:39 R2D2 systemd[1]: Starting MySQL Community Server...
mar 12 01:06:40 R2D2 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
mar 12 01:06:40 R2D2 systemd[1]: mysql.service: Failed with result 'exit-code'.
mar 12 01:06:40 R2D2 systemd[1]: Failed to start MySQL Community Server.
dpkg: error processing package mysql-community-server (--configure):
installed mysql-community-server package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-community-server (= 8.0.15-1ubuntu18.04); however:
Package mysql-community-server is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-community-server-dbgsym:
mysql-community-server-dbgsym depends on mysql-community-server (= 8.0.15-1ubuntu18.04); however:
Package mysql-community-server is not configured yet.
dpkg: error processing package mysql-community-server-dbgsym (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-community-server
mysql-server
mysql-community-server-dbgsym
E: Sub-process /usr/bin/dpkg returned an error code (1)
This is the log that I get consulting with journalctl -xe:
josecarlos@R2D2:~/Descargas$ journalctl -xe
mar 12 01:35:01 R2D2 CRON[13062]: pam_unix(cron:session): session closed for user root
mar 12 01:36:01 R2D2 org.gnome.Shell.desktop[1874]: (/usr/lib/firefox/firefox:10916): dconf-WARNING **: 01:36:01.2
mar 12 01:36:39 R2D2 sudo[13085]: josecarlos : TTY=pts/0 ; PWD=/home/josecarlos/Descargas ; USER=root ; COMMAND=/u
mar 12 01:36:39 R2D2 sudo[13085]: pam_unix(sudo:session): session opened for user root by (uid=0)
mar 12 01:36:40 R2D2 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has begun starting up.
mar 12 01:36:40 R2D2 audit[13150]: AVC apparmor="STATUS" operation="profile_replace" info="same as current profile
mar 12 01:36:40 R2D2 kernel: audit: type=1400 audit(1552351000.784:89): apparmor="STATUS" operation="profile_repla
mar 12 01:36:41 R2D2 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
mar 12 01:36:41 R2D2 systemd[1]: mysql.service: Failed with result 'exit-code'.
mar 12 01:36:41 R2D2 systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has failed.
--
-- The result is RESULT.
mar 12 01:36:41 R2D2 sudo[13085]: pam_unix(sudo:session): session closed for user root
Output of sudo apt update && sudo apt upgrade:
Hit:1 http://es.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://repo.mysql.com/apt/ubuntu bionic InRelease
Hit:3 http://archive.canonical.com/ubuntu bionic InRelease
Hit:4 https://deb.nodesource.com/node_11.x bionic InRelease
Hit:5 http://packages.microsoft.com/repos/vscode stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up mysql-community-server (8.0.15-1ubuntu18.04) ...
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
* mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-03-12 12:17:46 CET; 8ms ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 8839 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 8800 ExecStartPre=/usr/share/mysql-8.0/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 8839 (code=exited, status=1/FAILURE)
Status: "SERVER_BOOTING"
mar 12 12:17:45 R2D2 systemd[1]: Starting MySQL Community Server...
mar 12 12:17:46 R2D2 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
mar 12 12:17:46 R2D2 systemd[1]: mysql.service: Failed with result 'exit-code'.
mar 12 12:17:46 R2D2 systemd[1]: Failed to start MySQL Community Server.
dpkg: error processing package mysql-community-server (--configure):
installed mysql-community-server package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-community-server (= 8.0.15-1ubuntu18.04); however:
Package mysql-community-server is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-community-server-dbgsym:
mysql-community-server-dbgsym depends on mysql-community-server (= 8.0.15-1ubuntu18.04); however:
Package mysql-community-server is not configured yet.
dpkg: error processing package mysql-community-server-dbgsym (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-community-server
mysql-server
mysql-community-server-dbgsym
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have make a big mistake and this is that I’ve got installed mysql-server-5.5 previously in my laptop. I have remove and purge everything and reinstall again, but it doesn’t work.
The log of the command sudo apt install mysql-server is:
josecarlos@R2D2:~$ LANG=C sudo apt install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libmecab2 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-server
mysql-community-server-core
The following NEW packages will be installed:
libmecab2 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-server
mysql-community-server-core mysql-server
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 58,3 MB of archives.
After this operation, 418 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://es.archive.ubuntu.com/ubuntu bionic/universe amd64 libmecab2 amd64 0.996-5 [257 kB]
Get:2 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-common amd64 8.0.15-1ubuntu18.04 [84,4 kB]
Get:3 http://es.archive.ubuntu.com/ubuntu bionic/universe amd64 mecab-utils amd64 0.996-5 [4.856 B]
Get:4 http://es.archive.ubuntu.com/ubuntu bionic/universe amd64 mecab-ipadic all 2.7.0-20070801+main-1 [12,1 MB]
Get:5 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client-core amd64 8.0.15-1ubuntu18.04 [1.450 kB]
Get:6 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-client amd64 8.0.15-1ubuntu18.04 [2.310 kB]
Get:7 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-client amd64 8.0.15-1ubuntu18.04 [81,0 kB]
Get:8 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server-core amd64 8.0.15-1ubuntu18.04 [17,6 MB]
Get:9 http://es.archive.ubuntu.com/ubuntu bionic/universe amd64 mecab-ipadic-utf8 all 2.7.0-20070801+main-1 [3.522 B]
Get:10 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-community-server amd64 8.0.15-1ubuntu18.04 [24,2 MB]
Get:11 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-server amd64 8.0.15-1ubuntu18.04 [81,0 kB]
Fetched 58,3 MB in 2s (30,7 MB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 821063 files and directories currently installed.)
Preparing to unpack .../00-mysql-common_8.0.15-1ubuntu18.04_amd64.deb ...
Unpacking mysql-common (8.0.15-1ubuntu18.04) ...
Selecting previously unselected package mysql-community-client-core.
Preparing to unpack .../01-mysql-community-client-core_8.0.15-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-client-core (8.0.15-1ubuntu18.04) ...
Selecting previously unselected package mysql-community-client.
Preparing to unpack .../02-mysql-community-client_8.0.15-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-client (8.0.15-1ubuntu18.04) ...
Selecting previously unselected package mysql-client.
Preparing to unpack .../03-mysql-client_8.0.15-1ubuntu18.04_amd64.deb ...
Unpacking mysql-client (8.0.15-1ubuntu18.04) ...
Selecting previously unselected package libmecab2:amd64.
Preparing to unpack .../04-libmecab2_0.996-5_amd64.deb ...
Unpacking libmecab2:amd64 (0.996-5) ...
Selecting previously unselected package mysql-community-server-core.
Preparing to unpack .../05-mysql-community-server-core_8.0.15-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-server-core (8.0.15-1ubuntu18.04) ...
Selecting previously unselected package mysql-community-server.
Preparing to unpack .../06-mysql-community-server_8.0.15-1ubuntu18.04_amd64.deb ...
Unpacking mysql-community-server (8.0.15-1ubuntu18.04) ...
Selecting previously unselected package mecab-utils.
Preparing to unpack .../07-mecab-utils_0.996-5_amd64.deb ...
Unpacking mecab-utils (0.996-5) ...
Selecting previously unselected package mecab-ipadic.
Preparing to unpack .../08-mecab-ipadic_2.7.0-20070801+main-1_all.deb ...
Unpacking mecab-ipadic (2.7.0-20070801+main-1) ...
Selecting previously unselected package mecab-ipadic-utf8.
Preparing to unpack .../09-mecab-ipadic-utf8_2.7.0-20070801+main-1_all.deb ...
Unpacking mecab-ipadic-utf8 (2.7.0-20070801+main-1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../10-mysql-server_8.0.15-1ubuntu18.04_amd64.deb ...
Unpacking mysql-server (8.0.15-1ubuntu18.04) ...
Setting up mysql-common (8.0.15-1ubuntu18.04) ...
Setting up libmecab2:amd64 (0.996-5) ...
Setting up mysql-community-client-core (8.0.15-1ubuntu18.04) ...
Setting up mysql-community-server-core (8.0.15-1ubuntu18.04) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for man-db (2.8.3-2) ...
Setting up mecab-utils (0.996-5) ...
Setting up mysql-community-client (8.0.15-1ubuntu18.04) ...
Setting up mecab-ipadic (2.7.0-20070801+main-1) ...
Compiling IPA dictionary for Mecab. This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################|
/usr/share/mecab/dic/ipadic/model.def is not found. skipped.
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27327
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
emitting double-array: 100% |###########################################|
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix : 100% |###########################################|
done!
update-alternatives: using /var/lib/mecab/dic/ipadic to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Setting up mysql-client (8.0.15-1ubuntu18.04) ...
Setting up mecab-ipadic-utf8 (2.7.0-20070801+main-1) ...
Compiling IPA dictionary for Mecab. This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################|
/usr/share/mecab/dic/ipadic/model.def is not found. skipped.
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27327
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
emitting double-array: 100% |###########################################|
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix : 100% |###########################################|
done!
update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Setting up mysql-community-server (8.0.15-1ubuntu18.04) ...
dpkg: error processing package mysql-community-server (--configure):
installed mysql-community-server package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-community-server (= 8.0.15-1ubuntu18.04); however:
Package mysql-community-server is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-community-server
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Righ now, these are the package of mysql-server installed in my laptop:
I don’t know what am I doing wrong right now.
Debian GNU/Linux 8.7 (jessie)
Хочу установить пакет mysql-server, выполняю команду:# apt-get install mysql-server
В результате получаю ошибку:
E: Sub-process /usr/bin/dpkg returned an error code (1)
Вот полный вывод:
root@dev:~# apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
mysql-server-5.5
Suggested packages:
tinyca
The following NEW packages will be installed:
mysql-server mysql-server-5.5
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,846 kB of archives.
After this operation, 32.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 48232 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.5_5.5.54-0+deb8u1_amd64.deb ...
Aborting downgrade from (at least) 10.1 to 5.5.
If are sure you want to downgrade to 5.5, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.5_5.5.54-0+deb8u1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.5.54-0+deb8u1_all.deb ...
Unpacking mysql-server (5.5.54-0+deb8u1) ...
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.5_5.5.54-0+deb8u1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@dev:~# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
mysql-server-5.5
Suggested packages:
tinyca
The following NEW packages will be installed:
mysql-server-5.5
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1,766 kB of archives.
After this operation, 32.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 48232 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.5_5.5.54-0+deb8u1_amd64.deb ...
Aborting downgrade from (at least) 10.1 to 5.5.
If are sure you want to downgrade to 5.5, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.5_5.5.54-0+deb8u1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.5_5.5.54-0+deb8u1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@dev:~# dpkg --configure -a
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not installed.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server
Что эта ошибка означает, и как ее побороть?
This error specified in the title of this article popped out in the middle of the execution of apt command. It is an error which has been bothering for quite sometime. It is because the upgrade process of MySQL Database Server in the Ubuntu Linux Operating System, every operation involving apt tool for package management system include installing, updating and removing packages will generate an error message specified in the title of the article at the end. So, below are steps taken which is basically trial and error in sequential order to be able to completely remove the nuisance of error message generated in the title of this article as follows :
dpkg: error processing package mysql-server-5.7 (--configure)
Below are several of those steps taken :
1. Using dpkg –configure -a.
The first step taken is using ‘dpkg –configure -a’ which is executed since mysql-server-5.7 is considered installed but it hasn’t been configured yet. Below is the output of the command generated :
root@hostname:/home/user# dpkg --configure -a .... dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.7; however: Package mysql-server-5.7 is not configured yet. dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured ... Errors were encountered while processing: mysql-server-5.7 mysql-server You have new mail in /var/mail/root root@hostname:/home/user#
2. But apparently, executing the above ‘dpkg –configure a’ doesn’t really help at all. So, after searching further, below is another step taken to solve the problem which is trying to add configuration for generating log in MySQL Database Server configuration :
general_log_file = /var/log/mysql/mysql.log general_log = 1
It is done by executing the following MySQL Database Server :
user@hostname:~$ vim /etc/mysql/my.cnf user@hostname:~$ sudo su - [sudo] password for user: user@hostname:~# vim /etc/mysql/my.cnf
After trying to reconfigure mysql-server-5.7 which is actually failing, the reconfigure process is continued with the following steps :
3. The following is how to restart the MySQL Database Server process after executing the above process for editing MySQL Database Server’s configuration :
user@hostname:~# /etc/init.d/mysql reload * Reloading MySQL database server mysqld mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists! root@hostname:~# systemctl restart mysql Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. root@hostname:~#
3. Checking the status of MySQL Database Server with just a failure :
root@hostname:~# systemctl status mysql ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: activating (start-post) (Result: exit-code) since Mon 2017-11-06 10:37:16 WIB; 4s ago Process: 15100 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE) Process: 15084 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 15100 (code=exited, status=1/FAILURE); : 15101 (mysql-systemd-s) Tasks: 2 Memory: 332.0K CPU: 27ms CGroup: /system.slice/mysql.service └─control ├─15101 /bin/bash /usr/share/mysql/mysql-systemd-start post └─15211 sleep 1 Nov 06 10:37:16 hostname systemd[1]: Starting MySQL Community Server... Nov 06 10:37:16 hostname mysql-systemd-start[15084]: my_print_defaults: [ERROR] Found option without preceding Nov 06 10:37:16 hostname mysql-systemd-start[15084]: my_print_defaults: [ERROR] Fatal error in defaults handlin Nov 06 10:37:16 hostname mysqld[15100]: mysqld: [ERROR] Found option without preceding group in config file /et Nov 06 10:37:16 hostname mysqld[15100]: mysqld: [ERROR] Fatal error in defaults handling. Program aborted! Nov 06 10:37:16 hostname systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE lines 1-20/20 (END) root@hostname:~#
4. Although the process above is going to be reversed by editing the following two lines before added to the MySQL Database Server as shown below :
root@hostname:~# vim /etc/mysql/my.cnf root@hostname:~# systemctl restart mysql root@hostname:~# vim /etc/mysql/my.cnf You have new mail in /var/mail/root root@hostname:~# systemctl restart mysql root@hostname:~# mysql -uroot -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) root@hostname:~# systemctl status mysql ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2017-11-06 12:42:39 WIB; 15s ago Process: 32501 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS) Process: 32491 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 32500 (mysqld) Tasks: 13 Memory: 103.2M CPU: 270ms CGroup: /system.slice/mysql.service └─32500 /usr/sbin/mysqld Nov 06 12:42:09 hostname systemd[1]: Starting MySQL Community Server... Nov 06 12:42:39 hostname systemd[1]: Started MySQL Community Server. root@hostname:~#
5. For further reference, the following is the information about the version of MySQL Database Server which is going to be configured further in Ubuntu Linux :
root@hostname:~# mysql –version
mysql Ver 14.14 Distrib 5.7.19, for Linux (x86_64) using EditLine wrapper
6. After reloading the process of MySQL Database Server, unfortunately it caused the service cannot be used as shown below. So, the following is the process to install a new MySQL Database Server :
root@hostname:~# apt-get install mysql-server Reading package lists... Done Building dependency tree Reading state information... Done mysql-server is already the newest version (5.7.20-0ubuntu0.16.04.1). 0 upgraded, 0 newly installed, 0 to remove and 149 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable Setting up mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing package mysql-server-5.7 (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.7; however: Package mysql-server-5.7 is not configured yet. dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: mysql-server-5.7 mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1)
7. After failing on to install MySQL Database Server, below is another attempt to configure MySQL Database Server :
root@hostname:~# dpkg --configure -a Setting up mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ... Renaming removed key_buffer and myisam-recover options (if present) ^Cdpkg: error processing package mysql-server-5.7 (--configure): subprocess installed post-installation script was interrupted dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.7; however: Package mysql-server-5.7 is not configured yet. dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: mysql-server-5.7 mysql-server You have new mail in /var/mail/root root@hostname:~#
8. So, in order to solve the above problem the following command is carried out to be executed in order :
sudo apt remove --purge mysql-server-5.5 sudo apt remove --purge mysql-server-5.6 sudo apt remove --purge mysql-server-5.7 sudo apt-get autoremove sudo apt-get autoclean sudo apt update sudo apt upgrade sudo apt install mysql-server mysql-client
9. The first one is about removing the program called mysql-server-5.5 :
root@hostname:~# apt remove --purge mysql-server-5.5 Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: mysql-server-5.5* 0 upgraded, 0 newly installed, 1 to remove and 46 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y (Reading database ... 921862 files and directories currently installed.) Removing mysql-server-5.5 (5.5.46-0ubuntu0.14.04.2) ... Purging configuration files for mysql-server-5.5 (5.5.46-0ubuntu0.14.04.2) ... Setting up mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ... Renaming removed key_buffer and myisam-recover options (if present) dpkg: error processing package mysql-server-5.7 (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.7; however: Package mysql-server-5.7 is not configured yet. dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured No report written because the error message indicates its a followup error from a previous failure. E: Sub-process /usr/bin/dpkg returned an error code (1) You have new mail in /var/mail/root root@hostname:~#
10. After failing on removing the program called mysq-server-5.7, the next one is to remove the program called mysql-server-5.6 as shown below :
root@hostname:~# apt remove --purge mysql-server-5.6 Reading package lists... Done Building dependency tree Reading state information... Done Package 'mysql-server-5.6' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ... Renaming removed key_buffer and myisam-recover options (if present) z [1]+ Stopped apt remove --purge mysql-server-5.6 root@hostname:~#
11. The above process is about removing the program called ‘mysql-server-5.6’ but apparently it is failing. The process is continued by removing mysql-server-5.7 as shown below :
root@hostname:~# apt remove --purge mysql-server-5.7 E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? root@hostname:~#
The process failed since it has already been another attempt on removing ‘mysql-server-5.6’ before in the 9th step. So, apt tool stuck because of the previous failure on removing it. Below is how to solve it :
root@hostname:~# rm -rv /var/cache/apt/archives/lock removed '/var/cache/apt/archives/lock' root@hostname:~# rm -rv /var/lib/dpkg/lock removed '/var/lib/dpkg/lock' root@hostname:~#
Try to re-execute on removing mysql-server-5.6 :
root@hostname:~# apt remove --purge mysql-server-5.6 Reading package lists... Done Building dependency tree Reading state information... Done Package 'mysql-server-5.6' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ... Renaming removed key_buffer and myisam-recover options (if present) [2]+ Stopped apt remove --purge mysql-server-5.6 root@hostname:~# rm -rv /var/cache/apt/archives/lock removed '/var/cache/apt/archives/lock' root@hostname:~# rm -rv /var/lib/dpkg/lock removed '/var/lib/dpkg/lock' root@hostname:~#
12. If there is no MySQL Server 5.6 installed and the process eventually still stuck as shown in the previous output, just terminate the process and carry on to the next process which is the process executed to continue removing another program called ‘mysql-server-5.7’ as shown below :
root@hostname:~# apt remove --purge mysql-server-5.7 E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem. root@hostname:~# dpkg --configure -a Setting up mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing package mysql-server-5.7 (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of mysql-server: mysql-server depends on mysql-server-5.7; however: Package mysql-server-5.7 is not configured yet. dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: mysql-server-5.7 mysql-server
The above process is re-executed once as shown in the following executed command after executing ‘dpkg –configure -a’ first as shown below :
root@hostname:~# apt remove --purge mysql-server-5.7 Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: mysql-server* mysql-server-5.7* 0 upgraded, 0 newly installed, 2 to remove and 46 not upgraded. 2 not fully installed or removed. After this operation, 48,5 MB disk space will be freed. Do you want to continue? [Y/n] Y debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable (Reading database ... 921858 files and directories currently installed.) Removing mysql-server (5.7.20-0ubuntu0.16.04.1) ... Removing mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing package mysql-server-5.7 (--purge): subprocess installed pre-removal script returned error exit status 1 debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error while cleaning up: subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: mysql-server-5.7 E: Sub-process /usr/bin/dpkg returned an error code (1) root@hostname:~#
The following is an attempt for stopping MySQL Database Server after failing on removing MySQL Database Server 5.7 :
root@hostname:~# systemctl stop mysqld Failed to stop mysqld.service: Unit mysqld.service not loaded. root@hostname:~# systemctl stop mysql root@hostname:~# apt remove --purge mysql-server-5.7 Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: mysql-server-5.7* 0 upgraded, 0 newly installed, 1 to remove and 46 not upgraded. 1 not fully installed or removed. After this operation, 48,4 MB disk space will be freed. Do you want to continue? [Y/n] Y debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable (Reading database ... 921854 files and directories currently installed.) Removing mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing package mysql-server-5.7 (--purge): subprocess installed pre-removal script returned error exit status 1 debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error while cleaning up: subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: mysql-server-5.7 E: Sub-process /usr/bin/dpkg returned an error code (1) root@hostname:~#
Since the above execution also ends in failure, the following is the other command which is considered as another process done to be able to remove completely mysql-server-5.7 :
root@hostname:~# fuser -v /var/cache/debconf/config.dat
Re-execute again on the process for removing mysql-server-5.7. Below is the command carried out to able to perform it with the output of it :
root@hostname:~# apt remove --purge mysql-server-5.7 Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: mysql-server* mysql-server-5.7* 0 upgraded, 0 newly installed, 2 to remove and 46 not upgraded. 2 not fully installed or removed. After this operation, 48,5 MB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 921854 files and directories currently installed.) Removing mysql-server (5.7.20-0ubuntu0.16.04.1) ... Removing mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ... update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode Purging configuration files for mysql-server-5.7 (5.7.19-0ubuntu0.16.04.1) ... Processing triggers for man-db (2.7.5-1) ... root@hostname:~#
13. Trying to remove again mysql-server-5.6 as shown below :
root@hostname:~# apt remove --purge mysql-server-5.6 Reading package lists... Done Building dependency tree Reading state information... Done Package 'mysql-server-5.6' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded. root@hostname:~#
14. The next step is a step which is taken to execute the command ‘apt-get autoremove’ which is shown as follows :
root@hostname:~# apt-get autoremove Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded. root@hostname:~#
15. Another step taken is to execute ‘apt-get autoclean’ which is shown as follows :
root@hostname:~# apt-get autoclean Reading package lists... Done Building dependency tree Reading state information... Done Del libcurl3-gnutls 7.47.0-1ubuntu2.3 [185 kB] Del xserver-xorg-core 2:1.18.4-0ubuntu0.7 [1.344 kB] Del cacti-spine 0.8.8b-1ubuntu1.1 [45,4 kB] Del libpoppler58 0.41.0-0ubuntu1.4 [756 kB] Del git 1:2.7.4-0ubuntu1.3 [3.102 kB] Del mysql-server 5.7.20-0ubuntu0.16.04.1 [10,2 kB] Del libopenipmi0 2.0.18-0ubuntu11.1 [438 kB] Del libpoppler-glib8 0.41.0-0ubuntu1.4 [104 kB] Del xserver-xephyr 2:1.18.4-0ubuntu0.7 [924 kB] Del libxenstore3.0 4.6.5-0ubuntu1.4 [21,9 kB] Del adobe-flashplugin 1:20171010.1-0ubuntu0.16.04.1 [9.750 kB] Del adobe-flash-properties-gtk 1:20171010.1-0ubuntu0.16.04.1 [142 kB] Del xserver-xorg-legacy 2:1.18.4-0ubuntu0.7 [35,9 kB] Del libxen-4.6 4.6.5-0ubuntu1.4 [345 kB] Del cacti 0.8.8f+ds1-4ubuntu4.16.04.2 [1.693 kB] Del libpoppler-qt4-4 0.41.0-0ubuntu1.4 [116 kB] Del xserver-common 2:1.18.4-0ubuntu0.7 [27,7 kB] Del chromium-codecs-ffmpeg-extra 61.0.3163.100-0ubuntu0.16.04.1306 [1.043 kB] Del libpoppler-qt5-1 0.41.0-0ubuntu1.4 [118 kB] Del dkms 2.2.0.3-2ubuntu11.5 [66,3 kB] Del git-man 1:2.7.4-0ubuntu1.3 [736 kB] Del libcurl4-openssl-dev 7.47.0-1ubuntu2.3 [263 kB] Del gitk 1:2.7.4-0ubuntu1.3 [132 kB] Del libxfont1 1:1.5.1-1ubuntu0.16.04.3 [95,1 kB] Del libwayland-client0 1.12.0-1~ubuntu16.04.2 [22,4 kB] Del git-core 1:2.7.4-0ubuntu1.3 [1.460 B] Del x11proto-core-dev 7.0.31-1~ubuntu16.04.2 [254 kB] Del google-chrome-stable 62.0.3202.62-1 [48,5 MB] Del libcurl3 7.47.0-1ubuntu2.3 [186 kB] Del chromium-browser-l10n 61.0.3163.100-0ubuntu0.16.04.1306 [2.813 kB] Del chromium-browser 61.0.3163.100-0ubuntu0.16.04.1306 [59,4 MB] Del curl 7.47.0-1ubuntu2.3 [138 kB] Del libmirprotobuf3 0.26.3+16.04.20170605-0ubuntu1.1 [120 kB] Del wpasupplicant 2.4-0ubuntu6.2 [902 kB] Del libwayland-server0 1.12.0-1~ubuntu16.04.2 [28,0 kB] Del poppler-utils 0.41.0-0ubuntu1.4 [131 kB] Del libwayland-cursor0 1.12.0-1~ubuntu16.04.2 [10,1 kB] root@hostname:~#
16. The final step is the installation process of a new MySQL Database Server. The following is an activity by executing the following command. The following command executed with output shown as follows ‘ apt-get install mysql-client mysql-server libmysqlclient-dev’ :
user@hostname:~$ sudo su - [sudo] password for user: root@hostname:~# apt-get install mysql-client mysql-server libmysqlclient-dev Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libmecab2 libmysqlclient20 mysql-common mysql-community-client mysql-community-server The following packages will be REMOVED: mysql-client-5.7 mysql-client-core-5.7 mysql-server-core-5.7 The following NEW packages will be installed: libmecab2 mysql-community-client mysql-community-server mysql-server The following packages will be upgraded: libmysqlclient-dev libmysqlclient20 mysql-client mysql-common 4 upgraded, 4 newly installed, 3 to remove and 9 not upgraded. 38 not fully installed or removed. Need to get 0 B/35,3 MB of archives. After this operation, 128 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Preconfiguring packages ... (Reading database ... 926513 files and directories currently installed.) Preparing to unpack .../mysql-client_5.7.20-1ubuntu16.04_amd64.deb ... Unpacking mysql-client (5.7.20-1ubuntu16.04) over (5.7.19-0ubuntu0.16.04.1) ... dpkg: mysql-server-core-5.7: dependency problems, but removing anyway as you requested: akonadi-backend-mysql depends on mysql-server-core-5.7 | virtual-mysql-server-core; however: Package mysql-server-core-5.7 is to be removed. Package virtual-mysql-server-core is not installed. Package mysql-server-core-5.7 which provides virtual-mysql-server-core is to be removed. akonadi-backend-mysql depends on mysql-server-core-5.7 | virtual-mysql-server-core; however: Package mysql-server-core-5.7 is to be removed. Package virtual-mysql-server-core is not installed. Package mysql-server-core-5.7 which provides virtual-mysql-server-core is to be removed. (Reading database ... 926513 files and directories currently installed.) Removing mysql-server-core-5.7 (5.7.19-0ubuntu0.16.04.1) ... dpkg: mysql-client-5.7: dependency problems, but removing anyway as you requested: redmine-mysql depends on mysql-client | virtual-mysql-client; however: Package mysql-client is not configured yet. Package virtual-mysql-client is not installed. Package mysql-client-5.7 which provides virtual-mysql-client is to be removed. zabbix-server-mysql depends on mysql-client | virtual-mysql-client; however: Package mysql-client is not configured yet. Package virtual-mysql-client is not installed. Package mysql-client-5.7 which provides virtual-mysql-client is to be removed. dbconfig-mysql depends on mysql-client | mariadb-client | virtual-mysql-client; however: Package mysql-client is not configured yet. Package mariadb-client is not installed. Package virtual-mysql-client is not installed. Package mysql-client-5.7 which provides virtual-mysql-client is to be removed. Removing mysql-client-5.7 (5.7.19-0ubuntu0.16.04.1) ... dpkg: mysql-client-core-5.7: dependency problems, but removing anyway as you requested: akonadi-backend-mysql depends on mysql-client-core-5.7 | virtual-mysql-client-core; however: Package mysql-client-core-5.7 is to be removed. Package virtual-mysql-client-core is not installed. Package mysql-client-core-5.7 which provides virtual-mysql-client-core is to be removed. akonadi-backend-mysql depends on mysql-client-core-5.7 | virtual-mysql-client-core; however: Package mysql-client-core-5.7 is to be removed. Package virtual-mysql-client-core is not installed. Package mysql-client-core-5.7 which provides virtual-mysql-client-core is to be removed. Removing mysql-client-core-5.7 (5.7.19-0ubuntu0.16.04.1) ... Processing triggers for man-db (2.7.5-1) ... Selecting previously unselected package mysql-community-server. (Reading database ... 926371 files and directories currently installed.) Preparing to unpack .../mysql-community-server_5.7.20-1ubuntu16.04_amd64.deb ... Unpacking mysql-community-server (5.7.20-1ubuntu16.04) ... Selecting previously unselected package mysql-community-client. Preparing to unpack .../mysql-community-client_5.7.20-1ubuntu16.04_amd64.deb ... Unpacking mysql-community-client (5.7.20-1ubuntu16.04) ... Preparing to unpack .../mysql-common_5.7.20-1ubuntu16.04_amd64.deb ... Unpacking mysql-common (5.7.20-1ubuntu16.04) over (5.7.19-0ubuntu0.16.04.1) ... Selecting previously unselected package libmecab2. Preparing to unpack .../libmecab2_0.996-1.2ubuntu1_amd64.deb ... Unpacking libmecab2 (0.996-1.2ubuntu1) ... Preparing to unpack .../libmysqlclient-dev_5.7.20-1ubuntu16.04_amd64.deb ... Unpacking libmysqlclient-dev (5.7.20-1ubuntu16.04) over (5.7.19-0ubuntu0.16.04.1) ... Preparing to unpack .../libmysqlclient20_5.7.20-1ubuntu16.04_amd64.deb ... Unpacking libmysqlclient20:amd64 (5.7.20-1ubuntu16.04) over (5.7.19-0ubuntu0.16.04.1) ... Selecting previously unselected package mysql-server. Preparing to unpack .../mysql-server_5.7.20-1ubuntu16.04_amd64.deb ... Unpacking mysql-server (5.7.20-1ubuntu16.04) ... Processing triggers for systemd (229-4ubuntu19) ... Processing triggers for ureadahead (0.100.0-19) ... ureadahead will be reprofiled on next reboot Processing triggers for man-db (2.7.5-1) ... Processing triggers for libc-bin (2.23-0ubuntu9) ... Setting up google-chrome-stable (62.0.3202.75-1) ... Setting up adobe-flashplugin (1:20171025.1-0ubuntu0.16.04.1) ... update-alternatives: using /usr/lib/adobe-flashplugin/libflashplayer.so to provide /usr/lib/mozilla/plugins/flashplugin-alternative.so (mozilla-flashplugin) in auto mode Setting up adobe-flash-properties-gtk (1:20171025.1-0ubuntu0.16.04.1) ... Setting up php7.0-common (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-json (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-opcache (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-readline (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-cli (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up libapache2-mod-php7.0 (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... libapache2-mod-php7.0: not switching MPM - already enabled Setting up php-imagick (3.4.3-3+ubuntu16.04.1+deb.sury.org+1) ... Setting up php-memcache (3.0.9~20160311.4991c2f-7+ubuntu16.04.1+deb.sury.org+1) ... Setting up php5.6-common (5.6.32-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php5.6-mysql (5.6.32-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0 (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-curl (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-gd (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-imap (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-intl (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-ldap (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-mbstring (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-mcrypt (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-mysql (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-pspell (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-recode (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-soap (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-sqlite3 (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-tidy (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-xml (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-xmlrpc (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-xsl (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.0-zip (7.0.25-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.1-common (7.1.11-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.1-gd (7.1.11-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.1-mcrypt (7.1.11-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.1-soap (7.1.11-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.1-xml (7.1.11-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up php7.1-zip (7.1.11-1+ubuntu16.04.1+deb.sury.org+1) ... Setting up gitlab-ce (10.1.1-ce.0) ... ...
The above process is actually a success. Start the service and below is the output of it :
user@hostname:~$ systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Jum 2017-11-10 09:12:12 WIB; 1 day 2h ago
Process: 1852 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid (code=exited, status=0/SUCCESS)
Process: 1729 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 1880 (mysqld)
Tasks: 31
Memory: 27.6M
CPU: 1min 54.045s
CGroup: /system.slice/mysql.service
└─1880 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
user@hostname:~$
The verson is still MySQL Database Serer 5.7 but this version is already fully configured without having to lose the data or database already created.
user@hostname:~$ myql --version mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64) using EditLine wrapper user@hostname:~$
0
1
System hostname Debian-60-squeeze-64-LAMP
Operating system Debian Linux 6.0
Webmin version 1.660
Kernel and CPU Linux 2.6.32-5-amd64 on x86_64
Уже 40+ пакетов хотят обновиться.
Жму обновление. Все выдает одинаковые ошибки:
Создание полного списка обновлений ..
Сейчас обновляется apt-show-versions ..
Установка пакетов с помощью команды apt-get -y install apt-show-versions ..
dpkg: dependency problems prevent configuration of mysql-server-5.1:
mysql-server-5.1 depends on mysql-server-core-5.1 (= 5.1.63-0+squeeze1); however:
Version of mysql-server-core-5.1 on system is 5.1.66-0+squeeze1.
dpkg: error processing mysql-server-5.1 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.1
Reading package lists...
Building dependency tree...
Reading state information...
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
mysql-server-5.1 : Depends: mysql-server-core-5.1 (= 5.1.63-0+squeeze1) but 5.1.66-0+squeeze1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
.. ошибка при установке!
И так везде. Везде матерится на мускуль.
Сделал apt-get -f install. Потом часть (большая) пакетов обновилась.
Часть пакетов не обновляется, сыпет:
The following packages were automatically installed and are no longer required:
libhtml-template-perl mysql-server-5.1
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
вопрос:
apt-get autoremove libhtml-template-perl mysql-server-5.1
Мне все не похерит?)
I have an installation of mysql 5.5 that’s working completely as far as i can tell, but every time i run aptitude install someProgram it tries to finish the installation, asking me to set a new mysql password, and still it fails.
I don’t want to uninstall it, because it works, and I’ve already tried reinstalling it, but this same problem happens every time.
Is it possible to mark the package as installed so that aptitude stops spending a minute of trying to configure mysql (and failing) every time i install something?
EDIT:
Here’s the aptitude output, but a newer version is further down below
root@server:~# aptitude install fping
The following NEW packages will be installed:
fping
The following partially installed packages will be configured:
mysql-server mysql-server-5.5
0 packages upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 35.0 kB of archives. After unpacking 114 kB will be used.
Get: 1 http://http.debian.net/debian/ wheezy/main fping armhf 3.2-1 [35.0 kB]
Fetched 35.0 kB in 0s (86.4 kB/s)
Selecting previously unselected package fping.
(Reading database ... 29917 files and directories currently installed.)
Unpacking fping (from .../archives/fping_3.2-1_armhf.deb) ...
Processing triggers for man-db ...
Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
[ ok ] Stopping MySQL database server: mysqld.
[ ok ] Starting MySQL database server: mysqld . ..
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Setting up fping (3.2-1) ...
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
[ ok ] Stopping MySQL database server: mysqld.
130711 11:36:34 [ERROR] An old style --language value with language specific part detected: /usr/share/mysql/english/
130711 11:36:34 [ERROR] Use --lc-messages-dir without language specific part instead.
130711 11:36:34 [Note] Plugin 'FEDERATED' is disabled.
130711 11:36:34 InnoDB: The InnoDB memory heap is disabled
130711 11:36:34 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130711 11:36:34 InnoDB: Compressed tables use zlib 1.2.7
130711 11:36:34 InnoDB: Using Linux native AIO
130711 11:36:34 InnoDB: Initializing buffer pool, size = 128.0M
130711 11:36:35 InnoDB: Completed initialization of buffer pool
130711 11:36:35 InnoDB: highest supported file format is Barracuda.
130711 11:36:36 InnoDB: Waiting for the background threads to start
130711 11:36:37 InnoDB: 5.5.31 started; log sequence number 1595695
130711 11:36:37 InnoDB: Starting shutdown...
130711 11:36:38 InnoDB: Shutdown completed; log sequence number 1595695
[ ok ] Starting MySQL database server: mysqld . ..
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.5
mysql-server
EDIT2: Here’s the new aptitude output after kostix changes:
root@server:~# grep -rFw language /etc/mysql/
/etc/mysql/my.cnf:language = /usr/share/mysql/english
root@server:~# nano /etc/mysql/my.cnf
root@server:~# aptitude install
The following partially installed packages will be configured:
mysql-server mysql-server-5.5
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
[ ok ] Stopping MySQL database server: mysqld.
[ ok ] Starting MySQL database server: mysqld ..
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
[ ok ] Stopping MySQL database server: mysqld.
130711 13:10:35 [Note] Plugin 'FEDERATED' is disabled.
130711 13:10:35 InnoDB: The InnoDB memory heap is disabled
130711 13:10:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130711 13:10:35 InnoDB: Compressed tables use zlib 1.2.7
130711 13:10:35 InnoDB: Using Linux native AIO
130711 13:10:35 InnoDB: Initializing buffer pool, size = 128.0M
130711 13:10:35 InnoDB: Completed initialization of buffer pool
130711 13:10:35 InnoDB: highest supported file format is Barracuda.
130711 13:10:35 InnoDB: Waiting for the background threads to start
130711 13:10:36 InnoDB: 5.5.31 started; log sequence number 1595695
130711 13:10:36 InnoDB: Starting shutdown...
130711 13:10:37 InnoDB: Shutdown completed; log sequence number 1595695
[ ok ] Starting MySQL database server: mysqld ..
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.5
mysql-server
EDIT3: with the set -u -e -x flags:
root@server:~# aptitude install screen
The following NEW packages will be installed:
screen
The following partially installed packages will be configured:
mysql-server mysql-server-5.5
0 packages upgraded, 1 newly installed, 0 to remove and 30 not upgraded.
Need to get 633 kB of archives. After unpacking 824 kB will be used.
Get: 1 http://http.debian.net/debian/ wheezy/main screen armhf 4.1.0~20120320gitdb59704-7 [633 kB]
Fetched 633 kB in 1s (443 kB/s)
Selecting previously unselected package screen.
(Reading database ... 29927 files and directories currently installed.)
Unpacking screen (from .../screen_4.1.0~20120320gitdb59704-7_armhf.deb) ...
Processing triggers for install-info ...
Processing triggers for man-db ...
Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld ..
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Setting up screen (4.1.0~20120320gitdb59704-7) ...
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
Stopping MySQL database server: mysqld.
130711 16:39:19 [Note] Plugin 'FEDERATED' is disabled.
130711 16:39:19 InnoDB: The InnoDB memory heap is disabled
130711 16:39:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130711 16:39:19 InnoDB: Compressed tables use zlib 1.2.7
130711 16:39:19 InnoDB: Using Linux native AIO
130711 16:39:19 InnoDB: Initializing buffer pool, size = 128.0M
130711 16:39:19 InnoDB: Completed initialization of buffer pool
130711 16:39:19 InnoDB: highest supported file format is Barracuda.
130711 16:39:19 InnoDB: Waiting for the background threads to start
130711 16:39:20 InnoDB: 5.5.31 started; log sequence number 1595695
130711 16:39:21 InnoDB: Starting shutdown...
130711 16:39:22 InnoDB: Shutdown completed; log sequence number 1595695
Starting MySQL database server: mysqld ..
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server-5.5
mysql-server
I am trying to do a clean reinstall of mySQL for various reasons. I have followed several posts here, and on stack exchange, particularly this ask ubuntu post, however, every time I go through the steps I end at the same result.
Setting up mysql-client (5.7.20-0ubuntu0.16.04.1) ...
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Processing tri
ggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)
I am absolutely stumped at this point…
update:
root@DESKTOP-UTQ3IFA:~# apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
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 ]
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)




