我收到错误“无法下载存储库信息。请检查您的 Internet 连接。”我该如何修复此问题?

我收到错误“无法下载存储库信息。请检查您的 Internet 连接。”我该如何修复此问题?

由于这个错误,我上个月一直无法更新我的 Ubuntu 16.04 机器。当我点击查看详细信息时,我得到了

W:Target Sources (main/source/Sources) is configured multiple times in
/etc/apt/sources.list.d/gerardpuig-ubuntu-ppa-xenial.list:2 and
/etc/apt/sources.list.d/gerardpuig-ubuntu-ppa-xenial.list:3, 
W:The repository 'cdrom://Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2) xenial Release' does not have a Release file., 
W:Data from such a repository can't be authenticated and is therefore potentially dangerous to use., 
W:See apt-secure(8) manpage for repository creation and user configuration details., 
W:The repository http://ppa.launchpad.net/noobslab/deepin-sc/ubuntu xenial Release' does not have a Release file., 
W:Data from such a repository can't be authenticated and is therefore potentially dangerous to use., 
W:See apt-secure(8) manpage for repository creation and user configuration
details., 
E:Failed to fetch cdrom://Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)/dists/xenial/main/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs, 
E:Failed to fetch http://ppa.launchpad.net/noobslab/deepin-sc/ubuntu/dists/xenial/main/source/Sources 404  Not Found, E:Some index files failed to download. They have been ignored, or old ones used instead.

你能告诉我我可能做错了什么或者我可以做什么来解决这个问题吗?

答案1

我将提供几种解决方案:

  1. 要消除 cdrom 错误,请参阅这里

  2. 对于错误:

    W:Target Sources (main/source/Sources) is configured multiple times in
    /etc/apt/sources.list.d/gerardpuig-ubuntu-ppa-xenial.list:2 and
    /etc/apt/sources.list.d/gerardpuig-ubuntu-ppa-xenial.list:3`
    
      1. 打开/etc/apt/sources.list.d/gerardpuig-ubuntu-ppa-xenial.list并删除该 repo 的重复条目,或者仅#在其中一个条目前面添加。

        sudo nano /etc/apt/sources.list.d/gerardpuig-ubuntu-ppa-xenial.list
        
  3. 修复此错误The repository http://ppa.launchpad.net/noobslab/deepin-sc/ubuntu xenial Release' does not have a Release file.,

      1. 使用以下命令删除 repo:

        sudo add-apt-repository -r ppa:noobslab/deepin-sc
        
  4. sudo apt update之后运行sudo apt dist-upgrade

相关内容