<div dir="ltr">Thanks a lot for this, Mike, this sounded like a useful thing to try at this stage.<div><div style><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 10, 2013 at 8:27 PM, Mike Perkins <span dir="ltr">&lt;<a href="mailto:mikep@randomtraveller.org.uk" target="_blank">mikep@randomtraveller.org.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Since you have gone over this several times with more or less the same results I&#39;m beginning to wonder if you have a file, files or directory which the installation process needs to write to but can&#39;t. <div class="im">
</div></blockquote><div>... <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">
<br></div>
First of all, attempt to uninstall everything so that in theory you have a fresh system to start from. Then, look around your file system for remaining files: try /var/lib/mysql, /var/run/mysql, /var/log/mysql and /etc/mysql but there may be other locations. If you find any files in these directories it is possible that they may have the wrong permissions and are blocking the installation.<br>
</blockquote><div><br></div><div><div>I could see the permissions of those files but could not tell by whom they had to be readable or writable in a working setup.</div><div><br></div><div>So I thought: let me try on another computer. It didn&#39;t have mysql-server installed. I did sudo apt-get install mysql-server and got no errors, and typing mysql gave me a prompt. So at least I&#39;d have a kind of reference installation I could compare the &quot;right&quot; permissions against.</div>
</div><div><br></div><div>Anyway, having done that I thought: how about moving all those directories you mentioned out of the way, and attempting a reinstall? Shouldn&#39;t that (hopefully) work as on the other computer? Of course the mysql would no longer have myth in there, but I figured I could copy it back in later, with appropriate permissions, if everything worked. But it seems not to have worked: it gave similar errors to before. I can&#39;t figure it out. I have listed all the permissions of the directories so you can tell me if you spot anything obviously wrong.</div>
<div style><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
(Of course, if you had a previous mythtv database, I&#39;m assuming you have a suitable backup already?)<br></blockquote><div><br></div><div style>Well, I did take a copy of /var on another physical drive when I started those rescue operations. Still, I only moved those directories to .bak rather than deleting them, as you&#39;ll see below.</div>
<div style><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Also look at /etc/init.d/mysql and see what the &quot;start&quot; option references. See if you can determine what it wants to do and why it fails.<br>
</blockquote><div><br></div><div style>I had a look but got no enlightenment from it. Maybe you can read more into it than I did (see end of listing).</div><div style><br></div><div style><br></div><div style><br></div><div style>
<div># dpkg -P mysql-server-5.5 mysql-server(Reading database ... 322308 files and directories currently installed.)</div><div>Removing mysql-server-5.5 ...</div><div>Purging configuration files for mysql-server-5.5 ...</div>
<div>dpkg: warning: while removing mysql-server-5.5, directory &#39;/usr/share/doc/mysql-server-5.5&#39; not empty so not removed</div><div>Removing mysql-server ...</div><div>Processing triggers for man-db ...</div><div>
Processing triggers for ureadahead ...</div><div><br></div><div># dpkg -l mysql-server mysql-server-5.5 Desired=Unknown/Install/Remove/Purge/Hold</div><div>| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend</div>
<div>|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)</div><div>||/ Name           Version      Architecture Description</div><div>+++-==============-============-============-=================================</div>
<div>un  mysql-server   &lt;none&gt;                    (no description available)</div><div>dpkg-query: no packages found matching mysql-server-5.5</div><div><br></div><div><br></div><div>-------------------------</div><div style>
OK, removed as far as we can tell.</div><div style><br></div><div style>Now for each of the dirs you mentioned I list the current permissions and then I move it out of the way.</div><div style>-------------------------</div>
<div><br></div><div><br></div><div># ls -ld /var/lib/mysql/</div><div>drwx------ 6 mysql mysql 4096 Mar 10 17:33 /var/lib/mysql/</div><div><br></div><div># ls -l /var/lib/mysql/</div><div>total 32</div><div>-rwxr-xr-x 1 mysql mysql     0 Mar 10 17:32 debian-5.5.flag</div>
<div>-rw-rw---- 1 mysql mysql     0 Mar  3 13:26 ibdata1</div><div>drwx------ 2 mysql mysql  4096 Mar  3 13:23 mysql</div><div>-rwxr-xr-x 1 mysql mysql     6 Jan 23 23:06 mysql_upgrade_info</div><div>drwxr-xr-x 2 mysql mysql 16384 Dec 16 23:06 mythconverg</div>
<div>drwx------ 2 mysql mysql  4096 Mar 10 17:32 performance_schema</div><div>drwxr-xr-x 2 mysql mysql  4096 Aug 18  2012 test</div><div><br></div><div># mv /var/lib/mysql /var/lib/mysql.bak</div><div><br></div><div><br></div>
<div><br></div><div># ls -ld /var/run/mysqld/</div><div>drwxr-xr-x 2 mysql root 40 Mar  8 20:16 /var/run/mysqld/</div><div><br></div><div># ls -l /var/run/mysqld/</div><div>total 0</div><div><br></div><div># mv /var/run/mysqld /var/run/mysqld.bak</div>
<div><br></div><div><br></div><div><br></div><div># ls -ld /etc/mysql/</div><div>drwxr-xr-x 3 root root 4096 Mar 10 20:45 /etc/mysql/</div><div><br></div><div># ls -l /etc/mysql/</div><div>total 12</div><div>drwxr-xr-x 2 root root 4096 Mar 10 20:45 conf.d</div>
<div>-rw------- 1 root root  333 Aug 18  2012 debian.cnf</div><div>-rw-r--r-- 1 root root 3505 Jan 16 20:47 my.cnf</div><div><br></div><div># mv /etc/mysql /etc/mysql.bak</div><div><br></div><div><br></div><div><br></div>
<div># ls -ld /var/log/mysql</div><div>drwxr-s--- 2 mysql adm 4096 Mar 10 07:55 /var/log/mysql</div><div><br></div><div># ls -l /var/log/mysql</div><div>total 92</div><div>-rw-r----- 1 mysql adm 55463 Mar 10 17:33 error.log</div>
<div>-rw-r----- 1 mysql adm  1475 Mar  9 18:45 error.log.1.gz</div><div>-rw-r----- 1 mysql adm  4066 Mar  8 22:34 error.log.2.gz</div><div>-rw-r----- 1 mysql adm    20 Mar  7 07:49 error.log.3.gz</div><div>-rw-r----- 1 mysql adm    20 Mar  6 07:37 error.log.4.gz</div>
<div>-rw-r----- 1 mysql adm    20 Mar  5 07:56 error.log.5.gz</div><div>-rw-r----- 1 mysql adm    20 Mar  4 07:43 error.log.6.gz</div><div>-rw-r----- 1 mysql adm  6314 Mar  3 14:55 error.log.7.gz</div><div><br></div><div>
# mv /var/log/mysql /var/log/mysql.bak</div><div><br></div><div><br></div><div>------------------------</div><div style>...and I double-check that I moved ALL of them out of the way.</div><div style>-----------------------</div>
<div><br></div><div># ls -ld /var/lib/mysql /var/run/mysql /var/log/mysql /etc/mysql</div><div>ls: cannot access /var/lib/mysql: No such file or directory</div><div>ls: cannot access /var/run/mysql: No such file or directory</div>
<div>ls: cannot access /var/log/mysql: No such file or directory</div><div>ls: cannot access /etc/mysql: No such file or directory</div><div><br></div><div><br></div><div>------------------------</div><div style>OK. So now I hope this is going to be a clean install at last</div>
<div style>------------------------</div><div><br></div><div><br></div><div># apt-get install mysql-server</div><div>Reading package lists... Done</div><div>Building dependency tree       </div><div>Reading state information... Done</div>
<div>The following extra packages will be installed:</div><div>  mysql-server-5.5</div><div>Suggested packages:</div><div>  tinyca mailx</div><div>The following NEW packages will be installed:</div><div>  mysql-server mysql-server-5.5</div>
<div>0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.</div><div>Need to get 0 B/8,851 kB of archives.</div><div>After this operation, 32.8 MB of additional disk space will be used.</div><div>Do you want to continue [Y/n]? </div>
<div>Preconfiguring packages ...</div><div>Selecting previously unselected package mysql-server-5.5.</div><div>(Reading database ... 322221 files and directories currently installed.)</div><div>Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.29-0ubuntu0.12.10.1_amd64.deb) ...</div>
<div>egrep: /etc/mysql/: No such file or directory</div><div>Selecting previously unselected package mysql-server.</div><div>Unpacking mysql-server (from .../mysql-server_5.5.29-0ubuntu0.12.10.1_all.deb) ...</div><div>Processing triggers for ureadahead ...</div>
<div>Processing triggers for man-db ...</div><div>Setting up mysql-server-5.5 (5.5.29-0ubuntu0.12.10.1) ...</div><div>start: Job failed to start</div><div>invoke-rc.d: initscript mysql, action &quot;start&quot; failed.</div>
<div>dpkg: error processing mysql-server-5.5 (--configure):</div><div> subprocess installed post-installation script returned error exit status 1</div><div>dpkg: dependency problems prevent configuration of mysql-server:</div>
<div> mysql-server depends on mysql-server-5.5; however:</div><div>  Package mysql-server-5.5 is not configured yet.</div><div><br></div><div>dpkg: error processing mysql-server (--configure):</div><div> dependency problems - leaving unconfigured</div>
<div>Processing triggers for ureadahead ...</div><div>No apport report written because the error message indicates its a followup error from a previous failure.</div><div>                          Errors were encountered while processing:</div>
<div> mysql-server-5.5</div><div> mysql-server</div><div>E: Sub-process /usr/bin/dpkg returned an error code (1)</div><div><br></div><div><br></div><div>----------------------------------</div><div style>Damn.</div><div style>
<br></div><div style>And here&#39;s the other file you suggested I look at</div><div style>-----------------------------------</div><div><br></div><div><br></div><div># cat /etc/init.d/mysql </div><div>#!/bin/sh -e</div><div>
# upstart-job</div><div>#</div><div># Symlink target for initscripts that have been converted to Upstart.</div><div><br></div><div>set -e</div><div><br></div><div>INITSCRIPT=&quot;$(basename &quot;$0&quot;)&quot;</div><div>
JOB=&quot;${INITSCRIPT%.sh}&quot;</div><div><br></div><div>if [ &quot;$JOB&quot; = &quot;upstart-job&quot; ]; then</div><div>    if [ -z &quot;$1&quot; ]; then</div><div>        echo &quot;Usage: upstart-job JOB COMMAND&quot; 1&gt;&amp;2</div>
<div><span class="" style="white-space:pre">        </span>exit 1</div><div>    fi</div><div><br></div><div>    JOB=&quot;$1&quot;</div><div>    INITSCRIPT=&quot;$1&quot;</div><div>    shift</div><div>else</div><div>    if [ -z &quot;$1&quot; ]; then</div>
<div>        echo &quot;Usage: $0 COMMAND&quot; 1&gt;&amp;2</div><div><span class="" style="white-space:pre">        </span>exit 1</div><div>    fi</div><div>fi</div><div><br></div><div>COMMAND=&quot;$1&quot;</div><div>shift</div>
<div><br></div><div><br></div><div>if [ -z &quot;$DPKG_MAINTSCRIPT_PACKAGE&quot; ]; then</div><div><span class="" style="white-space:pre">        </span>ECHO=echo</div><div>else</div><div><span class="" style="white-space:pre">        </span>ECHO=:</div>
<div>fi</div><div><br></div><div>$ECHO &quot;Rather than invoking init scripts through /etc/init.d, use the service(8)&quot;</div><div>$ECHO &quot;utility, e.g. service $INITSCRIPT $COMMAND&quot;</div><div><br></div><div>
# Only check if jobs are disabled if the currently _running_ version of</div><div># Upstart (which may be older than the latest _installed_ version)</div><div># supports such a query.</div><div>#</div><div># This check is necessary to handle the scenario when upgrading from a</div>
<div># release without the &#39;show-config&#39; command (introduced in</div><div># Upstart for Ubuntu version 0.9.7) since without this check, all</div><div># installed packages with associated Upstart jobs would be considered</div>
<div># disabled.</div><div>#</div><div># Once Upstart can maintain state on re-exec, this change can be</div><div># dropped (since the currently running version of Upstart will always</div><div># match the latest installed version).</div>
<div><br></div><div>UPSTART_VERSION_RUNNING=$(initctl version|awk &#39;{print $3}&#39;|tr -d &#39;)&#39;)</div><div><br></div><div>if dpkg --compare-versions &quot;$UPSTART_VERSION_RUNNING&quot; ge 0.9.7</div><div>then</div>
<div>    initctl show-config -e &quot;$JOB&quot;|grep -q &#39;^  start on&#39; || DISABLED=1</div><div>fi</div><div><br></div><div>case $COMMAND in</div><div>status)</div><div>    $ECHO</div><div>    $ECHO &quot;Since the script you are attempting to invoke has been converted to an&quot;</div>
<div>    $ECHO &quot;Upstart job, you may also use the $COMMAND(8) utility, e.g. $COMMAND $JOB&quot;</div><div>    $COMMAND &quot;$JOB&quot;</div><div>    ;;</div><div>start|stop)</div><div>    $ECHO</div><div>    $ECHO &quot;Since the script you are attempting to invoke has been converted to an&quot;</div>
<div>    $ECHO &quot;Upstart job, you may also use the $COMMAND(8) utility, e.g. $COMMAND $JOB&quot;</div><div>    if status &quot;$JOB&quot; 2&gt;/dev/null | grep -q &#39; start/&#39;; then</div><div>        RUNNING=1</div>
<div>    fi</div><div>    if [ -z &quot;$RUNNING&quot; ] &amp;&amp; [ &quot;$COMMAND&quot; = &quot;stop&quot; ]; then</div><div>        exit 0</div><div>    elif [ -n &quot;$RUNNING&quot; ] &amp;&amp; [ &quot;$COMMAND&quot; = &quot;start&quot; ]; then</div>
<div>        exit 0</div><div>    elif [ -n &quot;$DISABLED&quot; ] &amp;&amp; [ &quot;$COMMAND&quot; = &quot;start&quot; ]; then</div><div>        exit 0</div><div>    fi</div><div>    $COMMAND &quot;$JOB&quot;</div><div>
    ;;</div><div>restart)</div><div>    $ECHO</div><div>    $ECHO &quot;Since the script you are attempting to invoke has been converted to an&quot;</div><div>    $ECHO &quot;Upstart job, you may also use the stop(8) and then start(8) utilities,&quot;</div>
