900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > bash: vi: command not found

bash: vi: command not found

时间:2022-12-18 13:49:14

相关推荐

bash: vi: command not found

新进入一个docker的时候,没有vi命令,这种情况已经遇见好几次了,记录一下。

vi train_mv2.pybash: vi: command not found

按照网上的方法,运行apt-get install vim:

apt-get install vimReading package lists... DoneBuilding dependency treeReading state information... DoneThe following additional packages will be installed:libgpm2 vim-common vim-runtimeSuggested packages:gpm ctags vim-doc vim-scripts vim-gnome-py2 | vim-gtk-py2 | vim-gtk3-py2 | vim-athena-py2 | vim-nox-py2The following NEW packages will be installed:libgpm2 vim vim-common vim-runtime0 upgraded, 4 newly installed, 0 to remove and 2 not upgraded.Need to get 6303 kB/6319 kB of archives.After this operation, 30.4 MB of additional disk space will be used.Do you want to continue? [Y/n] YErr:1 /ubuntu xenial-security/main amd64 vim-common amd64 2:7.4.1689-3ubuntu1.2404 Not Found [IP: 91.189.88.152 80]Err:1 /ubuntu xenial-security/main amd64 vim-common amd64 2:7.4.1689-3ubuntu1.2404 Not Found [IP: 91.189.88.152 80]Err:2 /ubuntu xenial-security/main amd64 vim-runtime all 2:7.4.1689-3ubuntu1.2404 Not Found [IP: 91.189.88.152 80]Ign:3 /ubuntu xenial-security/main amd64 vim amd64 2:7.4.1689-3ubuntu1.2Err:2 /ubuntu xenial-security/main amd64 vim-runtime all 2:7.4.1689-3ubuntu1.2404 Not Found [IP: 91.189.88.152 80]Err:3 /ubuntu xenial-security/main amd64 vim amd64 2:7.4.1689-3ubuntu1.2404 Not Found [IP: 91.189.88.152 80]E: Failed to fetch /ubuntu/pool/main/v/vim/vim-common_7.4.1689-3ubuntu1.2_amd64.deb 404 Not Found [IP: 91.189.88.152 80]E: Failed to fetch /ubuntu/pool/main/v/vim/vim-runtime_7.4.1689-3ubuntu1.2_all.deb 404 Not Found [IP: 91.189.88.152 80]E: Failed to fetch /ubuntu/pool/main/v/vim/vim_7.4.1689-3ubuntu1.2_amd64.deb 404 Not Found [IP: 91.189.88.152 80]E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

然后

apt-get update

结果报错:

Get:1 file:/var/nvinfer-runtime-trt-repo-4.0.1-ga-cuda9.0 InReleaseIgn:1 file:/var/nvinfer-runtime-trt-repo-4.0.1-ga-cuda9.0 InReleaseGet:2 file:/var/nvinfer-runtime-trt-repo-4.0.1-ga-cuda9.0 Release [574 B]Get:2 file:/var/nvinfer-runtime-trt-repo-4.0.1-ga-cuda9.0 Release [574 B]Err:3 file:/var/nvinfer-runtime-trt-repo-4.0.1-ga-cuda9.0 Release.gpgAt least one invalid signature was encountered.Get:4 /ubuntu xenial-security InRelease [109 kB]Err:4 /ubuntu xenial-security InReleaseuldn't create tempfiles for splitting up /var/lib/apt/lists/partial/_ubuntu_dists_xenial-security_InReleaseCould not execute 'apt-key' to verify signature (is gnupg installed?)Hit:5 /ubuntu xenial InReleaseErr:5 /ubuntu xenial InReleasen't create tempfiles for splitting up /var/lib/apt/lists/_ubuntu_dists_xenial_InReleaseCould not execute 'apt-key' to verify signature (is gnupg installed?)Get:6 /ubuntu xenial-updates InRelease [109 kB]Ign:7 https://developer./compute/cuda/repos/ubuntu1604/x86_64 InRelease0% [6 InRelease gpgv 109 kB] [Waiting for headers] 3819 B/s 28sCErr:6 /ubuntu xenial-updates InReleaseCould not execute 'apt-key' to verify signature (is gnupg installed?)Get:8 /ubuntu xenial-backports InRelease [107 kB]0% [8 InRelease gpgv 107 kB] 3819 B/s 57sCErr:8 /ubuntu xenial-backports InReleaseCould not execute 'apt-key' to verify signature (is gnupg installed?)Ign:9 https://developer./compute/machine-learning/repos/ubuntu1604/x86_64 InReleaseGet:11 https://developer./compute/machine-learning/repos/ubuntu1604/x86_64 Release [169 B]Get:12 https://developer./compute/cuda/repos/ubuntu1604/x86_64 Release.gpg [169 B]Err:12 https://developer./compute/cuda/repos/ubuntu1604/x86_64 Release.gpgAt least one invalid signature was encountered.Get:13 https://developer./compute/machine-learning/repos/ubuntu1604/x86_64 Release.gpg [169 B]Err:13 https://developer./compute/machine-learning/repos/ubuntu1604/x86_64 Release.gpgAt least one invalid signature was encountered.Fetched 327 kB in 31s (10.5 kB/s)Reading package lists... DoneW: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: file:/var/nvinfer-runtime-trt-repo-4.0.1-ga-cuda9.0 Release: At least one invalid signature was encountered.W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: /ubuntu xenial-security InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: /ubuntu xenial InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: /ubuntu xenial-updates InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: /ubuntu xenial-backports InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://developer./compute/cuda/repos/ubuntu1604/x86_64 Release: At least one invalid signature was encountered.W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: shttps://developer./compute/machine-learning/repos/ubuntu1604/x86_64 Release: At least one invalid signature was encountered.W: Failed to fetch /ubuntu/dists/xenial/InRelease Could not execute 'apt-key' to verify signature (is gnupg installed?)W: Failed to fetch /ubuntu/dists/xenial-updates/InRelease Could not execute 'apt-key' to verify signature (is gnupg installed?)W: Failed to fetch /ubuntu/dists/xenial-backports/InRelease Could not execute 'apt-key' to verify signature (is gnupg installed?)W: Failed to fetch /ubuntu/dists/xenial-security/InRelease Could not execute 'apt-key' to verify signature (is gnupg installed?)W: Failed to fetch file:/var/nvinfer-runtime-trt-repo-4.0.1-ga-cuda9.0/Release.gpg At least one invalid signature was encountered.W: Failed to fetch https://developer./compute/cuda/repos/ubuntu1604/x86_64/Release.gpg At least one invalid signature was encountered.W: Failed to fetch https://developer./compute/machine-learning/repos/ubuntu1604/x86_64/Release.gpg At least one invalid signature was encountered.W: Some index files failed to download. They have been ignored, or old ones used instead.

试了各种源,都不行,发现不是源的问题,其实这个是由于 tmp 文件夹权限不够的原因,解决方法:

运行命令

chmod 777 /tmpapt-get update --allow-unauthenticated

apt-get update

apt-get install vim

源的话我是把所有的都删了,只留下了aliyun的

deb /ubuntu/ trusty main restricted universe multiverse

deb /ubuntu/ trusty-security main restricted universe multiverse

deb /ubuntu/ trusty-updates main restricted universe multiverse

deb /ubuntu/ trusty-proposed main restricted universe multiverse

deb /ubuntu/ trusty-backports main restricted universe multiverse

deb-src /ubuntu/ trusty main restricted universe multiverse

deb-src /ubuntu/ trusty-security main restricted universe multiverse

deb-src /ubuntu/ trusty-updates main restricted universe multiverse

deb-src /ubuntu/ trusty-proposed main restricted universe multiverse

deb-src /ubuntu/ trusty-backports main restricted universe multiverse

终于解决啦,开心~

参考博客

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。