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 / 问题

问题[bzip2](ubuntu)

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
Martin Hope
Jesus Ruiz Guirado
Asked: 2019-05-11 02:14:09 +0800 CST

压缩文件前端的问题

  • 1

我需要为压缩文件做一个前端,这个想法是如果你收到一个 gz 或 bz2 文件,用 gunzip 和 bunzip2 解压缩它。

如果您收到的是 tar.gz 或 tar.b2,您应该使用 tar xzf 或 xjf 解压并解压缩一次。我的代码如下

#!/bin/bash

if test $# -ne 1
then
    echo "Numero de parametros incorrecto"
    echo "Uso del programa: $0 archivo"
    exit 1;
fi

case "$1" in
    *.gz)
        echo "gzip"
        echo "Descomprimiendo"
        `gunzip $1`
    ;;
    *.bz2)
        echo "bzip2"
        echo "Descomprimiendo"
        `bunzip2 $1`
    ;;
    *.tar.gz)
        `tar xzvf $1`
    ;;
    *.bzip2.gz)
        `tar xjvf $1`
    ;;
esac

问题是,即使我传递了一个扩展名为 .tar.gz 的文件,我输入了案例的第一个条件,我试图添加美元以严格限制它以这样的方式结束,但它不起作用

bash gzip compression tar bzip2
  • 1 个回答
  • 53 Views
Martin Hope
Mohammad Kholghi
Asked: 2018-12-19 22:48:11 +0800 CST

gzip 2 个文件为一个文件

  • 10

我想将两个或多个文件压缩到一个文件中,我检查了这个和这个,但两者都有类似的文件:n1.txt,,n2.txt......但我的文件名完全不同,比如:,,file.mp4我想将它们全部压缩并放置输出到一个文件中。这也没有帮助:bar.txtfoo.jpeg

gzip -c file.mp4 > test.gz
gzip -c bar.txt >> test.gz

我必须先将它们焦油吗?

还有一个问题:在 tar 文件中,我们可以在不解压的情况下观看内部文件:

tar -tvf filename.tar

无论如何用gzip或bzip2来做到这一点?

command-line gzip tar bzip2
  • 2 个回答
  • 15193 Views
Martin Hope
Tendero
Asked: 2018-09-04 13:52:41 +0800 CST

为什么 cmake 找不到已安装的软件包?

  • 2

我正在尝试为在 CUDA 中实现的神经网络构建这个 repo。

我已按照该链接中的说明在外壳上执行了以下操作:

git clone https://github.com/ANNetGPGPU/ANNetGPGPU.git
cd ANNetGPGPU
mkdir build
cd build
cmake .. && make

但是,当我写最后一行时,返回以下错误:

CMake Error at /home/iibm/Documents/martins/cmake-3.12.1-Linux-x86_64/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
Call Stack (most recent call first):
  /home/iibm/Documents/martins/cmake-3.12.1-Linux-x86_64/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /home/iibm/Documents/martins/cmake-3.12.1-Linux-x86_64/share/cmake-3.12/Modules/FindBZip2.cmake:62 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:7 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
See also "/home/iibm/Documents/martins/ANNetGPGPU/build/CMakeFiles/CMakeOutput.log".

但 bzip2 肯定已安装,bzip2 --version返回:

bzip2, a block-sorting file compressor.  Version 1.0.6, 6-Sept-2010.

   Copyright (C) 1996-2010 by Julian Seward.

那么我该如何解决这个问题,为什么会这样呢?

package-management makefile make cmake bzip2
  • 1 个回答
  • 7244 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