更新、安装应用程序或升级时出错

更新、安装应用程序或升级时出错

我正在使用 Ubuntu 16.04.2。几天前,我无法成功更新或升级。每当我执行更新或 dist-upgrade 命令时,我都会收到错误。

如果我尝试安装新的应用程序,我会收到一条错误消息,提示无法验证软件包。

(例如,我刚刚删除并尝试再次安装 gnome-tweak-tool。)

在此处输入图片描述

在此处输入图片描述

正如 AskUbuntu 帖子中提到的那样,执行时dpkg --get-selections | grep hold不会显示任何内容。

编辑:

我的 sources.list 文件的条目

deb http://old-releases.ubuntu.com/ubuntu xenial main restricted
universe multiverse deb http://old-releases.ubuntu.com/ubuntu
xenial-updates main restricted universe multiverse deb
http://old-releases.ubuntu.com/ubuntu xenial-backports main restricted
universe multiverse

deb http://archive.canonical.com/ubuntu xenial partner deb-src
http://archive.canonical.com/ubuntu xenial partner

deb http://old-releases.ubuntu.com/ubuntu xenial-security main
restricted universe multiverse

deb https://cli-assets.heroku.com/branches/stable/apt ./

deb http://liveusb.info/multisystem/depot all main deb
[arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/

deb http://archive.ubuntu.com/ubuntu xenial main universe deb
http://security.ubuntu.com/ubuntu/ xenial-security universe main deb
http://archive.ubuntu.com/ubuntu xenial-updates universe main

答案1

您正在运行xeinal但使用了错误的存储库源。实际上,似乎您sources.list设置为使用不包含xenial软件包等的旧版本。

尝试运行:

sudo sed -i s/old-releases/archive/ /etc/apt/sources.list

另外,如果存在的话/etc/apt/sources.list,也删除额外的存储库。/etc/apt/sources.list.d/

然后运行:

sudo apt update

如果不起作用:

首先创建文件备份sources.list,运行:

sudo cp /etc/apt/sources.list{,.bk}

然后运行下面的命令来清除它:

    echo | sudo tee /etc/apt/sources.list

然后使用编辑器和 root 权限打开它:

sudo nano /etc/apt/sources.list

然后添加如下代码进去:

###### Ubuntu Main Repos
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse 

最后,保存文件并更新您的源:

sudo apt-get update

答案2

好的,我已经解决了这个问题。我发现网站。我填写了它要求的详细信息,然后它为我生成了 sources.list 文件内容。我能够毫无问题地安装和更新软件。

我仍然会收到一些 DEP-11 元数据图标存储库的错误,提示权限被拒绝。但是,“无法验证包的问题”已经解决。

相关内容