从 20.04 LTS 升级到 22.04 后,我的 etc/apt/sources 似乎出了问题。执行此操作时,sudo apt-get update
我得到了一整串错误。我在 Google 上搜索过,但没有发现 ubuntu 22.04 有此错误,只有较旧的版本或只有一行。
我确实尝试了我发现的一件事,但是这在有关 cd-rom 的更新中产生了一个错误:
sudo sed -i -- 's/#deb-src/deb-src/g' /etc/apt/sources.list && sudo sed -i -- 's/# deb-src/deb-src/g' /etc/apt/sources.list
在尝试了各种方法之后,CD-ROM 错误消失了,但我认为询问总比尝试和进一步搞砸要好。
更新回应:这个有太多的 URL 并且看起来像垃圾邮件...希望下面的信息足够。
发布:
kornelis@Aspire7:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
kornelis@Aspire7:~$
/etc/apt/sources.list
:
# See http ://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://nl.archive.ubuntu.com/ubuntu/ jammy main restricted
## Major bug fix updates produced after the final release of the
## distribution.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://nl.archive.ubuntu.com/ubuntu/ jammy universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://nl.archive.ubuntu.com/ubuntu/ jammy multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://security.ubuntu.com/ubuntu jammy-security main restricted
deb http://security.ubuntu.com/ubuntu jammy-security universe
deb http://security.ubuntu.com/ubuntu jammy-security multiverse
deb http://archive.ubuntu.com/ubuntu jammy main restricted # auto generated by ubuntu-release-upgrader
deb http://archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse # auto generated by ubuntu-release-upgrader
deb http://security.ubuntu.com/ubuntu jammy-security main restricted # auto generated by ubuntu-release-upgrader
答案1
http
第 3 行应为:(删除和之间的空格://
)
deb http://nl.archive.ubuntu.com/ubuntu/ jammy main restricted
http:
最后 6 行应如下所示:(删除和之间的空格//
)
deb http://security.ubuntu.com/ubuntu jammy-security main restricted
deb http://security.ubuntu.com/ubuntu jammy-security universe
deb http://security.ubuntu.com/ubuntu jammy-security multiverse
deb http://archive.ubuntu.com/ubuntu jammy main restricted # auto generated by ubuntu-release-upgrader
deb http://archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse # auto generated by ubuntu-release-upgrader
deb http://security.ubuntu.com/ubuntu jammy-security main restricted # auto generated