Ubuntu執(zhí)行sudo apt-get update報(bào)錯(cuò)E: Failed to fetch https://mirrors.aliyun.com/docker-ce/linux/ubuntu/dists/xenial/InRelease Unable to find expected entry ‘stable/source/Sources’ in Release file (Wrong sources.list entry or malformed file)
報(bào)錯(cuò)內(nèi)容:
E: Failed to fetch https://mirrors.aliyun.com/docker-ce/linux/ubuntu/dists/xenial/InRelease Unable to find expected entry 'stable/source/Sources' in Release file (Wrong sources.list entry or malformed file)
W: Failed to fetch https://pkg.jenkins.io/debian-stable/binary/InRelease Could not resolve host: pkg.jenkins.io
W: Some index files failed to download. They have been ignored, or old ones used instead.
報(bào)錯(cuò)原因:
# 這個(gè)錯(cuò)誤可能是由于源列表文件(/etc/apt/sources.list)中的條目不正確或文件格式不正確。
# 可以嘗試使用以下命令備份源列表文件并創(chuàng)建一個(gè)新的源列表文件:
解決辦法:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo nano /etc/apt/sources.list
# 在編輯器中打開源列表文件后,將內(nèi)容替換為以下內(nèi)容(適用于 Ubuntu 16.04,根據(jù)版本自查源地址):
# 阿里云鏡像源:
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
deb https://pkg.jenkins.io/debian-stable binary/
# 清華大學(xué)鏡像源:
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
deb https://pkg.jenkins.io/debian-stable binary/
# 將其中之一添加到 `/etc/apt/sources.list` 文件中,
# 保存后運(yùn)行 `sudo apt-get clean' 'sudo apt-get update` 命令,應(yīng)該可以成功更新索引文件
sudo apt-get clean
sudo apt-get update
補(bǔ)充:文章來源:http://www.zghlxwxcb.cn/news/detail-761134.html
如果還是沒有辦法解決問題,請(qǐng)按照下面步驟操作一遍文章來源地址http://www.zghlxwxcb.cn/news/detail-761134.html
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get clean
sudo apt-get update
到了這里,關(guān)于Ubuntu執(zhí)行sudo apt-get update報(bào)錯(cuò)E: Failed to fetch https://mirrors.aliyun.com/docker-ce/linux/ubuntu/di的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!