E:Debian jessie簡易Dockerコンテナでパッケージvimが見つかりません


20

jessieを実行しているDebianドッカーコンテナー内から

vi blah
bash: vi: command not found

当然のことながら、インストールコマンドにアクセスします

sudo apt-get install vim

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package vim

いくつかの牽引力を探しているときに、さまざまな出力でこれらの提案に出会いました

        cat /etc/apt/sources.list
deb http://deb.debian.org/debian jessie main
deb http://deb.debian.org/debian jessie-updates main
deb http://security.debian.org jessie/updates main

        apt-get install software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package software-properties-common

        apt-get install python-software-properties
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-software-properties


        apt-get install apt-file
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package apt-file

このサーバーはmongoイメージのドッカーコンテナであるため、意図的にベアボーンのDebianインストールです... viのインストールは開発中に再生するだけです

回答:


45

私はこの解決策を見つけました

apt-get update

apt-get install apt-file

apt-file update

apt-get install vim     # now finally this will work !!!

ここに上記のコピーNペーストバージョンがあります

apt-get update && apt-get install apt-file -y && apt-file update && apt-get install vim -y

3
完璧な..盲目的にこれらの手順に従っただけ..それは働いた
..-raksja

1
最後の行は私の時間を節約します...これは二度目です...この答えが私を助けた
セイバーtabatabaee yazdi

1
これは私にとってはうまくいきました。私がしなければならなかったすべてはだったapt-get updateそれからapt-get install ...
ジェフ・ホワイティング

12

けれどもスコットStensland回答作品、あなたはインストールする必要はありませんsoftware-properties-commonpython-software-properties。次のコマンドのみを実行するだけで十分です。

apt-get update
apt-get install apt-file
apt-file update
apt-get install vim

これは私のための1つの作品...
アルマン・オルテガ

同様にして、この1つの作品は、すべてのものをインストールしていないsoftware-properties-commonpython-software-propertiesもたらすでしょうが。
-TheVillageIdiot
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.