无法使用终端下载/安装任何程序

无法使用终端下载/安装任何程序

每次我想在终端中安装某些东西时都会出现此错误,它从 deluge 开始,然后我看到越来越多的程序无法安装或下载

$ sudo apt-get install firefox
Reader package list ... Done
Creates an overview of addictive relationships
Reading status information ... Done
You already have the latest version of firefox (57.0.1 + build2-0ubuntu0.16.04.1).
You may want to perform "apt-get -f install" to correct these:
The following packages have unrelated addictions:
 linux-image-extra-4.10.0-42-generic: Depends on: linux-image-4.10.0-42-generic but not installed
 linux-image-generic-hwe-16.04: Depends on: linux-image-4.10.0-42-generic but not installed
E: Unrestricted addiction. Try "apt-get -f install" without packages (or set a solution).

是的,我已尝试过apt-get -f install,但没有效果。

$ uname -r
4.10.0-40-generic

$ dpkg -l | grep linux-image
ii  linux-image-4.10.0-38-generic               4.10.0-38.42~16.04.1                                         amd64        Linux kernel image for version 4.10.0 on 64 bit x86 SMP
ii  linux-image-4.10.0-40-generic               4.10.0-40.44~16.04.1                                         amd64        Linux kernel image for version 4.10.0 on 64 bit x86 SMP
ii  linux-image-extra-4.10.0-38-generic         4.10.0-38.42~16.04.1                                         amd64        Linux kernel extra modules for version 4.10.0 on 64 bit x86 SMP
ii  linux-image-extra-4.10.0-40-generic         4.10.0-40.44~16.04.1                                         amd64        Linux kernel extra modules for version 4.10.0 on 64 bit x86 SMP
iU  linux-image-extra-4.10.0-42-generic         4.10.0-42.46~16.04.1                                         amd64        Linux kernel extra modules for version 4.10.0 on 64 bit x86 SMP
iU  linux-image-generic-hwe-16.04               4.10.0.42.44                                                 amd64        Generic Linux kernel image

答案1

使用此命令打开您的源列表:

gksudo gedit /etc/apt/sources.list

在打开的文件中,取消注释(删除#)main、universe 和 multivers 存储库链接。行应该是这样的(例如xubuntu 16.04):

deb http://archive.ubuntu.com/ubuntu/ xenial main universe 
deb-src http://archive.ubuntu.com/ubuntu/ xenial main universe multiverse

之后,保存文件。在终端中运行以下命令:

sudo apt update

然后尝试安装 Firefox 或其他任何东西。

相关内容