【问题标题】:Raspbian - dpkg error when trying to install mysql-serverRaspbian - 尝试安装 mysql-server 时出现 dpkg 错误
【发布时间】:2016-10-10 12:41:18
【问题描述】:

我在我的 Raspberry Pi 上运行一个 lighttpd Web 服务器,我正在尝试添加 php 和 mysql 支持。我目前正在尝试使用命令安装 mysql-server

'sudo apt-get install mysql-server'

导致以下错误:

[my user name]@raspberrypi:~ $ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libaio1 libhtml-template-perl mysql-server-5.5 mysql-server-core-5.5
Suggested packages:
  libipc-sharedcache-perl mailx tinyca
The following NEW packages will be installed:
  libaio1 libhtml-template-perl mysql-server mysql-server-5.5
  mysql-server-core-5.5
0 upgraded, 5 newly installed, 0 to remove and 15 not upgraded.
Need to get 0 B/4,938 kB of archives.
After this operation, 46.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
WARNING: The following packages cannot be authenticated!
  libaio1 mysql-server-core-5.5 mysql-server-5.5 libhtml-template-perl
  mysql-server
Install these packages without verification? [y/N] y
Preconfiguring packages ...
Selecting previously unselected package libaio1:armhf.
(Reading database ... 121517 files and directories currently installed.)
Preparing to unpack .../libaio1_0.3.110-1_armhf.deb ...
Unpacking libaio1:armhf (0.3.110-1) ...
Selecting previously unselected package mysql-server-core-5.5.
Preparing to unpack .../mysql-server-core-5.5_5.5.52-0+deb8u1_armhf.deb ...
Unpacking mysql-server-core-5.5 (5.5.52-0+deb8u1) ...
Preparing to unpack .../mysql-server-5.5_5.5.52-0+deb8u1_armhf.deb ...
Aborting downgrade from (at least) 10.0 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.52-0+deb8u1_armhf.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack .../libhtml-template-perl_2.95-1_all.deb ...
Unpacking libhtml-template-perl (2.95-1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.5.52-0+deb8u1_all.deb ...
Unpacking mysql-server (5.5.52-0+deb8u1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-5.5_5.5.52-0+deb8u1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我知道这里报告了同样的问题: https://raspberrypi.stackexchange.com/questions/28312/raspberry-pi-2-installing-mysql-server

但这种情况下的解决方案似乎是启用环回接口。就我而言,环回接口工作正常,但这并不能解决我的问题。

ifconfig 输出:

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1096 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1096 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:91408 (89.2 KiB)  TX bytes:91408 (89.2 KiB)

我反复尝试了以下命令,但没有结果:

'sudo apt-get -f install'

'sudo apt-get autoremove'

'sudo apt-get autoclean'

'sudo apt-get update'

'sudo apt-get upgrade'

'sudo dpkg --configure -a'

【问题讨论】:

    标签: mysql linux debian raspbian


    【解决方案1】:

    问题出在预安装脚本中。它应该安装完美。你有一些选择:

    1) 在 Debian 错误跟踪系统 (BTS) 中打开一个错误。确保您使用的是最新版本。

    2) 尝试自己修复它。

    如果你决定使用 2),你想让这个脚本变得冗长,所以,编辑一个文件名 /var/lib/dpkg/info/mysql-server-5.5_5.5.52-0*.preinst

    然后将第一行替换为:

    #!/bin/sh 
    

    #!/bin/sh -x
    

    然后,致电# apt-get install -f 并查看新的日志消息

    【讨论】:

      【解决方案2】:

      尝试:

      sudo apt-get autoremove --purge <package> 
      

      【讨论】:

        猜你喜欢
        • 2016-06-07
        • 2018-12-16
        • 1970-01-01
        • 1970-01-01
        • 2023-01-03
        • 1970-01-01
        • 2020-05-02
        • 1970-01-01
        • 2020-12-04
        相关资源
        最近更新 更多