当我运行命令 sudo apt-get update 时,我发现 ubuntu 16.04 LTS 上出现错误

当我运行命令 sudo apt-get update 时,我发现 ubuntu 16.04 LTS 上出现错误
yugasalabs-26@yugasalabs-26:~$ sudo apt-get update
[sudo] password for yugasalabs-26: 

Fetched 94.5 kB in 1s (61.3 kB/s)                  
Reading package lists... Done
W: Target Packages (partner/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Target Packages (partner/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Target Packages (partner/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Target Translations (partner/i18n/Translation-en_IN) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Target Translations (partner/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Target DEP-11 (partner/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Target DEP-11-icons (partner/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Can't drop privileges for downloading as file '/var/lib/apt/lists/partial/in.archive.ubuntu.com_ubuntu_dists_xenial_InRelease' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
W: Target Packages (partner/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Target Packages (partner/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Target Packages (partner/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Target Translations (partner/i18n/Translation-en_IN) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Target Translations (partner/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Target DEP-11 (partner/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2
W: Target DEP-11-icons (partner/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/canonical_partner.list:1 and /etc/apt/sources.list.d/canonical_partner.list:2

答案1

检查 的内容/etc/apt/sources.list.d/canonical-partners.list是否也存在于 中/etc/apt/sources.list。如果是,请删除 中的双线/etc/apt/sources.list或删除该canonical-partner.list文件。第二种方法可能更简单。

sudo rm /etc/apt/sources.list.d/canonical_partner.list

答案2

您的文件 /etc/apt/sources.list.d/canonical_partner.list 有两次配置相同的存储库。

您可以编辑文件并删除重复的行(文件的第二行)或者通过删除/取消选中它们来删除此引用以便在图形模式下使用。

编辑文件以删除重复的存储库

  1. 打开终端:ctrl++altt
  2. sudo gedit /etc/apt/sources.list.d/canonical_partner.list
  3. 删除重复的行(文件的第二行)。
  4. 使用菜单保存文件:文件>节省
  5. 关闭编辑
  6. 现在您可以sudo apt-get update再次在终端中尝试。

在图形模式下禁用/删除重复的存储库

  1. 在侧面菜单中,点击系统设置
  2. 在里面系统车道,点击进入软件与更新
  3. 导航其他软件标签。
  4. 找到重复的存储库并取消选中或删除其中一个。
  5. 点击进入关闭
  6. 点击进入重新加载
  7. 重新加载本身就相当于sudo apt-get update。如果一切顺利,您可以随时再次更新!

相关内容