软件包的“dev”版本不可用,但被另一个软件包引用

软件包的“dev”版本不可用,但被另一个软件包引用

我是 Ubuntu 的新手,经常遇到这样的错误:

Package libpng12-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
However the following packages replace it: libpng12-0

E: Unable to locate package subversion
E: Package 'git-core' has no installation candidate
E: Package 'build-essential' has no installation candidate
E: Package 'autoconf' has no installation candidate
E: Package 'libtool' has no installation candidate
E: Unable to locate package libxml2-dev
E: Unable to locate package libgeos-dev
E: Unable to locate package libpq-dev
E: Unable to locate package libbz2-dev
E: Package 'proj' has no installation candidate
E: Unable to locate package munin-node
E: Unable to locate package munin
E: Unable to locate package libprotobuf-c0-dev
E: Unable to locate package protobuf-c-compiler
E: Unable to locate package libfreetype6-dev
E: Package 'libpng12-dev' has no installation candidate
E: Unable to locate package libtiff4-dev
E: Unable to locate package libicu-dev
E: Unable to locate package libboost-all-dev
E: Unable to locate package libgdal-dev
E: Unable to locate package libcairo-dev
E: Unable to locate package libcairomm-1.0-dev
E: Couldn't find any package by regex 'libcairomm-1.0-dev'
E: Unable to locate package apache2
E: Unable to locate package apache2-dev
E: Unable to locate package libagg-dev

当我想这样做的时候:

sudo apt-get install subversion git-core tar unzip wget bzip2 build-essential autoconf libtool libxml2-dev libgeos-dev libpq-dev libbz2-dev proj munin-node munin libprotobuf-c0-dev protobuf-c-compiler libfreetype6-dev libpng12-dev libtiff4-dev libicu-dev libboost-all-dev libgdal-dev libcairo-dev libcairomm-1.0-dev apache2 apache2-dev libagg-dev

我该如何解决这个问题?

答案1

哇哦,你一下子安装了这么多软件包!我猜你是在按照指南来设置某些特定的东西,比如 Apache 服务器?

有两件事可能会发生,或者同时发生:

  1. 您的软件包列表已过时,只需刷新即可。简单修复:

    sudo apt-get update
    

    然后再次尝试安装。

  2. 更可能的是,Ubuntu 有这些软件包的更多特定版本可用,但不知道根据您输入的名称来安装它们。如果您愿意花几分钟时间,我会使用以下命令安装 Synaptic,这是一个图形化软件包管理器:

    sudo apt-get install synaptic
    

    Synaptic 允许您按名称搜索软件包,并允许您选择要安装的版本(如果有多个可用)。启动 Synaptic,让它花点时间建立搜索索引(程序中的搜索栏会告诉您发生了什么),然后尝试一次查找一个软件包。找到所需的软件包后,单击其复选框,然后选择标记安装

    您选择的某些软件包将需要您安装依赖项;这没问题。您甚至可能会发现,您试图在命令行上安装的某些软件包会自动为您选择,因为您选择的软件包之一依赖于它。

如果您决定采用突触路线,请从包开始apache2,因为它将具有许多依赖项。

选择了要安装的所有内容后,点击申请按钮,让 Synaptic 完成工作。祝你好运!

相关内容