Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
share|improve this question
    
A quick hack to get you going: open /etc/init.d/mysqld rc-file in a text editor, locate the case switch dispatching on the script argument, and put exit 0 before the first command in the branch dealing with the start argument; then run dpkg --configure --pending. After it (supposedly) succeeds, revert your edit. –  kostix Jul 11 '13 at 10:18
    
But really you should report a bug about this! You also might get further assistance with this from the package maintainers. –  kostix Jul 11 '13 at 10:21
    
Oh, please disregard my hack -- I missed those [ERROR] bits. –  kostix Jul 11 '13 at 10:26
    
@kostix add your first comment to your answer and i'll mark it. It worked :D –  Filip Haglund Jul 11 '13 at 15:49
    
Did that. Also described how a similar technique could be used to deal with uninstallable packages somtimes. –  kostix Jul 13 '13 at 9:44

1 Answer 1

up vote 1 down vote accepted

The first problem (MySQL errors)

Regarding those [ERROR] bits…

Please do

# grep -rFw language /etc/mysql/

as I supposed your configuration files still refer to a deprecated configuration option.

For instance, on one of my Wheezy systems which were upgraded from Squeeze, I have:

# grep -rFw language /etc/mysql
/etc/mysql/my.cnf.dpkg-old:language     = /usr/share/mysql/english
# grep -rFw lc-messages-dir /etc/mysql
/etc/mysql/my.cnf:lc-messages-dir       = /usr/share/mysql

Notice that the old directive is in the .dpkg-old file (which is not used), and lc-messages-dir is in the "active" file.

Commenting out that language option in an active configuration file should fix this for you. Note that MySQL also loads all the files matching the *.cnf pattern from the /etc/mysql/conf.d directory.

The second problem (failure to start the MySQL daemon)

A quick hack to get past this problem: open /etc/init.d/mysql rc-file in a text editor, locate the case switch dispatching on the script argument, and put exit 0 before the first command in the branch dealing with the start argument; then run dpkg --configure --pending. After it (supposedly) succeeds, revert your edit.

The idea behind this trick is to just let the rc-script's start target to complete successfully. The same approach might also sometimes come in handy to deal with uninstalling a package when its post-installation script (the postinst script in Debian developer's lingo) misbehaves — placing exit 0 near the start of the /var/lib/dpkg/info/<packagename>.postinst script and running dpkg --configure --pending usually helps.

But the usual bold warning applies: do not follow such advices blindly: package configuration scripts are there not to just error out and make the user unhappy — they usually perform certain configuration or cleanups etc, and so measures like the one described should be treated as the last resort.

share|improve this answer
    
have a look at edit2 –  Filip Haglund Jul 11 '13 at 11:16
    
@FilipHaglund, okay now I have no idea what makes that start target fail, so I'd try the hack detailed in my first comment to your original post. –  kostix Jul 11 '13 at 12:04
    
@FilipHaglund, you can try to debug the rc script first, adding something like set -e -u -x somewhere after the shebang (that #!/bin/sh line) near the top of that file -- that would force the shell executing that script to fail on errors (-e) and accessing unset variables (-u) as well as to print command execution trace to its standard error output (-x). –  kostix Jul 11 '13 at 14:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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