<div>    $ECHO &quot;e.g. stop $JOB ; start $JOB. The restart(8) utility is also available.&quot;</div><div>    if status &quot;$JOB&quot; 2&gt;/dev/null | grep -q &#39; start/&#39;; then</div><div>        RUNNING=1</div>
<div>    fi</div><div>    if [ -n &quot;$RUNNING&quot; ] ; then</div><div>        stop &quot;$JOB&quot;</div><div>    fi</div><div>    # If the job is disabled and is not currently running, the job is</div><div>    # not restarted. However, if the job is disabled but has been forced into the</div>
<div>    # running state, we *do* stop and restart it since this is expected behaviour</div><div>    # for the admin who forced the start.</div><div>    if [ -n &quot;$DISABLED&quot; ] &amp;&amp; [ -z &quot;$RUNNING&quot; ]; then</div>
<div>        exit 0</div><div>    fi</div><div>    start &quot;$JOB&quot;</div><div>    ;;</div><div>reload|force-reload)</div><div>    $ECHO</div><div>    $ECHO &quot;Since the script you are attempting to invoke has been converted to an&quot;</div>
<div>    $ECHO &quot;Upstart job, you may also use the reload(8) utility, e.g. reload $JOB&quot;</div><div>    reload &quot;$JOB&quot;</div><div>    ;;</div><div>*)</div><div>    $ECHO</div><div>    $ECHO &quot;The script you are attempting to invoke has been converted to an Upstart&quot; 1&gt;&amp;2</div>
<div>    $ECHO &quot;job, but $COMMAND is not supported for Upstart jobs.&quot; 1&gt;&amp;2</div><div>    exit 1</div><div>esac</div><div># </div><div><br></div></div><div style><br></div><div style>-------------------------------</div>
<div style>I can&#39;t figure out why the install gave an error if I had seemingly moved out of the way all remaining traces of mysql. Can you?</div><div style>-------------------------------</div><div style><br></div><div style>
<br></div></div></div></div>