apt-mirror
インターネットにアクセスできるマシンに最新のubuntuパッケージをセットアップしてダウンロードしました。目標はapt-get update
、インターネットにアクセスできないターゲットマシンで実行するときに、このマシンをリポジトリとして使用することです。両方のマシンは手動IPアドレスでセットアップされており、両方のマシンはOSとしてUbuntu 16.04で実行されています。etc/apt/sources.list
ターゲットマシンでは、唯一の1行があります。
deb http://<local_repo_IP>/ubuntu/ xenial main restricted multiverse universe
しかしsudo apt-get update
、ターゲットマシンで実行すると、次のエラーが表示されます。
Ign:1 http://<local_repo_IP>/ubuntu/dists/xenial main InRelease
Ign:2 http://<local_repo_IP>/ubuntu/dists/xenial main Release
Ign:3 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted amd64 Packages
Ign:4 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted i386 Packages
Ign:5 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted all Packages
Ign:6 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted Translation-en_HK
Ign:7 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted Translation-en
Ign:8 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse amd64 Packages
Ign:9 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse i386 Packages
Ign:10 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse all Packages
Ign:11 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse Translation-en_HK
Ign:12 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse Translation-en
Ign:13 http://<local_repo_IP>/ubuntu/dists/xenial main/universe amd64 Packages
Ign:14 http://<local_repo_IP>/ubuntu/dists/xenial main/universe i386 Packages
Ign:15 http://<local_repo_IP>/ubuntu/dists/xenial main/universe all Packages
Ign:16 http://<local_repo_IP>/ubuntu/dists/xenial main/universe Translation-en_HK
Ign:17 http://<local_repo_IP>/ubuntu/dists/xenial main/universe Translation-en
Ign:3 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted amd64 Packages
Ign:4 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted i386 Packages
Ign:5 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted all Packages
Ign:6 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted Translation-en_HK
Ign:7 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted Translation-en
Ign:8 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse amd64 Packages
Ign:9 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse i386 Packages
Ign:10 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse all Packages
Ign:11 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse Translation-en_HK
Ign:12 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse Translation-en
Ign:13 http://<local_repo_IP>/ubuntu/dists/xenial main/universe amd64 Packages
Ign:14 http://<local_repo_IP>/ubuntu/dists/xenial main/universe i386 Packages
Ign:15 http://<local_repo_IP>/ubuntu/dists/xenial main/universe all Packages
Ign:16 http://<local_repo_IP>/ubuntu/dists/xenial main/universe Translation-en_HK
Ign:17 http://<local_repo_IP>/ubuntu/dists/xenial main/universe Translation-en
Ign:3 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted amd64 Packages
Ign:4 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted i386 Packages
Ign:5 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted all Packages
Ign:6 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted Translation-en_HK
Ign:7 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted Translation-en
Ign:8 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse amd64 Packages
Ign:9 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse i386 Packages
Ign:10 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse all Packages
Ign:11 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse Translation-en_HK
Ign:12 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse Translation-en
Ign:13 http://<local_repo_IP>/ubuntu/dists/xenial main/universe amd64 Packages
Ign:14 http://<local_repo_IP>/ubuntu/dists/xenial main/universe i386 Packages
Ign:15 http://<local_repo_IP>/ubuntu/dists/xenial main/universe all Packages
Ign:16 http://<local_repo_IP>/ubuntu/dists/xenial main/universe Translation-en_HK
Ign:17 http://<local_repo_IP>/ubuntu/dists/xenial main/universe Translation-en
Ign:3 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted amd64 Packages
Ign:4 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted i386 Packages
Ign:5 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted all Packages
Ign:6 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted Translation-en_HK
Ign:7 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted Translation-en
Ign:8 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse amd64 Packages
Ign:9 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse i386 Packages
Ign:10 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse all Packages
Ign:11 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse Translation-en_HK
Ign:12 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse Translation-en
Ign:13 http://<local_repo_IP>/ubuntu/dists/xenial main/universe amd64 Packages
Ign:14 http://<local_repo_IP>/ubuntu/dists/xenial main/universe i386 Packages
Ign:15 http://<local_repo_IP>/ubuntu/dists/xenial main/universe all Packages
Ign:16 http://<local_repo_IP>/ubuntu/dists/xenial main/universe Translation-en_HK
Ign:17 http://<local_repo_IP>/ubuntu/dists/xenial main/universe Translation-en
Ign:3 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted amd64 Packages
Ign:4 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted i386 Packages
Ign:5 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted all Packages
Ign:6 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted Translation-en_HK
Ign:7 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted Translation-en
Ign:8 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse amd64 Packages
Ign:9 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse i386 Packages
Ign:10 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse all Packages
Ign:11 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse Translation-en_HK
Ign:12 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse Translation-en
Ign:13 http://<local_repo_IP>/ubuntu/dists/xenial main/universe amd64 Packages
Ign:14 http://<local_repo_IP>/ubuntu/dists/xenial main/universe i386 Packages
Ign:15 http://<local_repo_IP>/ubuntu/dists/xenial main/universe all Packages
Ign:16 http://<local_repo_IP>/ubuntu/dists/xenial main/universe Translation-en_HK
Ign:17 http://<local_repo_IP>/ubuntu/dists/xenial main/universe Translation-en
Err:3 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted amd64 Packages
404 Not Found
Ign:4 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted i386 Packages
Ign:5 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted all Packages
Ign:6 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted Translation-en_HK
Ign:7 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted Translation-en
Ign:8 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse amd64 Packages
Ign:9 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse i386 Packages
Ign:10 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse all Packages
Ign:11 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse Translation-en_HK
Ign:12 http://<local_repo_IP>/ubuntu/dists/xenial main/multiverse Translation-en
Ign:13 http://<local_repo_IP>/ubuntu/dists/xenial main/universe amd64 Packages
Reading package lists... Done
W: The repository 'http://<local_repo_IP>/ubuntu/dists/xenial main Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://<local_repo_IP>/ubuntu/dists/xenial/dists/main/restricted/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
ターゲットマシン:
/etc/resolve.conf
ファイルの内容は次のとおりです。# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.1.1
/etc/network/interfaces
次のものが含まれます。# interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback
また、その出力のapt-get update
明示的なエラーの行はErr:3 http://<local_repo_IP>/ubuntu/dists/xenial main/restricted amd64 Packages
であるため、ターゲットマシンで次の操作を実行して、ファイルが存在するかどうかを確認しました。
wget http://<local_repo_IP>/ubuntu/dists/xenial/restricted/binary-amd64/Packages
そして、次の出力を取得すると、ファイルがそこにあることがわかります。
--2017-12-21 17:23:24-- http://<local_repo_IP>/ubuntu/dists/xenial/restricted/binary-amd64/Packages
Connecting to <local_repo_IP>:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 127112 (124K)
Saving to: ‘Packages’
Packages 100%[============================>] 124.13K --.-KB/s in 0s
2017-12-21 17:23:24 (469 MB/s) - ‘Packages’ saved [127112/127112]
ターゲットマシンからレポジトリマシンに正常にpingできるかどうかも確認しました。それもうまくいきます。
PING <local_repo_IP> (<local_repo_IP>) 56(84) bytes of data.
64 bytes from <local_repo_IP>: icmp_seq=1 ttl=64 time=0.169 ms
64 bytes from <local_repo_IP>: icmp_seq=2 ttl=64 time=0.671 ms
64 bytes from <local_repo_IP>: icmp_seq=3 ttl=64 time=0.186 ms
64 bytes from <local_repo_IP>: icmp_seq=4 ttl=64 time=0.190 ms
64 bytes from <local_repo_IP>: icmp_seq=5 ttl=64 time=0.315 ms
^C
--- <local_repo_IP> ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4047ms
rtt min/avg/max/mdev = 0.169/0.306/0.671/0.190 ms
それで、何が悪いのapt-get update
ですか?修正して動作させるにはどうすればよいですか?
PS私はちょうどエラーが言うことに気づいたhttp://<local_repo_IP>/ubuntu/dists/xenial/dists/main/restricted/binary-amd64/Packages
。restricted
main内でパッケージを検索しようとするのはなぜですか?覗いてみhttp://<local_repo_IP>/ubuntu/dists/xenial/restricted/binary-amd64/Packages
ませんか?実際、wget http://<local_repo_IP>/ubuntu/dists/xenial/dists/main/restricted/binary-amd64/Packages
そうすると、次のエラーが発生します。
--2017-12-21 17:26:06-- http://<local_repo_IP>/ubuntu/dists/xenial/dists/main/restricted/binary-amd64/Packages
Connecting to <local_repo_IP>:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-12-21 17:26:06 ERROR 404: Not Found.
何が起きてる?存在しないディレクトリをチェックしようとするのはなぜですか?そしてapt-get update
、正しいパスを指すにはどうすればよいですか?