如何安装 gvim?

如何安装 gvim?

我已完成以下操作:

sudo apt-get install vim-gnome

但我得到以下信息:

vim-gnome : Depends: libruby1.8 (>= 1.8.7.352) but 1.8.6.111-2ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.

我已经搞定了:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

我的 /etc/apt/sources.list 文件的内容:

deb http://us.archive.ubuntu.com/ubuntu/ oneiric main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric main restricted
deb http://us.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ oneiric universe
deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric universe
deb http://us.archive.ubuntu.com/ubuntu/ oneiric-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ oneiric multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric multiverse
deb http://us.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse
deb http://security.ubuntu.com/ubuntu oneiric-security main restricted
deb-src http://security.ubuntu.com/ubuntu oneiric-security main restricted
deb http://security.ubuntu.com/ubuntu oneiric-security universe
deb-src http://security.ubuntu.com/ubuntu oneiric-security universe
deb http://security.ubuntu.com/ubuntu oneiric-security multiverse
deb-src http://security.ubuntu.com/ubuntu oneiric-security multiverse

但一切都无济于事。我总是得到上述相同的错误。

我该如何解决?

答案1

在 Ubuntu 20.04 上(自vim-gnome已于 19.10 中删除):

sudo apt install vim-gtk3

答案2

以下对我有用:

运行这个

sudo apt-get update 

然后运行

sudo apt-get install vim-gnome 

答案3

您需要检查您的来源。我看到可以libruby1.8 1.8.7.352-2通过,main但您拥有的最新版本似乎是:1.8.6.111-2ubuntu1。这可能意味着您dist-upgrade失败了,或者您仍然需要update您的来源。

$ apt-cache policy libruby1.8
libruby1.8:
  Installed: 1.8.7.352-2
  Candidate: 1.8.7.352-2
  Version table:
 *** 1.8.7.352-2 0
        500 http://archive.ubuntu.com/ubuntu/ oneiric/main amd64 Packages
        100 /var/lib/dpkg/status

答案4

对我有用的

sudo apt remove vim-common
sudo apt-get install vim-gnome

相关内容