【问题标题】:Undo apt-get remove open* ubuntu 12.04撤消 apt-get remove open* ubuntu 12.04
【发布时间】:2014-04-02 12:53:50
【问题描述】:

我在 ec2 上运行 Linux 实例,图像的快照排序已禁用。

尝试从系统中卸载 open-jdk 时。我愚蠢地运行命令

sudo apt-get remove open*

它开始删除许多包,所以我按 CTRL + c 停止了该过程。

我做了两次:

  • sudo apt-get remove open*
  • sudo apt-get remove openjdk*

我在它们之间停止了进程(CTRL + c)。

现在我看到我的其他应用程序无法运行,因为已删除了软件包。

请指教,我怎样才能回到 apt-get remove 之前的状态。

提前致谢。

【问题讨论】:

    标签: linux ubuntu amazon-ec2


    【解决方案1】:

    在使用日志文件时,您也许还可以“手动”撤消,但在花费数小时之前,有一个值得尝试的操作:apt-get -f install
    编辑:来自 debian 的手册页:

      -f, --fix-broken
          Fix; attempt to correct a system with broken dependencies in place. This option, when used with install/remove, can omit any packages to permit APT to deduce a
          likely solution. If packages are specified, these have to completely correct the problem. The option is sometimes necessary when running APT for the first time; APT
          itself does not allow broken package dependencies to exist on a system. It is possible that a system's dependency structure can be so corrupt as to require manual
          intervention (which usually means using dselect(1) or dpkg --remove to eliminate some of the offending packages). Use of this option together with -m may produce an
          error in some situations. Configuration Item: APT::Get::Fix-Broken.
    

    【讨论】:

    • 我运行上面的 methioned 命令,我得到了这个输出“正在读取包列表...完成构建依赖关系树读取状态信息...完成 0 升级,0 新安装,0 删除和 68 不升级了。”但什么也没发生,我仍然处于同样的状态。
    • @user2058780 嗯,那么请提供一个由于删除而失败的示例。是不是你不是通过 apt 安装的?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-17
    • 2013-09-27
    • 2017-08-21
    相关资源
    最近更新 更多