当前位置: 首页 > 工具软件 > vim-mode > 使用案例 >

ubuntu18.04的vim无法使用---解决方法

松景铄
2023-12-01
bell@r311:~/r311/android/device/softwinner/lily-perf$ sudo apt install vim
[sudo] password for bell: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 vim : Depends: vim-common (= 2:8.0.1453-1ubuntu1) but 2:8.0.1453-1ubuntu1.4 is to be installed
E: Unable to correct problems, you have held broken packages.

使用时发现无法用vim,sudo apt install vim 报错,仔细看了下是 vim-common版本问题,需要先卸载老版本 vim-common,再安装vim

卸载老版本vim,执行

sudo apt autoremove vim-common
bell@r311:~/r311/android/device/softwinner/lily-perf$ sudo apt autoremove vim-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  fonts-liberation2 fonts-opensymbol gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-gudev-1.0 gir1.2-udisks-2.0 grilo-plugins-0.3-base gstreamer1.0-gtk3
  libboost-date-time1.65.1 libboost-filesystem1.65.1 libboost-iostreams1.65.1 libboost-locale1.65.1 libcdr-0.1-1 libclucene-contribs1v5 libclucene-core1v5 libcmis-0.5-5v5 libcolamd2
  libdazzle-1.0-0 libe-book-0.1-1 libedataserverui-1.2-2 libeot0 libepubgen-0.1-1 libetonyek-0.1-1 libevent-2.1-6 libexiv2-14 libfreerdp-client2-2 libfreerdp2-2 libgc1c2
  libgee-0.8-2 libgexiv2-2 libgom-1.0-0 libgpgmepp6 libgpod-common libgpod4 liblangtag-common liblangtag1 liblirc-client0 liblua5.3-0 libmediaart-2.0-0 libmspub-0.1-1
  libodfgen-0.1-1 libqqwing2v5 libraw16 librevenge-0.0-0 libsgutils2-2 libssh-4 libsuitesparseconfig5 libvncclient1 libwinpr2-2 libxapian30 libxmlsec1 libxmlsec1-nss lp-solve
  media-player-info python3-mako python3-markupsafe syslinux syslinux-common syslinux-legacy ubuntu-minimal usb-creator-common vim-common vim-tiny xxd
0 upgraded, 0 newly installed, 64 to remove and 1 not upgraded.
After this operation, 46.8 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 164594 files and directories currently installed.)
Removing fonts-liberation2 (2.00.1-7~18.04.2) ...
Removing fonts-opensymbol (2:102.10+LibO6.0.7-0ubuntu0.18.04.10) ...
Removing gir1.2-gst-plugins-base-1.0:amd64 (1.14.5-0ubuntu1~18.04.1) ...
Removing gir1.2-gstreamer-1.0:amd64 (1.14.5-0ubuntu1~18.04.1) ...
Removing gir1.2-gudev-1.0:amd64 (1:232-2) ...
Removing usb-creator-common (0.3.5ubuntu18.04.2) ...
Removing gir1.2-udisks-2.0:amd64 (2.7.6-3ubuntu0.2) ...
Removing grilo-plugins-0.3-base:amd64 (0.3.5-1ubuntu1) ...
Removing gstreamer1.0-gtk3:amd64 (1.14.5-0ubuntu1~18.04.1) ...
Removing libcmis-0.5-5v5 (0.5.1+git20160603-3build2) ...
Removing libboost-date-time1.65.1:amd64 (1.65.1+dfsg-0ubuntu5) ...
Removing libboost-filesystem1.65.1:amd64 (1.65.1+dfsg-0ubuntu5) ...
Removing libboost-iostreams1.65.1:amd64 (1.65.1+dfsg-0ubuntu5) ...
Removing libboost-locale1.65.1:amd64 (1.65.1+dfsg-0ubuntu5) ...
Removing libcdr-0.1-1:amd64 (0.1.4-1build1) ...
Removing libclucene-contribs1v5:amd64 (2.3.3.4+dfsg-1) ...
Removing libclucene-core1v5:amd64 (2.3.3.4+dfsg-1) ...
Removing lp-solve (5.5.0.15-4build1) ...
Removing libcolamd2:amd64 (1:5.1.2-2) ...
Removing libdazzle-1.0-0:amd64 (3.28.1-1) ...
Removing libe-book-0.1-1:amd64 (0.1.3-1) ...
Removing libedataserverui-1.2-2:amd64 (3.28.5-0ubuntu0.18.04.3) ...
Removing libeot0:amd64 (0.01-5) ...
Removing libepubgen-0.1-1:amd64 (0.1.0-2ubuntu1) ...
Removing libetonyek-0.1-1:amd64 (0.1.7-3) ...
Removing libevent-2.1-6:amd64 (2.1.8-stable-4build1) ...
Removing libgexiv2-2:amd64 (0.10.8-1) ...
Removing libexiv2-14:amd64 (0.25-3.1ubuntu0.18.04.5) ...
Removing libfreerdp-client2-2:amd64 (2.2.0+dfsg1-0ubuntu0.18.04.1) ...
Removing libfreerdp2-2:amd64 (2.2.0+dfsg1-0ubuntu0.18.04.1) ...
Removing libgc1c2:amd64 (1:7.4.2-8ubuntu1) ...
Removing libgee-0.8-2:amd64 (0.20.1-1) ...
Removing libgom-1.0-0:amd64 (0.3.3-4) ...
Removing libgpgmepp6:amd64 (1.10.0-1ubuntu2) ...
Removing libgpod-common (0.8.3-11) ...
Removing libgpod4:amd64 (0.8.3-11) ...
Removing liblangtag1:amd64 (0.6.2-1) ...
Removing liblangtag-common (0.6.2-1) ...
Removing liblirc-client0:amd64 (0.10.0-2) ...
Removing liblua5.3-0:amd64 (5.3.3-1ubuntu0.18.04.1) ...
Removing libmediaart-2.0-0:amd64 (1.9.4-1) ...
Removing libmspub-0.1-1:amd64 (0.1.4-1) ...
Removing libodfgen-0.1-1:amd64 (0.1.6-2) ...
Removing libqqwing2v5:amd64 (1.3.4-1.1) ...
Removing libraw16:amd64 (0.18.8-1ubuntu0.3) ...
Removing librevenge-0.0-0:amd64 (0.0.4-6ubuntu2) ...
Removing libsgutils2-2 (1.42-2ubuntu1.18.04.1) ...
Removing libssh-4:amd64 (0.8.0~20170825.94fa1e38-1ubuntu0.7) ...
Removing libsuitesparseconfig5:amd64 (1:5.1.2-2) ...
Removing libvncclient1:amd64 (0.9.11+dfsg-1ubuntu1.3) ...
Removing libwinpr2-2:amd64 (2.2.0+dfsg1-0ubuntu0.18.04.1) ...
Removing libxapian30:amd64 (1.4.5-1ubuntu0.1) ...
Removing libxmlsec1-nss:amd64 (1.2.25-1build1) ...
Removing libxmlsec1:amd64 (1.2.25-1build1) ...
Removing media-player-info (23-1) ...
Removing python3-mako (1.0.7+ds1-1) ...
Removing python3-markupsafe (1.0-1build1) ...
Removing syslinux (3:6.03+dfsg1-2) ...
Removing syslinux-common (3:6.03+dfsg1-2) ...
Removing syslinux-legacy (2:3.63+dfsg-2ubuntu9) ...
Removing ubuntu-minimal (1.417.4) ...
Removing vim-tiny (2:8.0.1453-1ubuntu1.4) ...
Removing vim-common (2:8.0.1453-1ubuntu1.4) ...
Removing xxd (2:8.0.1453-1ubuntu1.4) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
Processing triggers for udev (237-3ubuntu10.38) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for dbus (1.12.2-1ubuntu1.2) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for fontconfig (2.12.6-0ubuntu2) ...
Processing triggers for mime-support (3.60ubuntu1) ...

