Ubuntu 16.04 apt-get update 不适用于本地存储库

Ubuntu 16.04 apt-get update 不适用于本地存储库

我在目录中有 xenial 的本地存储库/CDs/ubuntu。我的 sources.list 文件:

deb file:/CDs/ubuntu xenial main restricted universe multiverse

更新结果:

#apt-get update
Get:1 file:/CDs/ubuntu xenial InRelease
Ign:1 file:/CDs/ubuntu xenial InRelease
Get:2 file:/CDs/ubuntu xenial Release [246 kB]
Get:2 file:/CDs/ubuntu xenial Release [246 kB]
Get:3 file:/CDs/ubuntu xenial Release.gpg [933 B]
Get:3 file:/CDs/ubuntu xenial Release.gpg [933 B]
Get:4 file:/CDs/ubuntu xenial/main amd64 Packages
Ign:4 file:/CDs/ubuntu xenial/main amd64 Packages
Get:5 file:/CDs/ubuntu xenial/main i386 Packages
Ign:5 file:/CDs/ubuntu xenial/main i386 Packages
Get:6 file:/CDs/ubuntu xenial/main Translation-en
Ign:6 file:/CDs/ubuntu xenial/main Translation-en
Get:7 file:/CDs/ubuntu xenial/main amd64 DEP-11 Metadata
Ign:7 file:/CDs/ubuntu xenial/main amd64 DEP-11 Metadata
Get:8 file:/CDs/ubuntu xenial/main DEP-11 64x64 Icons
Ign:8 file:/CDs/ubuntu xenial/main DEP-11 64x64 Icons
Get:9 file:/CDs/ubuntu xenial/restricted amd64 Packages
Ign:9 file:/CDs/ubuntu xenial/restricted amd64 Packages
Get:10 file:/CDs/ubuntu xenial/restricted i386 Packages
Ign:10 file:/CDs/ubuntu xenial/restricted i386 Packages
Get:11 file:/CDs/ubuntu xenial/restricted Translation-en
Ign:11 file:/CDs/ubuntu xenial/restricted Translation-en
Get:12 file:/CDs/ubuntu xenial/restricted amd64 DEP-11 Metadata
Ign:12 file:/CDs/ubuntu xenial/restricted amd64 DEP-11 Metadata
Get:13 file:/CDs/ubuntu xenial/universe amd64 Packages
Ign:13 file:/CDs/ubuntu xenial/universe amd64 Packages
Get:14 file:/CDs/ubuntu xenial/universe i386 Packages
Ign:14 file:/CDs/ubuntu xenial/universe i386 Packages
Get:15 file:/CDs/ubuntu xenial/universe Translation-en
Ign:15 file:/CDs/ubuntu xenial/universe Translation-en
Get:16 file:/CDs/ubuntu xenial/universe amd64 DEP-11 Metadata
Ign:16 file:/CDs/ubuntu xenial/universe amd64 DEP-11 Metadata
Get:17 file:/CDs/ubuntu xenial/universe DEP-11 64x64 Icons
Ign:17 file:/CDs/ubuntu xenial/universe DEP-11 64x64 Icons
Get:18 file:/CDs/ubuntu xenial/multiverse amd64 Packages
Ign:18 file:/CDs/ubuntu xenial/multiverse amd64 Packages
Get:19 file:/CDs/ubuntu xenial/multiverse i386 Packages
Ign:19 file:/CDs/ubuntu xenial/multiverse i386 Packages
Get:20 file:/CDs/ubuntu xenial/multiverse Translation-en
Ign:20 file:/CDs/ubuntu xenial/multiverse Translation-en
Get:21 file:/CDs/ubuntu xenial/multiverse amd64 DEP-11 Metadata
Ign:21 file:/CDs/ubuntu xenial/multiverse amd64 DEP-11 Metadata
Get:22 file:/CDs/ubuntu xenial/multiverse DEP-11 64x64 Icons
Ign:22 file:/CDs/ubuntu xenial/multiverse DEP-11 64x64 Icons
Get:4 file:/CDs/ubuntu xenial/main amd64 Packages [1,201 kB]
Ign:4 file:/CDs/ubuntu xenial/main amd64 Packages
Get:5 file:/CDs/ubuntu xenial/main i386 Packages [1,196 kB]
Ign:5 file:/CDs/ubuntu xenial/main i386 Packages
Get:6 file:/CDs/ubuntu xenial/main Translation-en [568 kB]
Ign:6 file:/CDs/ubuntu xenial/main Translation-en
Get:7 file:/CDs/ubuntu xenial/main amd64 DEP-11 Metadata [733 kB]
Ign:7 file:/CDs/ubuntu xenial/main amd64 DEP-11 Metadata
Get:8 file:/CDs/ubuntu xenial/main DEP-11 64x64 Icons [409 kB]
Ign:8 file:/CDs/ubuntu xenial/main DEP-11 64x64 Icons
Get:9 file:/CDs/ubuntu xenial/restricted amd64 Packages [8,344 B]
Ign:9 file:/CDs/ubuntu xenial/restricted amd64 Packages
Get:10 file:/CDs/ubuntu xenial/restricted i386 Packages [8,684 B]
Ign:10 file:/CDs/ubuntu xenial/restricted i386 Packages
Get:11 file:/CDs/ubuntu xenial/restricted Translation-en [2,908 B]
Ign:11 file:/CDs/ubuntu xenial/restricted Translation-en
Get:12 file:/CDs/ubuntu xenial/restricted amd64 DEP-11 Metadata [186 B]
Ign:12 file:/CDs/ubuntu xenial/restricted amd64 DEP-11 Metadata
Get:13 file:/CDs/ubuntu xenial/universe amd64 Packages [7,532 kB]
Ign:13 file:/CDs/ubuntu xenial/universe amd64 Packages
Get:14 file:/CDs/ubuntu xenial/universe i386 Packages [7,512 kB]
Ign:14 file:/CDs/ubuntu xenial/universe i386 Packages
Get:15 file:/CDs/ubuntu xenial/universe Translation-en [4,354 kB]
Ign:15 file:/CDs/ubuntu xenial/universe Translation-en
Get:16 file:/CDs/ubuntu xenial/universe amd64 DEP-11 Metadata [3,410 kB]
Ign:16 file:/CDs/ubuntu xenial/universe amd64 DEP-11 Metadata
Get:17 file:/CDs/ubuntu xenial/universe DEP-11 64x64 Icons [7,448 kB]
Ign:17 file:/CDs/ubuntu xenial/universe DEP-11 64x64 Icons
Get:18 file:/CDs/ubuntu xenial/multiverse amd64 Packages [144 kB]
Ign:18 file:/CDs/ubuntu xenial/multiverse amd64 Packages
Get:19 file:/CDs/ubuntu xenial/multiverse i386 Packages [140 kB]
Ign:19 file:/CDs/ubuntu xenial/multiverse i386 Packages
Get:20 file:/CDs/ubuntu xenial/multiverse Translation-en [106 kB]
Ign:20 file:/CDs/ubuntu xenial/multiverse Translation-en
Get:21 file:/CDs/ubuntu xenial/multiverse amd64 DEP-11 Metadata [63.8 kB]
Ign:21 file:/CDs/ubuntu xenial/multiverse amd64 DEP-11 Metadata
Get:22 file:/CDs/ubuntu xenial/multiverse DEP-11 64x64 Icons [230 kB]
Ign:22 file:/CDs/ubuntu xenial/multiverse DEP-11 64x64 Icons
Get:4 file:/CDs/ubuntu xenial/main amd64 Packages [1,558 kB]
Get:5 file:/CDs/ubuntu xenial/main i386 Packages [1,552 kB]
Get:6 file:/CDs/ubuntu xenial/main Translation-en [799 kB]
Ign:6 file:/CDs/ubuntu xenial/main Translation-en
Get:7 file:/CDs/ubuntu xenial/main amd64 DEP-11 Metadata [2,189 kB]
Err:7 file:/CDs/ubuntu xenial/main amd64 DEP-11 Metadata
  File not found - /CDs/ubuntu/dists/xenial/main/dep11/Components-amd64.yml (2: No such file or directory)
Get:8 file:/CDs/ubuntu xenial/main DEP-11 64x64 Icons [481 kB]
Err:8 file:/CDs/ubuntu xenial/main DEP-11 64x64 Icons
  File not found - /CDs/ubuntu/dists/xenial/main/dep11/icons-64x64.tar (2: No such file or directory)
Reading package lists... Done                 
E: Failed to fetch file:/CDs/ubuntu/dists/xenial/main/dep11/Components-amd64.yml  File not found - /CDs/ubuntu/dists/xenial/main/dep11/Components-amd64.yml (2: No such file or directory)
E: Failed to fetch file:/CDs/ubuntu/dists/xenial/main/dep11/icons-64x64.tar  File not found - /CDs/ubuntu/dists/xenial/main/dep11/icons-64x64.tar (2: No such file or directory)
E: Some index files failed to download. They have been ignored, or old ones used instead.

在 中/var/lib/apt/lists,我什么都没有。partial目录中只有部分信息:

#/var/lib/apt/lists/partial# ls -l
total 7308
-rw-r--r-- 1 root root 7228243 Apr 22 09:37 _CDs_ubuntu_dists_xenial_main_binary-amd64_Packages
lrwxrwxrwx 1 root root      54 May 13 10:25 _CDs_ubuntu_dists_xenial_main_binary-amd64_Packages.gz -> /CDs/ubuntu/dists/xenial/main/binary-amd64/Packages.gz
lrwxrwxrwx 1 root root      53 May 13 10:25 _CDs_ubuntu_dists_xenial_main_binary-i386_Packages.gz -> /CDs/ubuntu/dists/xenial/main/binary-i386/Packages.gz
-rw-r--r-- 1 root root  245864 Apr 22 11:24 _CDs_ubuntu_dists_xenial_Release
-rw-r--r-- 1 root root     933 Apr 22 11:24 _CDs_ubuntu_dists_xenial_Release.gpg

只有将 apt 降级到 1.1 才能解决该问题trusty

此外,newapt-get update还会尝试更改以符号链接形式存储的文件的权限/var/lib/apt/list。例如,它会更改文件的访问权限:

/CDs/ubuntu/dists/xenial/main/binary-amd64/Packages.gz

关于如何在 Ubuntu 16.04 中将 apt 1.2 与本地 repo 结合使用,有什么建议吗?

答案1

为了在 Ubuntu 16.04 中使用带有本地存储库的 apt 1.2,您需要删除此文件:

/etc/apt/apt.conf.d/50appstream

使用:

sudo rm /etc/apt/apt.conf.d/50appstream

答案2

对我来说,独自删除

/etc/apt/apt.conf.d/50appstream

没用,因为我已经下载了仅有的软件包amd64。为了让它工作,我必须将架构添加到sources.list行中

deb [arch=amd64] file:/wherever xenial main restricted universe multiverse
...etc.

这样做之后apt-get update效果很好。

答案3

我遇到了同样的问题,我试图解决这个问题

sudo rm /etc/apt/apt.conf.d/50appstream

但它对我不起作用。我担心它可能存在错误这里

无论如何我找到了一种替代方案并且对我来说效果很好

我打开我的存储库目录并执行以下命令:

python -m SimpleHTTPServer <port>

是一种在任何文件夹中启动 Web 服务器的简单方法,您可以看到如何轻松在任意文件夹中启动网络服务器?

现在,您可以像通过 http 使用存储库一样使用 sources.list。例如,在我的情况下,我使用 por 8585,这是我的 sources.list

deb http://localhost:8585/ xenial main multiverse restricted universe

deb http://localhost:8585/ xenial-backports main multiverse restricted universe

deb http://localhost:8585/ xenial-proposed main multiverse restricted universe

deb http://localhost:8585/ xenial-security main multiverse restricted universe

deb http://localhost:8585/ xenial-updates main multiverse restricted universe

是快速的解决方案,我很确定还有其他更强大的解决方案。

相关内容