【问题标题】:Sub-process /usr/bin/dpkg returned an error code (1) While Installing mysql子进程/usr/bin/dpkg返回错误码(一)安装mysql时
【发布时间】:2016-01-04 08:47:35
【问题描述】:

我正在尝试通过apt-get install mysql-server-5.5 安装mysql-server-5.5,我看到了这个错误 - Sub-process /usr/bin/dpkg returned an error code (1)

sudo dpkg --configure -a的输出

dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not installed.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server

sudo apt-get -f install的输出

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  mysql-server-5.5
Suggested packages:
  tinyca mailx
The following NEW packages will be installed:
  mysql-server-5.5
0 upgraded, 1 newly installed, 0 to remove and 60 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1981 kB of archives.
After this operation, 32.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Preconfiguring packages ...
(Reading database ... 95180 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.5_5.5.46-0ubuntu0.14.04.2_amd64.deb ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Aborting downgrade from (at least) 5.6 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.46-0ubuntu0.14.04.2_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-5.5_5.5.46-0ubuntu0.14.04.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

感谢您的帮助。

【问题讨论】:

  • 我在 Mint 上遇到了同样的问题。您正在运行哪个发行版?

标签: mysql ubuntu debian


【解决方案1】:

我遇到了同样的问题。我在 Mint 有一个 10.1 的标志。 找出您使用的标志:

sudo ls -al /var/lib/mysql/

然后删除文件 sudo rm /var/lib/mysql/debian-5.6-flag 然后尝试重新安装 sudo apt-get -f install

希望对你有用

查看这篇superuser 文章,可能与您的具体错误更相关

【讨论】:

  • 我很久以前就做过了,但是mysql 没有开始。它说start: Job failed to start 尝试了一切,但没有运气:(
  • 当您尝试 sudo apt-get install -f 时是否仍然遇到相同的错误
  • 您还修复了语言环境警告吗?我最终更新了 dpkg。
猜你喜欢
  • 2022-07-17
  • 1970-01-01
  • 1970-01-01
  • 2014-04-27
  • 2020-02-10
  • 2018-07-19
  • 1970-01-01
  • 1970-01-01
  • 2016-12-04
相关资源
最近更新 更多