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
    • 最新
    • 标签
主页 / user-973000

pfnick's questions

Martin Hope
pfnick
Asked: 2019-07-08 09:34:54 +0800 CST

由于依赖问题,无法在 ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-1087-aws x86_64) 上升级软件

  • 0

我在 AWS EC2 t3a.nano 实例上运行 ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-1087-aws x86_64)。当我通过 SSH 访问我的盒子时,我看到了这个:

Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-1087-aws x86_64)

 * Documentation:  [redacted]
 * Management:     [redacted]
 * Support:        [redacted]

  Get cloud support with Ubuntu Advantage Cloud Guest:
    [redacted]

132 packages can be updated.
3 updates are security updates.

为了使我的盒子上的软件保持最新状态,我运行了:

sudo apt-get update
Hit:1 [redacted] xenial InRelease
Hit:2 [redacted] xenial-updates InRelease
Hit:3 http://us-east-2.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease              
Reading package lists... Done

然后我输入:

sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
E: Unmet dependencies. Try using -f.

好的,所以我看到我有依赖问题,所以我尝试:

sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  bzip2 libbz2-1.0
Suggested packages:
  bzip2-doc
The following packages will be upgraded:
  bzip2 libbz2-1.0
2 upgraded, 0 newly installed, 0 to remove and 126 not upgraded.
1 not fully installed or removed.
Need to get 63.2 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 [redacted] xenial-updates/main amd64 bzip2 amd64 1.0.6-8ubuntu0.2 [32.5 kB]
Get:2 [redacted] xenial-updates/main amd64 libbz2-1.0 amd64 1.0.6-8ubuntu0.2 [30.7 kB]
Fetched 63.2 kB in 0s (3,126 kB/s)    
Selecting previously unselected package bzip2.
E: Sub-process /usr/bin/dpkg exited unexpectedly

现在我看到 dpkg 意外退出,我尝试:

sudo dpkg --audit
The following packages are in a mess due to serious problems during
installation.  They must be reinstalled for them (and any packages
that depend on them) to function properly:
 bzip2                high-quality block-sorting file compressor - utilities

我尝试:

sudo apt-get install bzip2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 bzip2 : Depends: libbz2-1.0 (= 1.0.6-8ubuntu0.2) but 1.0.6-8ubuntu0.1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

所以现在我尝试:

sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  bzip2 libbz2-1.0
Suggested packages:
  bzip2-doc
The following packages will be upgraded:
  bzip2 libbz2-1.0
2 upgraded, 0 newly installed, 0 to remove and 126 not upgraded.
1 not fully installed or removed.
Need to get 0 B/63.2 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Selecting previously unselected package bzip2.
E: Sub-process /usr/bin/dpkg exited unexpectedly

现在我要绕圈子了。有任何想法吗?


编辑以解决来自@fkraiem 的评论:当我转到 /etc/apt/sources.list 时,我看到:

## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
##     or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ xenial main restricted
deb-src http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb-src http://us-east-2.ec2.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
[...]

您是否建议我将 us-east-2.ec2.archive.ubuntu.com 替换为 packages.ubuntu.com 并重试更新命令?

upgrade dpkg amazon-ec2 16.04 bzip2
  • 1 个回答
  • 351 Views

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