apt-get install -f 正在删除 ubuntu 17.10 上由 dpkg -i 安装的软件包

apt-get install -f 正在删除 ubuntu 17.10 上由 dpkg -i 安装的软件包

我无法使用 dpkg 和 apt-get 安装 google chrome 或任何 .deb(以及 atom)软件包全新安装 Ubuntu 17.10 桌面版 64 位

$ sudo apt-get update

$ sudo apt-get upgrade

$ sudo apt-get dist-upgrade

$ sudo dpkg -i google-chrome-stable_current_amd64.deb
Selecting previously unselected package google-chrome-stable.
(Reading database ... 160951 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (62.0.3202.94-1) ...
dpkg: dependency problems prevent configuration of google-chrome-stable:
google-chrome-stable depends on gconf-service; however:
Package gconf-service is not installed.
google-chrome-stable depends on libgconf-2-4 (>= 3.2.5); however:
Package libgconf-2-4 is not installed.
google-chrome-stable depends on libappindicator1; however:
Package libappindicator1 is not installed.

dpkg: error processing package google-chrome-stable (--install):
dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.13.3-6ubuntu5) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
   google-chrome-stable

$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
   google-chrome-stable
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 184 MB disk space will be freed.  
Do you want to continue? [Y/n] y
(Reading database ... 161054 files and directories currently installed.)
Removing google-chrome-stable (62.0.3202.94-1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3) ...
Processing triggers for man-db (2.7.6.1-2) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu5) ...

再次 :

$ sudo apt-get update

$ sudo apt-get upgrade

$ sudo apt-get dist-upgrade

我无法解决任何软件包的这个问题。
请帮忙。谢谢!

编辑(2017年12月5日):

对于 Atom

$ sudo dpkg -i atom-amd64.deb 
Selecting previously unselected package atom.
(Reading database ... 160951 files and directories currently installed.)
Preparing to unpack atom-amd64.deb ...
Unpacking atom (1.22.1) ...
dpkg: dependency problems prevent configuration of atom:
 atom depends on git; however:
  Package git is not installed.
 atom depends on gconf2; however:
  Package gconf2 is not installed.
 atom depends on gconf-service; however:
  Package gconf-service is not installed.
 atom depends on python; however:
  Package python is not installed.

dpkg: error processing package atom (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.13.3-6ubuntu5) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Errors were encountered while processing:
 atom

$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  atom
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 459 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 168278 files and directories currently installed.)
Removing atom (1.22.1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu5) ...

哈希总和与 apt-get upate 不匹配

$ sudo apt-get update
Get:2 http://security.ubuntu.com/ubuntu artful-security InRelease [78.6 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu artful-updates InRelease [78.6 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu artful-backports InRelease [72.2 kB] 
Get:1 http://in.archive.ubuntu.com/ubuntu artful InRelease [237 kB]
Get:5 http://in.archive.ubuntu.com/ubuntu artful/main amd64 Packages [1,071 kB]
Get:6 http://in.archive.ubuntu.com/ubuntu artful/main i386 Packages [1,067 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu artful/main Translation-en [542 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu artful/main amd64 DEP-11 Metadata [397 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu artful/main DEP-11 64x64 Icons [263 kB]
Get:10 http://in.archive.ubuntu.com/ubuntu artful/restricted amd64 Packages [8,852 B]
Get:11 http://in.archive.ubuntu.com/ubuntu artful/restricted i386 Packages [8,876 B]
Get:12 http://in.archive.ubuntu.com/ubuntu artful/restricted Translation-en [2,788 B]
Get:13 http://in.archive.ubuntu.com/ubuntu artful/universe i386 Packages [8,066 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu artful/universe amd64 Packages [8,103 kB]
Get:15 http://in.archive.ubuntu.com/ubuntu artful/universe Translation-en [4,789 kB]
Get:16 http://in.archive.ubuntu.com/ubuntu artful/universe amd64 DEP-11 Metadata [2,845 kB]
Get:17 http://in.archive.ubuntu.com/ubuntu artful/universe DEP-11 64x64 Icons [7,915 kB]
Get:18 http://in.archive.ubuntu.com/ubuntu artful/multiverse i386 Packages [143 kB]
Get:18 http://in.archive.ubuntu.com/ubuntu artful/multiverse i386 Packages [143 kB]
Get:18 http://in.archive.ubuntu.com/ubuntu artful/multiverse i386 Packages [143 kB]
Get:18 http://in.archive.ubuntu.com/ubuntu artful/multiverse i386 Packages [143 kB]
Get:18 http://in.archive.ubuntu.com/ubuntu artful/multiverse i386 Packages [143 kB]
Err:18 http://in.archive.ubuntu.com/ubuntu artful/multiverse i386 Packages     
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:142776 [weak]
   - SHA256:d1f9e7ec6489f3540ddd3399c345799e46d2e1213570f510ca41bd12d5b9407e
   - SHA1:16f5314466b815e49a6b53124ba88bd434304b9e [weak]
   - MD5Sum:c7b94987695731eb16b07c5bb0c8311d [weak]
  Hashes of received file:
   - SHA256:8da861b95323d6b98fdcc24324eee84baa90aa6159cf9b7134fe81432639e14e
   - SHA1:9ecda16f6e859d480eacde0b06800c58f7d7a43e [weak]
   - MD5Sum:f8c8486e5ab253cb02209022ff3d0dc1 [weak]
   - Filesize:142776 [weak]
  Last modification reported: Wed, 18 Oct 2017 08:50:51 +0000
  Release file created at: Thu, 19 Oct 2017 12:55:45 +0000
