打字时
$apt-get update
哪个apt
先检查:
sources.list
文件还是/var/lib/apt/lists
目录?
答案1
让我们来看看:
$ sudo strace apt-get update |& grep -E 'sources\.list|/var/lib/apt/lists' | head
stat("/etc/apt/sources.list", {st_mode=S_IFREG|0644, st_size=1515, ...}) = 0
openat(AT_FDCWD, "/etc/apt/sources.list", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/var/lib/apt/lists/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 5
...
所以它sources.list
首先检查。这是有道理的,因为sources.list
(以及 中的文件sources.list.d
)决定存储库apt
“知道”,而不是/var/lib/apt/lists
.