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 / 问题 / 1538727
Accepted
Anton Samokat
Anton Samokat
Asked: 2025-01-21 00:57:08 +0800 CST2025-01-21 00:57:08 +0800 CST 2025-01-21 00:57:08 +0800 CST

如何恢复降级的软件包?(如何取消/回滚软件包降级?)

  • 772

我尝试安装libmagick++-dev(相关问题:如何在 Ubuntu 20.04 上安装 libmagick++-dev?)。但它需要降级几个软件包。我已经恢复了其中几个。但事实证明,其余需要降级的软件包需要删除太多已安装的软件包。我决定不这样做。现在我想恢复已安装软件包的先前版本。我该怎么做?

我的尝试记录如下:

sudo apt install libmagick++-dev 
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:
 libmagick++-dev : Depends: imagemagick-6-common (= 8:6.9.10.23+dfsg-2.1ubuntu11) but 8:6.9.10.23+dfsg-2.1ubuntu11.10 is to be installed
                   Depends: libmagick++-6.q16-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

------

$ sudo apt install imagemagick-6-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
imagemagick-6-common is already the newest version (8:6.9.10.23+dfsg-2.1ubuntu11.10).
imagemagick-6-common set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.

------

$ sudo apt install imagemagick-6-common=8:6.9.10.23+dfsg-2.1ubuntu11
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  libimage-magick-perl
The following packages will be DOWNGRADED:
  imagemagick-6-common
0 upgraded, 0 newly installed, 1 downgraded, 1 to remove and 15 not upgraded.
Need to get 60,8 kB of archives.
After this operation, 102 kB disk space will be freed.
Do you want to continue? [Y/n] 

Get:1 http://archive.ubuntu.com/ubuntu focal/universe amd64 imagemagick-6-common all 8:6.9.10.23+dfsg-2.1ubuntu11 [60,8 kB]
Fetched 60,8 kB in 1s (82,4 kB/s)               
(Reading database ... 365848 files and directories currently installed.)
Removing libimage-magick-perl (8:6.9.10.23+dfsg-2.1ubuntu11.10) ...
dpkg: warning: downgrading imagemagick-6-common from 8:6.9.10.23+dfsg-2.1ubuntu11.10 to 8:6.9.10.23+dfsg-2.1ubuntu11
(Reading database ... 365814 files and directories currently installed.)
Preparing to unpack .../imagemagick-6-common_8%3a6.9.10.23+dfsg-2.1ubuntu11_all.deb ...
Unpacking imagemagick-6-common (8:6.9.10.23+dfsg-2.1ubuntu11) over (8:6.9.10.23+dfsg-2.1ubuntu11.10) ...
Setting up imagemagick-6-common (8:6.9.10.23+dfsg-2.1ubuntu11) ...
Installing new version of config file /etc/ImageMagick-6/delegates.xml ...
Processing triggers for man-db (2.9.1-1) ...

----

Reverting is not working:

sudo apt install imagemagick-6-common=8:6.9.10.23+dfsg-2.1ubuntu11.10
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '8:6.9.10.23+dfsg-2.1ubuntu11.10' for 'imagemagick-6-common' was not found

apt list imagemagick-6-common
Listing... Done
imagemagick-6-common/focal,focal,now 8:6.9.10.23+dfsg-2.1ubuntu11 all [installed]

apt-cache madison imagemagick-6-common  # list all versions of a package
imagemagick-6-common | 8:6.9.10.23+dfsg-2.1ubuntu11 | http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
imagemagick-6-common | 8:6.9.10.23+dfsg-2.1ubuntu11 | http://archive.ubuntu.com/ubuntu focal/universe i386 Packages

apt policy  imagemagick-6-common
imagemagick-6-common:
  Installed: 8:6.9.10.23+dfsg-2.1ubuntu11
  Candidate: 8:6.9.10.23+dfsg-2.1ubuntu11
  Version table:
 *** 8:6.9.10.23+dfsg-2.1ubuntu11 500
        500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu focal/universe i386 Packages
        100 /var/lib/dpkg/status

由于某种原因,软件包的先前版本imagemagick-6-common=8:6.9.10.23+dfsg-2.1ubuntu11.10在软件包管理系统中不可用。如何恢复?

apt
  • 1 1 个回答
  • 36 Views

1 个回答

  • Voted
  1. Best Answer
    Anton Samokat
    2025-01-25T06:14:07+08:002025-01-25T06:14:07+08:00

    通常情况下恢复降级的包sudo apt install package-name就可以使用。

    我在 apt 源方面遇到了问题。我忘记设置 Debian 源而不是 Ubuntu apt 源。并且还有其他版本的软件包。有关相关问题“如何在 Ubuntu 20.04 上安装 libmagick++-dev?”的答案中提供了详细信息。

    • 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