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
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1525183
Accepted
Thystra
Thystra
Asked: 2024-09-02 02:36:38 +0800 CST2024-09-02 02:36:38 +0800 CST 2024-09-02 02:36:38 +0800 CST

APT依赖问题

  • 772

我正在尝试安装依赖项来编译 Strongswan,因为主要软件包似乎已损坏。

当我尝试安装 libsoup 包时,出现以下错误:

~/strongswan-5.9.14# apt install -f libsoup2.4-dev
Reading package lists... Done
Building dependency tree... Done
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:
 libbrotli-dev : Depends: libbrotli1 (= 1.1.0-2build2) but 1.1.0-2+ubuntu22.04.1+deb.sury.org+1 is to be installed

这是在服务器安装上,最近升级到 24.04.1 LTS。

更新:包裹信息

# apt policy libbrotli1
libbrotli1:
  Installed: 1.1.0-2+ubuntu22.04.1+deb.sury.org+1
  Candidate: 1.1.0-2+ubuntu22.04.1+deb.sury.org+1
  Version table:
 *** 1.1.0-2+ubuntu22.04.1+deb.sury.org+1 100
        100 /var/lib/dpkg/status
     1.1.0-2build2 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages

# apt-get remove libbrotli1
Reading package lists... Done
Building dependency tree... Done
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:
 shim-signed : Depends: grub-efi-amd64-signed (>= 1.191~) but it is not going to be installed or
                        grub-efi-arm64-signed (>= 1.191~) but it is not installable or
                        base-files (< 12.3) but 13ubuntu10.1 is to be installed
               Depends: grub-efi-amd64-signed (>= 1.187.2~) but it is not going to be installed or
                        grub-efi-arm64-signed (>= 1.187.2~) but it is not installable
               Depends: grub2-common (>= 2.04-1ubuntu24) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

我看到安装的软件包来自 ppa,并且 repos 中有一个软件包。在不破坏所有内容的情况下,删除并重新安装 repo 软件包的最佳/安全方法是什么?

apt
  • 1 1 个回答
  • 38 Views

1 个回答

  • Voted
  1. Best Answer
    Thystra
    2024-09-03T03:30:35+08:002024-09-03T03:30:35+08:00

    为了解决这个问题,我改变了 repo 的 pin 优先级:

    在 /etc/apt/preferences.d 中我创建了一个文件 lib.pref

    Package: *
    Pin: origin archive.ubuntu.com
    Pin-Priority: 1001
    

    运行后 apt update, apt policy libbrotli1现在显示:

    apt policy libbrotli1
    libbrotli1:
      Installed: 1.1.0-2+ubuntu22.04.1+deb.sury.org+1
      Candidate: 1.1.0-2build2
      Version table:
     *** 1.1.0-2+ubuntu22.04.1+deb.sury.org+1 100
            100 /var/lib/dpkg/status
         1.1.0-2build2 1001
           1001 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
    

    然后我就可以重新安装该软件包。

     apt reinstall libbrotli1
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following packages will be DOWNGRADED:
      libbrotli1
    0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
    Need to get 331 kB of archives.
    After this operation, 3072 B of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 http://archive.ubuntu.com/ubuntu noble/main amd64 libbrotli1 amd64 1.1.0-2build2 [331 kB]
    Fetched 331 kB in 0s (679 kB/s)    
    dpkg: warning: downgrading libbrotli1:amd64 from 1.1.0-2+ubuntu22.04.1+deb.sury.org+1 to 1.1.0-2build2
    (Reading database ... 119664 files and directories currently installed.)
    Preparing to unpack .../libbrotli1_1.1.0-2build2_amd64.deb ...
    Unpacking libbrotli1:amd64 (1.1.0-2build2) over (1.1.0-2+ubuntu22.04.1+deb.sury.org+1) ...
    Setting up libbrotli1:amd64 (1.1.0-2build2) ...
    Processing triggers for libc-bin (2.39-0ubuntu8.3) ...
    Scanning processes...                                                                                                                                    
    Scanning candidates...                                                                                                                                   
    Scanning linux images...                                                                                                                                 
    
    Running kernel seems to be up-to-date.
    
    Restarting services...
     systemctl restart clamav-freshclam.service packagekit.service php8.3-fpm.service sogo.service
    
    No containers need to be restarted.
    
    No user sessions are running outdated binaries.
    
    No VM guests are running outdated hypervisor (qemu) binaries on this host.
    

    然后我就可以毫无问题地安装依赖项。

    我注释掉了 lib.pref 中的条目,以免搞乱将来的事情,但如果有另一个包需要从 22.04 ppa 升级,它就在那里。

    • 0

相关问题

  • 如何编写 shell 脚本来安装应用程序列表?

  • 如何查看存档中可用的软件包的所有版本?

  • 是否可以说出我安装的哪些软件包不在原版安装中?

  • 如何删除 PPA?

  • 使用 apt-get upgrade 时如何强制安装内核更新?

Sidebar

Stats

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

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve