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

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

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

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

Ubuntu

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

Subversion

Subversionは、使い方はCVSによく似た、CVS(Concurrent Versions System)を改良したバージョン管理ツールです。

Docker

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

Q&A

解決済

1回答

12694閲覧

Dockerで作成したubuntuコンテナでsudoコマンドが使用できない

tkfm10

総合スコア9

bash

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

Ubuntu

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

Subversion

Subversionは、使い方はCVSによく似た、CVS(Concurrent Versions System)を改良したバージョン管理ツールです。

Docker

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

0グッド

0クリップ

投稿2019/09/27 08:15

前提・実現したいこと

Dockerエンジンは、Windows10に導入
Docker(Docker for Windows)で作成したubuntuコンテナにsubversionをインストールしたい

発生している問題・エラーメッセージ

事象1:subversonのインストールができない

root@xxxx:/# apt-get install subversion Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package subversion

事象2:sudoコマンドを利用できない

root@XXXX:/etc# sudo apt update bash: sudo: command not found

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

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

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

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

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

guest

回答1

0

ベストアンサー

既に root ユーザーでログインされているようなので sudo は使わずに、
apt update してから apt-get install subversion することでインストールできると思います。

それとは別に sudo が必要な場合、apt install sudo でインストールできると思います。

sh

1apt update 2apt install subversion 3apt install sudo

投稿2019/09/27 08:21

編集2019/09/27 08:23
uzyexe

総合スコア239

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

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

tkfm10

2019/09/27 08:29

早速の回答ありがとうございます。 教えていただいたコマンドの上2つを試してみましたが、 うまくいきませんでした。 root@XXXX:/# apt update Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease Something wicked happened resolving 'security.ubuntu.com:80' (-5 - No address associated with hostname) Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease Something wicked happened resolving 'archive.ubuntu.com:80' (-5 - No address associated with hostname) Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Something wicked happened resolving 'archive.ubuntu.com:80' (-5 - No address associated with hostname) Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Something wicked happened resolving 'archive.ubuntu.com:80' (-5 - No address associated with hostname) Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date. W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Something wicked happened resolving 'archive.ubuntu.com:80' (-5 - No address associated with hostname) W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Something wicked happened resolving 'archive.ubuntu.com:80' (-5 - No address associated with hostname) W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Something wicked happened resolving 'archive.ubuntu.com:80' (-5 - No address associated with hostname) W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Something wicked happened resolving 'security.ubuntu.com:80' (-5 - No address associated with hostname) W: Some index files failed to download. They have been ignored, or old ones used instead. root@XXXX:/# apt install subversion Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package subversion root@XXXX:/#
uzyexe

2019/09/27 08:34 編集

> No address associated with hostname 上記エラー内容から察するに、インターネット上にあるサーバへのDNS名前解決に失敗しているようです。 コンテナが、インターネットに向けて正常に通信できていない状態なのではないかと思います。 Windowsのファイアウォール設定を見直してみるのがよいと思います。
tkfm10

2019/09/30 03:36

ありがとうございます 社内LAN経由のため、それが関係していそうです
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問