AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 470903
Accepted
klor
klor
Asked: 2018-09-24 09:33:30 +0800 CST2018-09-24 09:33:30 +0800 CST 2018-09-24 09:33:30 +0800 CST

在 Debian 9 Stretch 上安装 mysql-server 时出错(依赖问题)

  • 772

使用 Debian 9.5,全新安装。我想安装mysql-server,但遇到了依赖问题。

sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mysql-server : Depends: default-mysql-server but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

apt-get install mysql-server default-mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 default-mysql-server : Depends: mariadb-server-10.1 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

sudo apt-get install mysql-server default-mysql-server mariadb-server-10.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mariadb-server-10.1 : Depends: libdbi-perl but it is not going to be installed
                       Recommends: libhtml-template-perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

sudo apt-get install mysql-server default-mysql-server mariadb-server-10.1 libhtml-template-perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libhtml-template-perl : Depends: libcgi-pm-perl but it is not going to be installed or
                                  perl (< 5.19) but 5.26.2-7 is to be installed
 mariadb-server-10.1 : Depends: libdbi-perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

sudo apt-get install mysql-server default-mysql-server mariadb-server-10.1 libdbi-perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libdbi-perl : Depends: perlapi-5.24.1
E: Unable to correct problems, you have held broken packages.

编辑1 apt-cache policy::

apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://security.debian.org/debian-security stretch/updates/contrib amd64 Packages
     release v=9,o=Debian,a=stable,n=stretch,l=Debian-Security,c=contrib,b=amd64
     origin security.debian.org
 500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
     release v=9,o=Debian,a=stable,n=stretch,l=Debian-Security,c=main,b=amd64
     origin security.debian.org
 500 http://deb.debian.org/debian stretch-updates/main amd64 Packages
     release o=Debian,a=stable-updates,n=stretch-updates,l=Debian,c=main,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian stretch/main amd64 Packages
     release v=9.5,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=amd64
     origin deb.debian.org
Pinned packages:

apt policy perl perl-base编辑2 ::

apt policy perl perl-base
perl:
  Installed: 5.26.2-7
  Candidate: 5.26.2-7
  Version table:
 *** 5.26.2-7 100
        100 /var/lib/dpkg/status
     5.24.1-3+deb9u4 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages
        500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
perl-base:
  Installed: 5.26.2-7
  Candidate: 5.26.2-7
  Version table:
 *** 5.26.2-7 100
        100 /var/lib/dpkg/status
     5.24.1-3+deb9u4 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages
        500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages

如何解决这些依赖问题?

debian apt
  • 3 3 个回答
  • 5116 Views

3 个回答

  • Voted
  1. Best Answer
    Stephen Kitt
    2018-09-24T11:30:34+08:002018-09-24T11:30:34+08:00

    如您的apt policy perl perl-base输出所示,并由jordanm指出,您的系统具有 Perl 的 Buster 版本,而不是 Debian 9 版本。所以你的系统并不是真正的 Debian 9.5 的“全新安装”;并且由于 Perl 是 Debian 设置中如此重要的组件,因此很可能还有许多其他软件包已升级到 Buster 版本。

    这种 Perl 不匹配是您无法安装 MySQL 软件包的原因。

    我假设这是最近安装的,因此您没有太多投资;因此,jordanm建议重新安装可能是这种情况下的最佳解决方案。Debian 9 和 Buster 有很大的不同,因此回滚可能会变得相当复杂,尤其是在您升级 Perl 之后。删除mc肯定是不够的。

    以后不要混用稳定版和测试版。如果您遇到阻止您使用包的错误,请提交错误 ( reportbug mc);如果它足够严重,它可能有资格获得稳定的更新。您也可以要求反向移植;这将为您提供当前的 Buster 版本mc,为 Debian 9 重建。

    • 6
  2. klor
    2018-09-24T12:13:59+08:002018-09-24T12:13:59+08:00

    我根据接受的解决方案成功执行了以下命令:

    wget http://ftp.debian.org/debian/pool/main/p/perl/perl-base_5.24.1-3+deb9u4_amd64.deb
    sudo dpkg -i perl-base*deb
        dpkg: warning: downgrading perl-base from 5.26.2-7 to 5.24.1-3+deb9u4
        (Reading database ... 38749 files and directories currently installed.)
        Preparing to unpack perl-base_5.24.1-3+deb9u4_amd64.deb ...
        Unpacking perl-base (5.24.1-3+deb9u4) over (5.26.2-7) ...
        Setting up perl-base (5.24.1-3+deb9u4) ...
        Processing triggers for man-db (2.7.6.1-2) ...
    sudo apt-get install mysql-server
    sudo apt --fix-broken install
    sudo apt autoremove
    sudo apt-get install mysql-server
        Reading package lists... Done
        Building dependency tree
        Reading state information... Done
        mysql-server is already the newest version (5.5.9999+default).
        0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    

    结果:

    dpkg -l perl-base
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name                                                  Version                         Architecture                    Description
    +++-=====================================================-===============================-===============================-===============================================================================================================
    ii  perl-base                                             5.24.1-3+deb9u4                 amd64                           minimal Perl system
    
    
    dpkg -l mysql-server
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name                                                  Version                         Architecture                    Description
    +++-=====================================================-===============================-===============================-===============================================================================================================
    ii  mysql-server                                          5.5.9999+default                amd64                           MySQL database server binaries and system database setup [transitional]
    
    • 2
  3. THIRUPPATHIRAJA S
    2021-04-03T08:27:53+08:002021-04-03T08:27:53+08:00

    sudo apt install mysql-server 正在读取包列表...完成构建依赖关系树
    读取状态信息...完成某些包无法安装。这可能意味着您请求了一种不可能的情况,或者如果您使用的是不稳定的发行版,一些必需的软件包尚未创建或已从 Incoming 中移出。以下信息可能有助于解决这种情况:

    以下软件包具有未满足的依赖关系: mysql-server :依赖:mysql-server-8.0 但不会安装 E:无法纠正问题,您持有损坏的软件包。raja@raja-latitudee6400:~$ mysql-server default-mysql-server bash: mysql-server: command not found

    • 0

相关问题

  • GRUB 配置以识别同一 Linux 发行版的不同桌面环境(安装)

  • astyle 不会更改源文件格式

  • 接收有关全新 Debian 的电子邮件

  • Debian Stretch:libgs_plugin_systemd-updates.so 中的 gnome-software 段错误

  • 如何在拼音输入法中输入ü?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    ssh 无法协商:“找不到匹配的密码”,正在拒绝 cbc

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    如何卸载内核模块“nvidia-drm”?

    • 13 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add 返回:“连接代理时出错:没有这样的文件或目录” 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve