Ubuntu 16.4 "W: The repository does not have a Release file." 解决方法

问题

执行这个命令sudo apt-get update, 会遇到如下提示

W: The repository 'https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial Release' does not have a Release file.

解决

直接在apt源里面找到对应的, 文件然后注释即可.

$ sudo grep -rwn docker /etc/apt/ 
Binary file /etc/apt/trusted.gpg matches
/etc/apt/sources.list_bak:56:deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial stable
/etc/apt/sources.list_bak:57:# deb-src [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial stable
/etc/apt/sources.list:56:deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial stable
/etc/apt/sources.list:57:# deb-src [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial stable
Binary file /etc/apt/trusted.gpg~ matches
/etc/apt/sources.list.save:56:deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial stable
/etc/apt/sources.list.save:57:# deb-src [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial stable

注释掉对于的行数即可. 前面加上# pound key.

# deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu xenial stable

然后在执行 sudo apt-get update

Reading package lists... Done

小结

遇到类似的问题, 直接就是找到对应的source.list里面有这个, 屏蔽了即可.

你可能感兴趣的:(Linux)