apt-get update 命令在 xenial 本地镜像中不起作用

use*_*268 5 apt localrepository software-installation 16.04

使用 apt-mirror,我将 xenial 包下载到我的机器上(IP 地址:172.16.3.37)。我的 apt-mirror 的“mirror.list”的内容如下。

############# config ##################
#
 set base_path    /ubuntuRepo
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############



deb-amd64 http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse free non-free
deb-amd64 http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse free non-free
deb-amd64 http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse free non-free
deb-amd64 http://archive.ubuntu.com/ubuntu xenial-proposed main restricted universe multiverse free non-free
deb-amd64 http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse free non-free


deb-i386 http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse free non-free
deb-i386 http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse free non-free
deb-i386 http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse free non-free
deb-i386 http://archive.ubuntu.com/ubuntu xenial-proposed main restricted universe multiverse free non-free
deb-i386 http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse free non-free
Run Code Online (Sandbox Code Playgroud)

文件已成功下载。

我尝试从另一台机器上使用这个 repo 安装软件包。那台机器的 /etc/apt/sources.list 包含以下行(我特意只保留了一行以减少错误数量)。

    deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse free non-free
Run Code Online (Sandbox Code Playgroud)

现在,当我尝试“apt-get update”时,我得到以下信息。

Get:1 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Ign:2 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/main amd64 Packages
Ign:3 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/main i386 Packages
Ign:4 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/main Translation-en
Ign:5 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/main amd64 DEP-11 Metadata
Ign:6 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/main DEP-11 64x64 Icons
Ign:7 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
Ign:8 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/universe i386 Packages
Ign:9 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/universe Translation-en
Ign:10 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/universe amd64 DEP-11 Metadata
Ign:11 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/universe DEP-11 64x64 Icons
Get:2 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1,201 kB]
Get:3 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/main i386 Packages [1,196 kB]
Get:4 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/main Translation-en [568 kB]
Ign:5 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/main amd64 DEP-11 Metadata
Ign:6 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/main DEP-11 64x64 Icons
Get:7 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7,532 kB]
Get:8 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/universe i386 Packages [7,512 kB]
Get:9 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/universe Translation-en [4,354 kB]
Ign:10 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/universe amd64 DEP-11 Metadata
Ign:11 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/universe DEP-11 64x64 Icons
Err:5 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/main amd64 DEP-11 Metadata
  404  Not Found
Err:6 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/main DEP-11 64x64 Icons
  404  Not Found
Err:10 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/universe amd64 DEP-11 Metadata
  404  Not Found
Err:11 http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu xenial/universe DEP-11 64x64 Icons
  404  Not Found
Fetched 247 kB in 0s (574 kB/s) 
Reading package lists... Done
E: Failed to fetch http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu/dists/xenial/main/dep11/Components-amd64.yml  404  Not Found
E: Failed to fetch http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu/dists/xenial/main/dep11/icons-64x64.tar  404  Not Found
E: Failed to fetch http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu/dists/xenial/universe/dep11/Components-amd64.yml  404  Not Found
E: Failed to fetch http://172.16.3.37/ubuntuRepo/mirror/archive.ubuntu.com/ubuntu/dists/xenial/universe/dep11/icons-64x64.tar  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Run Code Online (Sandbox Code Playgroud)

我曾在这里问过类似的问题。非常感谢任何有用的想法。

her*_*nda 9

我有同样的问题。对我来说,解决方案是:

rm /etc/apt/apt.conf.d/50appstream
Run Code Online (Sandbox Code Playgroud)

来源: Ubuntu 16.04 apt-get 更新不适用于本地存储库


mur*_*uru 0

看起来您的存储库仅镜像 amd64 软件包,但您的系统需要 amd64 和 i386 软件包。只需添加与已有的行deb-i386类似的行,然后再次同步镜像即可。deb-amd64