てくてっく

コマ撮り作家系エンジニアです。日々地味ぃぃぃにつまづく技術的な問題について、備忘録として作ります。

Debianへのapache2のインストール

vagrantを導入したので、Webサーバをインストールするところから始めます!
なにもないところから一から始めているようで楽しい。

sudo apt -y install apache2

コマンドでインストールしようとしたら

 vagrant@Debian-jessie-amd64-netboot:/$ apt -y install apache2 

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
liblua5.1-0 ssl-cert
Suggested packages:
apache2-doc apache2-suexec-pristine apache2-suexec-custom openssl-blacklist
The following NEW packages will be installed:
apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3
libaprutil1-ldap liblua5.1-0 ssl-cert
0 upgraded, 10 newly installed, 0 to remove and 2 not upgraded.
Need to get 1,939 kB of archives.
After this operation, 6,623 kB of additional disk space will be used.
Get:1 http://ftp.uk.debian.org/debian/ jessie/main libapr1 amd64 1.5.1-3 [95.3 kB]
Get:2 http://ftp.uk.debian.org/debian/ jessie/main libaprutil1 amd64 1.5.4-1 [86.2 kB]
Get:3 http://ftp.uk.debian.org/debian/ jessie/main libaprutil1-dbd-sqlite3 amd64 1.5.4-1 [19.1 kB]
Get:4 http://ftp.uk.debian.org/debian/ jessie/main libaprutil1-ldap amd64 1.5.4-1 [17.2 kB]
Get:5 http://ftp.uk.debian.org/debian/ jessie/main liblua5.1-0 amd64 5.1.5-7.1 [108 kB]
Err http://ftp.uk.debian.org/debian/ jessie/main apache2-bin amd64 2.4.10-10
404 Not Found [IP: 78.129.164.123 80]
Err http://ftp.uk.debian.org/debian/ jessie/main apache2-utils amd64 2.4.10-10
404 Not Found [IP: 78.129.164.123 80]
Err http://ftp.uk.debian.org/debian/ jessie/main apache2-data all 2.4.10-10
404 Not Found [IP: 78.129.164.123 80]
Err http://ftp.uk.debian.org/debian/ jessie/main apache2 amd64 2.4.10-10
404 Not Found [IP: 78.129.164.123 80]
Get:6 http://ftp.uk.debian.org/debian/ jessie/main ssl-cert all 1.0.35 [20.9 kB]
Fetched 347 kB in 6s (51.9 kB/s)
E: Failed to fetch http://ftp.uk.debian.org/debian/pool/main/a/apache2/apache2-bin_2.4.10-10_amd64.deb 404 Not Found [IP: 78.129.164.123 80]

E: Failed to fetch http://ftp.uk.debian.org/debian/pool/main/a/apache2/apache2-utils_2.4.10-10_amd64.deb 404 Not Found [IP: 78.129.164.123 80]

E: Failed to fetch http://ftp.uk.debian.org/debian/pool/main/a/apache2/apache2-data_2.4.10-10_all.deb 404 Not Found [IP: 78.129.164.123 80]

E: Failed to fetch http://ftp.uk.debian.org/debian/pool/main/a/apache2/apache2_2.4.10-10_amd64.deb 404 Not Found [IP: 78.129.164.123 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

と、fix-missing?とか聞かれたので、調べた。

↓gitインストールのときの記事だが、
https://qiita.com/n0bisuke/items/75f5fd5459e7bf75fdac

参考にさせて頂くと、単純にapt-get updateが必要なだけだった。
sudo apt-get updateしてから
sudo apt -y install apache2すると、

vagrant@Debian-jessie-amd64-netboot:/$ sudo apt-get update

Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB]
Ign http://ftp.uk.debian.org jessie InRelease
Get:2 http://security.debian.org jessie/updates/main Sources [310 kB]
Get:3 http://ftp.uk.debian.org jessie-updates InRelease [7,340 B]
Get:4 http://security.debian.org jessie/updates/contrib Sources [1,439 B]
Get:5 http://ftp.uk.debian.org jessie Release.gpg [2,420 B]
Get:6 http://security.debian.org jessie/updates/non-free Sources [1,631 B]
Get:7 http://ftp.uk.debian.org jessie Release [148 kB]
Get:8 http://security.debian.org jessie/updates/main amd64 Packages [678 kB]
Get:9 http://security.debian.org jessie/updates/contrib amd64 Packages [2,506 B]
Get:10 http://security.debian.org jessie/updates/non-free amd64 Packages [4,556 B]
Get:11 http://security.debian.org jessie/updates/contrib Translation-en [1,211 B]
Get:12 http://security.debian.org jessie/updates/main Translation-en [342 kB]
Get:13 http://security.debian.org jessie/updates/non-free Translation-en [11.8 kB]
Get:14 http://ftp.uk.debian.org jessie/main Sources [7,063 kB]
Get:15 http://ftp.uk.debian.org jessie/contrib Sources [50.4 kB]
Get:16 http://ftp.uk.debian.org jessie/non-free Sources [99.2 kB]
Get:17 http://ftp.uk.debian.org jessie/main amd64 Packages [6,818 kB]
Get:18 http://ftp.uk.debian.org jessie/contrib amd64 Packages [49.8 kB]
Get:19 http://ftp.uk.debian.org jessie/non-free amd64 Packages [83.2 kB]
Get:20 http://ftp.uk.debian.org jessie/contrib Translation-en [38.3 kB]
Get:21 http://ftp.uk.debian.org jessie/main Translation-en [4,581 kB]
Get:22 http://ftp.uk.debian.org jessie/non-free Translation-en [72.0 kB]
Fetched 20.4 MB in 27s (735 kB/s)
W: Failed to fetch http://ftp.uk.debian.org/debian/dists/jessie-updates/InRelease Unable to find expected entry 'main/source/Sources' in Release file (Wrong sources.list entry or malformed file)
Enabling module authn_file.
Enabling module authz_user.
Enabling module alias.
Enabling module dir.
Enabling module autoindex.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module filter.
Enabling module deflate.
Enabling module status.
Enabling module reqtimeout.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
Setting up ssl-cert (1.0.35) ...
Processing triggers for libc-bin (2.19-18) ...
Processing triggers for systemd (215-17) ...

無事インストールできました!