在 Ubuntu Studio 22.10 和 22.04.1 LTS 中,每次我运行 apt,尤其是 apt update,我都会发现它一直在寻找一个在 /etc/apt/ 目录或其中的文件中不存在的源。起初这只是一个令人费解的烦恼,但现在 Ubuntu Studio Discovery 的打开延迟了 3 分钟,显然是在寻找相同的源。
$ sudo apt update
Hit:1 http://us.archive.ubuntu.com/ubuntu kinetic InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu kinetic-updates InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu kinetic-backports InRelease [99.9 kB]
Hit:4 http://security.ubuntu.com/ubuntu kinetic-security InRelease
Ign:5 http://archive.canonical.com/ubuntu kinetic InRelease
Err:6 http://archive.canonical.com/ubuntu kinetic Release <<---!!
404 Not Found [IP: 2620:2d:4000:1003::111 80]
Hit:7 https://ppa.launchpadcontent.net/tatokis/alarm-clock-applet/ubuntu kinetic InRelease
Reading package lists... Done
E: The repository 'http://archive.canonical.com/ubuntu kinetic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
我尝试了 sudo ppa-purge 和 sudo apt-get install ppa-purge 的各种建议,并收到结果表明它们失败了,因为它们找不到要清除的包。
检查“软件源”时,我发现此源未列在任何选项卡下。然后我查看了 /etc/apt/ 中的每个目录和文件,再次没有发现此“http://archive.canonical.com/ubuntu kinetic Release”的迹象
因此问题是“apt 在哪里找到寻找这个的指令?”和“我如何删除它,以便 apt 不再继续寻找它?”
下面是我搜索的目录和文件的日志,以确认“http://archive.canonical.com/ubuntu kinetic Release”未在 Ubuntu 源或 /etc/apt/ 中列出。
apt sources.list 的内容
$ inxi -r
Repos:
Active apt repos in: /etc/apt/sources.list
1: deb http://us.archive.ubuntu.com/ubuntu/ kinetic main restricted
2: deb http://us.archive.ubuntu.com/ubuntu/ kinetic-updates main restricted
3: deb http://us.archive.ubuntu.com/ubuntu/ kinetic universe
4: deb http://us.archive.ubuntu.com/ubuntu/ kinetic-updates universe
5: deb http://us.archive.ubuntu.com/ubuntu/ kinetic multiverse
6: deb http://us.archive.ubuntu.com/ubuntu/ kinetic-updates multiverse
7: deb http://security.ubuntu.com/ubuntu/ kinetic-security main restricted
8: deb http://security.ubuntu.com/ubuntu/ kinetic-security universe
9: deb http://security.ubuntu.com/ubuntu/ kinetic-security multiverse
10: deb http://us.archive.ubuntu.com/ubuntu/ kinetic-backports main restricted universe multiverse
11: deb http://archive.canonical.com/ubuntu/ kinetic partner
Active apt repos in: /etc/apt/sources.list.d/tatokis-ubuntu-alarm-clock-applet-kinetic.list
1: deb https://ppa.launchpadcontent.net/tatokis/alarm-clock-applet/ubuntu/ kinetic main
我在 /etc/apt/ 和子目录中搜索http://archive.canonical.com/ubuntu动能释放
g905:/etc/apt$ ls
apt.conf.d keyrings sources.list sources.list.d trusted.gpg.d
auth.conf.d preferences.d sources.list~ trusted.gpg
g905:/etc/apt$ cd trusted.gpg.d
g905:/etc/apt/trusted.gpg.d$ ls
tatokis-ubuntu-alarm-clock-applet.gpg ubuntu-keyring-2012-cdimage.gpg
tatokis-ubuntu-alarm-clock-applet.gpg~ ubuntu-keyring-2018-archive.gpg
g905:/etc/apt/trusted.gpg.d$ cd ..
g905:/etc/apt$ ls
apt.conf.d keyrings sources.list sources.list.d trusted.gpg.d
auth.conf.d preferences.d sources.list~ trusted.gpg
g905:/etc/apt$ cd sources.list.d
g905:/etc/apt/sources.list.d$ ls
tatokis-ubuntu-alarm-clock-applet-kinetic.list
g905:/etc/apt/sources.list.d$ cd ..
g905:/etc/apt$ cd apt.conf.d
g905:/etc/apt/apt.conf.d$ ls
01autoremove 20archive 50appstream 60icons-large 99update-notifier
01-vendor-ubuntu 20auto-upgrades 50command-not-found 60icons-large-hidpi
10periodic 20dbus 50unattended-upgrades 70debconf
15update-stamp 20packagekit 60icons 88libdvdcss-pkg
20apt-esm-hook.conf 20snapd.conf 60icons-hidpi 99synaptic
g905:/etc/apt/apt.conf.d$ cd ..
g905:/etc/apt$ cd auth.conf.d
g905:/etc/apt/auth.conf.d$ ls [Empty]
g905:/etc/apt/auth.conf.d$ cd ..
g905:/etc/apt$ cd preferences.d
g905:/etc/apt/preferences.d$ ls [Empty]
g905:/etc/apt/preferences.d$ cd ..
再次明确一下;它还能在哪里?如果不仅仅是删除文件夹或文件,我该如何删除它。
Platform details
Operating System: Ubuntu Studio 22.10
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0 Qt Version: 5.15.6
Kernel Version: 5.19.0-1018-lowlatency (64-bit)
Graphics Platform: X11
Processors: 24 × AMD Ryzen 9 7900X 12-Core Processor
Memory: 31.1 GiB of RAM
Graphics Processor: llvmpipe
Manufacturer: MicroElectronics Product Name: G905 System Version: 1.0
答案1
/etc/apt/sources.list
导致问题的是第 11 个 repo :
deb http://archive.canonical.com/ubuntu/ kinetic partner
注释掉此行并重试。