Docker ubunbuコンテナ、source.listを編集できない、エディタなし

Docker ubunbuコンテナ、source.listを編集できない、エディタなし

私はdocker Ubuntuコンテナをインストールしました。ソースリストのすべてのリポジトリにコメント(#)が付いているため、APTを介して何も更新またはインストールできません。 nano、vimなどのエディタはありません。ソースリストからアイテムのコメントを削除するにはどうすればよいですか?

ベストアンサー1

公式ドッカー画像を実行するとUbuntu

docker run -it ubuntu  bash -i

このコマンドを実行してくださいgrep -v -e '^#' -e '^$' /etc/apt/sources.listファイル内容の表示/etc/apt/sources.list

grep人を見る(https://linux.die.net/man/1/grep)

次の行が表示されます。

deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
deb http://archive.ubuntu.com/ubuntu/ bionic universe
deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe
deb http://archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted
deb http://security.ubuntu.com/ubuntu/ bionic-security universe
deb http://security.ubuntu.com/ubuntu/ bionic-security multiverse

だから追いかけなければならない適切なアップデートを入手 だからあなたは実行することができますapt-get インストール emacs-nox vim nano

おすすめ記事