Fetched 609 kB in 5s (114 kB/s)                                
Reading package lists... Done
E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/artful/multiverse/binary-i386/by-hash/SHA256/d1f9e7ec6489f3540ddd3399c345799e46d2e1213570f510ca41bd12d5b9407e  Hash Sum mismatch
   Hashes of expected file:
    - Filesize:142776 [weak]
    - SHA256:d1f9e7ec6489f3540ddd3399c345799e46d2e1213570f510ca41bd12d5b9407e
    - SHA1:16f5314466b815e49a6b53124ba88bd434304b9e [weak]
    - MD5Sum:c7b94987695731eb16b07c5bb0c8311d [weak]
   Hashes of received file:
    - SHA256:8da861b95323d6b98fdcc24324eee84baa90aa6159cf9b7134fe81432639e14e
    - SHA1:9ecda16f6e859d480eacde0b06800c58f7d7a43e [weak]
    - MD5Sum:f8c8486e5ab253cb02209022ff3d0dc1 [weak]
    - Filesize:142776 [weak]
   Last modification reported: Wed, 18 Oct 2017 08:50:51 +0000
   Release file created at: Thu, 19 Oct 2017 12:55:45 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.

甚至 apt-get 也无法安装。

$ sudo apt-get install git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package git is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

解决了

$ sudo apt-get update -o Acquire::CompressionTypes::Order::=gz

https://blog.packagecloud.io/eng/2016/03/21/apt-hash-sum-mismatch/

谢谢

答案1

Dpkg 无法解决依赖关系。每当您想要安装以 .deb 格式打包的应用程序时,该应用程序都不在存储库中。我建议您使用 gdebi。

sudo apt update
sudo apt autoremove
sudo apt clean
sudo apt install --reinstall gdebi

然后从文件浏览器中右键单击并选择使用 gdebi 安装

如果 apt install --reinstall gdebi 给出 E: 无法找到软件包 gdebi,请将 /etc/apt/sources.list 的内容替换为以下内容,然后重试安装 gdebi

deb http://us.archive.ubuntu.com/ubuntu/ artful main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ artful main restricted
deb http://us.archive.ubuntu.com/ubuntu/ artful-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ artful-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ artful universe
deb-src http://us.archive.ubuntu.com/ubuntu/ artful universe
deb http://us.archive.ubuntu.com/ubuntu/ artful-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ artful-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ artful multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ artful multiverse
deb http://us.archive.ubuntu.com/ubuntu/ artful-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ artful-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ artful-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ artful-backports main restricted universe multiverse
deb http://uschive.canonical.com/ubuntu artful partner
deb-src http://uschive.canonical.com/ubuntu artful partner
deb http://security.ubuntu.com/ubuntu artful-security main restricted
deb-src http://security.ubuntu.com/ubuntu artful-security main restricted
deb http://security.ubuntu.com/ubuntu artful-security universe
deb-src http://security.ubuntu.com/ubuntu artful-security universe
deb http://security.ubuntu.com/ubuntu artful-security multiverse
deb-src http://security.ubuntu.com/ubuntu artful-security multiverse
deb http://us.archive.ubuntu.com/ubuntu/ artful-proposed restricted universe multiverse main

答案2

尝试“sudo apt-get autoremove”、“sudo apt-get clean”和“sudo apt-get autoclean”,然后重试您正在实现的过程。

答案3

哈希和不匹配错误有一个很好的答案由于“哈希值不匹配”错误,无法下载软件包列表

如果只有少数文件的哈希值不匹配,则可以使第一个命令更加具体。基本步骤是运行以下代码块:

sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update
sudo apt-get upgrade

如果安装 Chrome 时仍然存在问题,如何安装 Google Chrome可能会有帮助。

相关内容