问题
执行这个命令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源里面找到对应的, 文件然后注释即可.
代码语言:javascript复制$ 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里面有这个, 屏蔽了即可.