通过apt升级MySQL不起作用?

通过apt升级MySQL不起作用?

我正在升级mysql-server,但mysql-client我使用的是 12.04 apt-get。升级似乎没有生效?有什么想法为什么会发生这种情况吗?升级后我确实重启了。谢谢。

$ mysql -V
mysql  Ver 14.14 Distrib 5.5.22, for debian-linux-gnu (x86_64) using readline 6.2
$ mysqld -V
mysqld  Ver 5.5.22-0ubuntu1 for debian-linux-gnu on x86_64 ((Ubuntu))


$ sudo apt-cache policy mysql-server
[sudo] password for dli: 
mysql-server:
  Installed: 5.5.29-0ubuntu0.12.04.2
  Candidate: 5.5.29-0ubuntu0.12.04.2
  Version table:
 *** 5.5.29-0ubuntu0.12.04.2 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     5.5.29-0ubuntu0.12.04.1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
     5.5.24-0ubuntu0.12.04.1 0
        500 http://os.cgs.wustl.edu/ubuntu/ precise-updates/main amd64 Packages
        500 http://os.cgs.wustl.edu/ubuntu/ precise-security/main amd64 Packages
     5.5.22-0ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        500 http://os.cgs.wustl.edu/ubuntu/ precise/main amd64 Packages


$ sudo apt-cache policy mysql-client
mysql-client:
  Installed: 5.5.29-0ubuntu0.12.04.2
  Candidate: 5.5.29-0ubuntu0.12.04.2
  Version table:
 *** 5.5.29-0ubuntu0.12.04.2 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     5.5.29-0ubuntu0.12.04.1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
     5.5.24-0ubuntu0.12.04.1 0
        500 http://os.cgs.wustl.edu/ubuntu/ precise-updates/main amd64 Packages
        500 http://os.cgs.wustl.edu/ubuntu/ precise-security/main amd64 Packages
     5.5.22-0ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        500 http://os.cgs.wustl.edu/ubuntu/ precise/main amd64 Packages

答案1

正如 SpamapS 在评论中所说,mysql-servermysql-client是元包。这元包是空的,通常依赖于会随着版本变化而定期更改名称的软件包,或大量具有相同功能的软件包(即ubuntu-desktop)。如您所见:

braiam@bt:~$ apt-cache depends mysql-client
mysql-client
  Depends: mysql-client-5.5
braiam@bt:~$ apt-cache depends mysql-server
mysql-server
  Depends: mysql-server-5.5

这两个包都依赖于其他包,因此您必须检查这些包以查看 apt 正在安装的实际版本:

braiam@bt:~$ apt-cache policy mysql-server-5.5 | grep Installed
  Installed: 5.5.31+dfsg-1
braiam@bt:~$ apt-cache policy mysql-client-5.5 | grep Installed
  Installed: 5.5.31+dfsg-1

您应该运行apt-cache policy mysql-server-5.5 mysql-client-5.5 | grep Installed来检查系统上安装的版本。

相关内容