<div dir="ltr"><div>Source: mariadb-10.0</div><div>Severity: normal</div><div><br></div><div>Dear Maintainer,</div><div><br></div><div>I'm actually an ubuntu user, and reported this bug at <a href="https://bugs.launchpad.net/ubuntu/+source/mariadb-10.0/+bug/1474212">https://bugs.launchpad.net/ubuntu/+source/mariadb-10.0/+bug/1474212</a>, but I thought to report it upstream as well. If this is inappropriate, I apologize.</div><div><br></div><div>apt-get dist-upgrade failed for me on the mariadb-server-10.0 package, with the error</div><div><br></div><div>cp: cannot overwrite directory ‘/var/lib/mysql-upgrade/DATADIR.link/mysql’ with non-directory<br></div><div><br></div><div>I tracked it down to line 144 in mariadb-server-10.0.preinst, which tries to save the soft link that /var/lib/mysql points to by copying it to /var/lib/mysql-upgrade/DATADIR.link/mysql. However, since the target link already exists, cp tried to copy /var/lib/mysql into the directory that /var/lib/mysql-upgrade/DATADIR.link/mysql points to, which is wrong and luckily failed fast rather than just silently doing the wrong thing.</div><div><br></div><div>The fix is simple: add -T to the cp command. </div><div><br></div><div>Perhaps the bug is that the previous upgrade didn't clean up and left the soft link under /var/lib/mysql-upgrade, I don't know. In any case, -T does the trick.</div><div><br></div><div><br></div><div>-- System Information:</div><div>Debian Release: jessie/sid</div><div>  APT prefers vivid-updates</div><div>  APT policy: (500, 'vivid-updates'), (500, 'vivid-security'), (500, 'vivid'), (100, 'vivid-backports')</div><div>Architecture: amd64 (x86_64)</div><div>Foreign Architectures: i386</div><div><br></div><div>Kernel: Linux 3.19.0-22-generic (SMP w/8 CPU cores)</div><div>Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)</div><div>Shell: /bin/sh linked to /bin/dash</div><div>Init: systemd (via /run/systemd/system)</div><div><br></div></div>