我用的Ubuntu12.4.2版本但是在使用的過程中發現vi編輯器中的上下左右四個按鍵會變成ABCD,這樣使用起來不方便,當然你也可以重新安裝一個VIM編輯工具,使用是沒有問題的。
一、移除vim-common
root@openwrt:~/MT7688# apt-get remove vim-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
ubuntu-minimal vim-common vim-tiny
0 upgraded, 0 newly installed, 3 to remove and 524 not upgraded.
After this operation, 1,154 kB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 149098 files and directories currently installed.)
Removing ubuntu-minimal ...
Removing vim-tiny ...
update-alternatives: using /usr/bin/see to provide /usr/bin/view (view) in auto mode.
Removing vim-common ...
Processing triggers for man-db ...
二、安裝vim
root@openwrt:~/MT7688# apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
vim-common vim-runtime
Suggested packages:
ctags vim-doc vim-scripts
The following NEW packages will be installed:
vim vim-common vim-runtime
0 upgraded, 3 newly installed, 0 to remove and 524 not upgraded.
Need to get 7,341 kB of archives.
After this operation, 25.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
WARNING: The following packages cannot be authenticated!
vim-common vim-runtime vim
Install these packages without verification [y/N]? Y
Get:1http://us.archive.ubuntu.com/ubuntu/ precise-updates/main vim-common i386 2:7.3.429-2ubuntu2.1 [85.8 kB]
Get:2http://us.archive.ubuntu.com/ubuntu/ precise-updates/main vim-runtime all 2:7.3.429-2ubuntu2.1 [6,277 kB]
Get:3http://us.archive.ubuntu.com/ubuntu/ precise-updates/main vim i386 2:7.3.429-2ubuntu2.1 [979 kB]
Fetched 7,341 kB in 51s (144 kB/s)
Selecting previously unselected package vim-common.
(Reading database ... 149043 files and directories currently installed.)
Unpacking vim-common (from .../vim-common_2%3a7.3.429-2ubuntu2.1_i386.deb) ...
Selecting previously unselected package vim-runtime.
Unpacking vim-runtime (from .../vim-runtime_2%3a7.3.429-2ubuntu2.1_all.deb) ...
Adding 'diversion of /usr/share/vim/vim73/doc/help.txt to /usr/share/vim/vim73/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim73/doc/tags to /usr/share/vim/vim73/doc/tags.vim-tiny by vim-runtime'
Selecting previously unselected package vim.
Unpacking vim (from .../vim_2%3a7.3.429-2ubuntu2.1_i386.deb) ...
Processing triggers for man-db ...
Setting up vim-common (2:7.3.429-2ubuntu2.1) ...
Setting up vim-runtime (2:7.3.429-2ubuntu2.1) ...
Processing /usr/share/vim/addons/doc
Setting up vim (2:7.3.429-2ubuntu2.1) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode.
root@openwrt:~/MT7688#
三、現在可以正常使用vi和vim工具了
root@openwrt:~/MT7688# vim Hello.c
root@openwrt:~/MT7688# vi Hello.c