1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Raspberrypi Docker compose] E: Unable to locate packageが解決できないんですけど!

Last updated at Posted at 2022-07-16

概要

以前から気になっていたMisskeyを導入しようとRaspberry piでDockerを用いて公式通りに構築しようとしたら以下のようなエラーを吐かれた

.console
~
E: Unable to locate package

このエラーの解決に永遠に悩んでいたので自身への戒めも含めて記事を書きました。

環境

  • Raspberry pi 4B 8GB
  • Docker version 20.10.17, build 100c701
  • Docker Compose version v2.6.0

基本のDockerfile

MisskeyをCloneした後に何も弄っていないDockerfileを用いて以下のコマンドを入力

.sh
$ docker compose build

その結果が冒頭のエラーへ。

途中のログを見てみる

流れ作業なのでコマンドログを全然見なかったが、よくよく見てみるとapt-get updateの時に一瞬何かしらエラーが出ていた。(しかもエラー文は処理が進むと消える)
ここまでで3時間程度経っていたが、エラーを見てみると

 => # rg'
 => => # W: Failed to fetch http://security.debian.org/debian-security/dists/bullseye-security/InRelease  Temporary failure
 => => # resolving 'security.debian.org'
 => => # W: Failed to fetch http://deb.debian.org/debian/dists/bullseye-updates/InRelease  Temporary failure resolving 'deb.
 => => # debian.org'
 => => # W: Some index files failed to download. They have been ignored, or old ones used instead.

...名前解決できてないな?

ということで名前解決が悪さしてそうなので/etc/resolv.confを見てみると

./etc/resolv.conf
# Generated by resolvconf
search flets-east.jp iptvf.jp
nameserver 2400:4053:121:e400:a10:86ff:fef3:87e0

ネームサーバーについては勉強不足なのでなんにもわからんですが、1.1.1.1とかのIPがないので関連のIPを付け足してあげると

./etc/resolv.conf
# Generated by resolvconf
search flets-east.jp iptvf.jp
nameserver 2400:4053:121:e400:a10:86ff:fef3:87e0
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 1.1.1.1
nameserver 208.67.222.222  # OpenDNS address

(参考: 「/etc/resolv.conf」ファイル)

以上を付け足したら今までの時間は何だったんだと思うくらいスイスイ処理が進んでくれました。

終わりに

ネームサーバーはしっかり確認しよう!!!!!!!

その他ひっかかったこと

ビルドと初期化

ビルドと初期化にて

sudo docker-compose run --rm web yarn run init`

のコマンドを打つが、この時DBとRedisのHost名を初期値から変えてあげないと起動途中でエラーが発生してしまう。

参考:
https://issuehunt.io/r/syuilo/misskey/issues/7312

default.ymlのdbとredisのhost名をdocker-compose.ymlで指定した識別子に設定してあげると良い感じになります。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?