继续安装vim,成功

bell@r311:~/r311/android/device/softwinner/lily-perf$ sudo apt install vim
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  vim-common vim-runtime xxd
Suggested packages:
  ctags vim-doc vim-scripts
The following NEW packages will be installed:
  vim vim-common vim-runtime xxd
0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded.
Need to get 6708 kB of archives.
After this operation, 32.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 xxd amd64 2:8.0.1453-1ubuntu1 [49.2 kB]
Get:1 http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 xxd amd64 2:8.0.1453-1ubuntu1 [49.2 kB]                                                                                   
Get:2 http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 vim-common all 2:8.0.1453-1ubuntu1 [70.4 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 vim-runtime all 2:8.0.1453-1ubuntu1 [5437 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 vim amd64 2:8.0.1453-1ubuntu1 [1152 kB]                                                                                   
Fetched 6682 kB in 1min 13s (91.5 kB/s)                                                                                                                                               
Selecting previously unselected package xxd.
(Reading database ... 163498 files and directories currently installed.)
Preparing to unpack .../xxd_2%3a8.0.1453-1ubuntu1_amd64.deb ...
Unpacking xxd (2:8.0.1453-1ubuntu1) ...
Selecting previously unselected package vim-common.
Preparing to unpack .../vim-common_2%3a8.0.1453-1ubuntu1_all.deb ...
Unpacking vim-common (2:8.0.1453-1ubuntu1) ...
Selecting previously unselected package vim-runtime.
Preparing to unpack .../vim-runtime_2%3a8.0.1453-1ubuntu1_all.deb ...
Adding 'diversion of /usr/share/vim/vim80/doc/help.txt to /usr/share/vim/vim80/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim80/doc/tags to /usr/share/vim/vim80/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:8.0.1453-1ubuntu1) ...
Selecting previously unselected package vim.
Preparing to unpack .../vim_2%3a8.0.1453-1ubuntu1_amd64.deb ...
Unpacking vim (2:8.0.1453-1ubuntu1) ...
Setting up xxd (2:8.0.1453-1ubuntu1) ...
Setting up vim-common (2:8.0.1453-1ubuntu1) ...
Setting up vim-runtime (2:8.0.1453-1ubuntu1) ...
Setting up vim (2:8.0.1453-1ubuntu1) ...
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
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

 

 类似资料: