当我运行时apt-get update
,我收到错误并忽略:
Ign:14 https://download.docker.com/linux/ubuntu hera InRelease
Hit:15 https://download.docker.com/linux/ubuntu bionic InRelease
Hit:16 http://ppa.launchpad.net/elementary-os/stable/ubuntu bionic InRelease
Err:17 https://download.docker.com/linux/ubuntu hera Release
404 Not Found [IP: 13.226.234.100 443]
我希望能够从我的列表中删除14
和。17
但是,当我运行时ls /etc/apt/sources.list.d
,我只看到以下内容:
appcenter.list mc3man-ubuntu-mpv-tests-bionic.list.save
appcenter.list.save openvpn-aptrepo.list
deadsnakes-ubuntu-ppa-bionic.list openvpn-aptrepo.list.save
deadsnakes-ubuntu-ppa-bionic.list.save patches.list
elementary.list patches.list.save
elementary.list.save rednotebook-ubuntu-stable-bionic.list
fcitx-team-ubuntu-nightly-bionic.list rednotebook-ubuntu-stable-bionic.list.save
fcitx-team-ubuntu-nightly-bionic.list.save slack.list
google-chrome.list slack.list.save
google-chrome.list.save spotify.list
mc3man-ubuntu-mpv-tests-bionic.list spotify.list.save
我怎样才能删除这两个项目?
答案1
我能够通过以下步骤修复它:
- 备份
$ cp /etc/apt/sources.list /etc/apt/sources.list.save
- 找到仓库
$ grep -ir "docker.com" /etc/apt/sources.list deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable # deb-src [arch=amd64] https://download.docker.com/linux/ubuntu focal stable
- 删除无效的仓库
$ sudo add-apt-repository --remove 'deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable'
答案2
您可以使用add-apt-repository
:
sudo add-apt-repository --remove 'deb [arch=amd64] https://download.docker.com/linux/ubuntu hera stable'
sudo add-apt-repository --remove 'deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable'
答案3
我发现存储库存储在sources.list
和中sources.list.save
。要删除它们,我首先运行cd /etc/apt; grep -rI download.docker
找到存储存储库的文件,然后运行:
sudo nano /etc/apt/sources.list
sudo nano /etc/apt/sources.list.save
并删除相应的行。