Docker 中安裝VIM報錯

2021-10-01 10:51:17 字數 1573 閱讀 3165

今天在除錯testlink 容器的時候,想修改乙個資料庫引數,結果沒有vi和vim只有乙個cat

所有只有手動去安裝乙個vim在容器裡面,使用命令去安裝,發現報錯

sudo apt-get install vim

root@a1fabecfd6ce:/bitnami/testlink# sudo apt-get install vim

reading package lists... done

building dependency tree

reading state information... done

e: unable to locate package vim

這時候需要先執行乙個同步命令:

apt-get update

root@a1fabecfd6ce:/bitnami/testlink# apt-get update

get:1 stretch/updates inrelease [94.3 kb]

get:2 stretch/updates/main amd64 packages [635 kb]

ign:3 stretch inrelease

get:4 stretch release [118 kb]

get:5 stretch release.gpg [2365 b]

get:6 stretch/main amd64 packages [9480 kb]

fetched 10.3 mb in 22s (466 kb/s)

reading package lists... done

然後再次執行安裝命令就ok了

apt-get install vim

root@a1fabecfd6ce:/bitnami/testlink# apt-get install vim

reading package lists... done

building dependency tree

reading state information... done

the following additional packages will be installed:

libgpm2 vim-common vim-runtime xxd

suggested packages:

gpm ctags vim-doc vim-scripts

the following new packages will be installed:

libgpm2 vim vim-common vim-runtime xxd

0 upgraded, 5 newly installed, 0 to remove and 34 not upgraded.

need to get 6769 kb of archives.

after this operation, 31.2 mb of additional disk space will be used.

do you want to continue? [y/n] y

docker容器中安裝vim

reading package lists.done building dependency tree reading state information.done e unable to locate package vim 這時候須要敲 apt get update。這個命令的作用是 同步 et...

docker容器中安裝vim

容器id替換為自己的id docker exec it 容器id bin bash說明 docker容器中安裝vim,主要是linux的發行版中安裝。檢視linux發行版資訊 cat etc issue通過apk包管理安裝 更新本地包版本 apk update 安裝vim apk add vimyu...

docker容器中安裝vim

今天在docker的mysql容器中需要修改mysql的配置檔案,發現容器中沒有安裝vim,使用vi時提示 bash vi command not found因此詳細記錄下安裝vim的過程 我安裝的mysql容器是debian作業系統 1.在centos的任務目錄下建立source.list檔案 c...