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裏面有這個, 屏蔽了即可.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章