質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.46%
bash

bash(Bourne-again-Shell)は sh(Bourne Shell)のインプリメンテーションに様々な機能が追加されたシェルです。LinuxやMac OS XではBashはデフォルトで導入されています。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

Q&A

解決済

1回答

8593閲覧

Dockerの公式インストール手順でadd-apt-repositoryに失敗する

T.Adams

総合スコア40

bash

bash(Bourne-again-Shell)は sh(Bourne Shell)のインプリメンテーションに様々な機能が追加されたシェルです。LinuxやMac OS XではBashはデフォルトで導入されています。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

0グッド

0クリップ

投稿2020/02/19 15:58

前提

ホストOSであるMac上でVirtual Box経由でubuntuを立ち上げ、そこでDockerをinstallしようとしています。

分からないこと

Docker install手順で行う、add-apt-repositoryを実施すると以下のエラーが出力されますが、原因と対処がわかりません。以下で実行したURLのパスは、https://download.docker.com/linux/ubuntu/dists/bionic/stableは実際に存在することを確認したので、以下コマンド内のパスもhttps://download.docker.com/linux/ubuntu/dists/bionic/stableに変更して実施してみたのですが、結果は変わりませんでした。

実行コマンド

bash

1$ sudo add-apt-repository \ 2 "deb [arch=amd64] https://download.docker.com/linux/ubuntu/ \ 3 $(bionic) \ 4 stable"

出力結果

bash

1bionic: command not found 2E: Malformed entry 54 in list file /etc/apt/sources.list (Component) 3E: The list of sources could not be read.

環境詳細

  • ホストOS: macOS Catalina 10.15.3
  • ゲストOS: ubuntu 18.04.3 LTS (Bionic Beaver)
  • 仮想化ソフト: VirtualBox 5.3.34

参考

以下の手順で上から順に実行しています。上記の実行コマンドを実行したのは、Install using the repositoryの4の手順です。

Dockerホームページ

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

実行コマンドの $(bionic) の部分が間違えてます。
参考にした手順では $(lsb_release -cs) です。
lsb_release -cs コマンドの結果ではなく文字列 bionic を直接指定する場合は $() で囲んではダメです。

投稿2020/02/19 22:03

kit494way

総合スコア317

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

T.Adams

2020/02/19 22:23

ご返答ありがとうございます。 おっしゃるとおりでした(汗)。 実際に$()で囲まないで実行してみたのですが、結果は以下の通りです。 E: Malformed entry 54 in list file /etc/apt/sources.list (Component) E: The list of sources could not be read. Eの意味を十分に理解できていませんが、これで正しいのでしょうか?
kit494way

2020/02/19 23:30

/etc/apt/sources.list の 54 行目がおかしくなってると思われます。確認してみてください。
T.Adams

2020/02/20 08:38

kit494way様 >/etc/apt/sources.list の 54 行目がおかしくなってると思われます。 おっしゃるとおり、54行目を確認したところ、以下の文字列が挿入されていました。 deb [arch=amd64] https://download.docker.com/linux/ubuntu/ stable 上記記載コマンドも、正しいか正しくないかよく理解しないままエラーが出るたび様々な組み合わせで実行していたため、54行目にコマンド実行にはふさわしくない文字列が挿入されていたようです。 deb [arch=amd64] https://download.docker.com/linux/ubuntu/dists bionic stable 出力結果も以下に載せておきます。下から3つ目のEが気になりますが、本質問とはまた違う話になるので、この質問はクローズします。ありがとうございました。 削除しコマンド実行したら、以下のように出力されました。 Hit:1 http://jp.archive.ubuntu.com/ubuntu bionic InRelease Hit:2 http://archive.ubuntulinux.jp/ubuntu bionic InRelease Get:3 http://jp.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Hit:4 http://archive.ubuntulinux.jp/ubuntu-ja-non-free bionic InRelease Get:5 http://jp.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Ign:6 https://download.docker.com/linux/ubuntu/dists bionic InRelease Hit:7 http://ppa.launchpad.net/libreoffice/ppa/ubuntu bionic InRelease Get:8 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Err:9 https://download.docker.com/linux/ubuntu/dists bionic Release 404 Not Found [IP: 99.86.199.6 443] Get:10 http://jp.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [647 kB] Get:11 http://jp.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [868 kB] Get:12 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [650 kB] Get:13 http://jp.archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [302 kB] Get:14 http://jp.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [307 kB] Get:15 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages [442 kB] Get:16 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [211 kB] Get:17 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [38.5 kB] Get:18 http://security.ubuntu.com/ubuntu bionic-security/main DEP-11 48x48 Icons [17.6 kB] Get:19 http://security.ubuntu.com/ubuntu bionic-security/main DEP-11 64x64 Icons [41.4 kB] Get:20 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [23.8 kB] Get:21 http://security.ubuntu.com/ubuntu bionic-security/restricted Translation-en [6,528 B] Get:22 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [648 kB] Get:23 http://jp.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 48x48 Icons [73.8 kB] Get:24 http://security.ubuntu.com/ubuntu bionic-security/universe i386 Packages [617 kB] Get:25 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [218 kB] Get:26 http://jp.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 64x64 Icons [140 kB] Get:27 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [42.1 kB] Get:28 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 48x48 Icons [16.4 kB] Get:29 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [111 kB] Get:30 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [6,552 B] Get:31 http://jp.archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [32.9 kB] Get:32 http://jp.archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [8,468 B] Get:33 http://jp.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [1,010 kB] Get:34 http://security.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [2,668 B] Get:35 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B] Get:36 http://jp.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,053 kB] Get:37 http://jp.archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [326 kB] Get:38 http://jp.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [264 kB] Get:39 http://jp.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [209 kB] Get:40 http://jp.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [479 kB] Get:41 http://jp.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [9,908 B] Get:42 http://jp.archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [4,608 B] Get:43 http://jp.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,464 B] Get:44 http://jp.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [8,284 B] Reading package lists... Done E: The repository 'https://download.docker.com/linux/ubuntu/dists bionic Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.46%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問