[Note-05] Ubuntu18.04 安装 vim 时报错 (apt-get install vim error) - 2020-09-27

参考链接:

[解决 The following packages have unmet dependencies: 问题] https://blog.csdn.net/jqw11/article/details/93063985

[ubuntu更改镜像源(软件源)] https://blog.csdn.net/qq_28193019/article/details/89352824

[Ubuntu | 镜像使用帮助 | 清华大学开源软件镜像站] https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

[vim_8.0.1453-1ubuntu1.3_amd64.deb 安装链接]

https://ubuntu.pkgs.org/18.04/ubuntu-updates-main-amd64/vim_8.0.1453-1ubuntu1.3_amd64.deb.html


更新:

Ubuntu18.04继续安装Vim会莫名其妙地报错,升级到Ubuntu20.04,在更改清华镜像源以后,再安装Vim又没有报错了。

Step1: 更改镜像源

ploso@ploso-ThinkPad-T420:~$ sudo apt-get update

[sudo] password for ploso:

Get:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease [242 kB]

Get:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease [88.7 kB]

Get:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease [74.6 kB]

Get:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease [88.7 kB]

Get:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/main amd64 Packages [1,019 kB]

Get:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/main i386 Packages [1,007 kB]

Get:7 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/main Translation-en [516 kB]

Get:8 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/main amd64 DEP-11 Metadata [477 kB]

Get:9 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/main DEP-11 48x48 Icons [118 kB]

Get:10 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/main DEP-11 64x64 Icons [245 kB]

Get:11 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/restricted i386 Packages [9,156 B]

Get:12 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/restricted amd64 Packages [9,184 B]

Get:13 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/restricted Translation-en [3,584 B]

Get:14 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/universe i386 Packages [8,531 kB]

Get:15 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/universe amd64 Packages [8,570 kB]

Get:16 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/universe Translation-en [4,941 kB]

Get:17 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/universe amd64 DEP-11 Metadata [3,287 kB]

Get:18 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/universe DEP-11 48x48 Icons [2,151 kB]

Get:19 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/universe DEP-11 64x64 Icons [8,420 kB]

Get:20 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/multiverse i386 Packages [144 kB]

Get:21 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/multiverse amd64 Packages [151 kB]

Get:22 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/multiverse Translation-en [108 kB]

Get:23 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/multiverse amd64 DEP-11 Metadata [49.7 kB]

Get:24 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/multiverse DEP-11 48x48 Icons [8,931 B]

Get:25 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic/multiverse DEP-11 64x64 Icons [225 kB]

Get:26 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main i386 Packages [748 kB]

Get:27 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 Packages [1,089 kB]

Get:28 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main Translation-en [360 kB]

Get:29 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 DEP-11 Metadata [295 kB]

Get:30 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main DEP-11 48x48 Icons [81.9 kB]

Get:31 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main DEP-11 64x64 Icons [157 kB]

Get:32 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/restricted amd64 Packages [107 kB]

Get:33 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/restricted i386 Packages [12.0 kB]

Get:34 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/restricted Translation-en [23.0 kB]

Get:35 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe amd64 Packages [1,113 kB]

Get:36 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe i386 Packages [1,034 kB]

Get:37 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe Translation-en [348 kB]

Get:38 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [285 kB]

Get:39 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe DEP-11 48x48 Icons [214 kB]

Get:40 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/universe DEP-11 64x64 Icons [464 kB]

Get:41 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/multiverse i386 Packages [9,432 B]

Get:42 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/multiverse amd64 Packages [21.7 kB]

Get:43 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/multiverse Translation-en [6,920 B]

Get:44 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,468 B]

Get:45 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/multiverse DEP-11 48x48 Icons [29 B]

Get:46 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/multiverse DEP-11 64x64 Icons [2,638 B]

Get:47 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/main i386 Packages [7,508 B]

Get:48 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/main amd64 Packages [7,516 B]

Get:49 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/main Translation-en [4,764 B]

Get:50 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/universe i386 Packages [7,724 B]

Get:51 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/universe amd64 Packages [7,736 B]

Get:52 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/universe Translation-en [4,588 B]

Get:53 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [9,288 B]

Get:54 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/universe DEP-11 48x48 Icons [2,809 B]

Get:55 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports/universe DEP-11 64x64 Icons [3,943 B]

Get:56 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main i386 Packages [545 kB]

Get:57 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main amd64 Packages [868 kB]

Get:58 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main Translation-en [269 kB]

Get:59 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main amd64 DEP-11 Metadata [48.9 kB]

Get:60 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main DEP-11 48x48 Icons [28.4 kB]

Get:61 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/main DEP-11 64x64 Icons [62.4 kB]

Get:62 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/restricted amd64 Packages [95.5 kB]

Get:63 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/restricted i386 Packages [6,412 B]

Get:64 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/restricted Translation-en [20.4 kB]

Get:65 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe i386 Packages [642 kB]

Get:66 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe amd64 Packages [708 kB]

Get:67 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe Translation-en [236 kB]

Get:68 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe amd64 DEP-11 Metadata [56.0 kB]

Get:69 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe DEP-11 48x48 Icons [19.8 kB]

Get:70 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/universe DEP-11 64x64 Icons [109 kB]

Get:71 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/multiverse amd64 Packages [8,512 B]

Get:72 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/multiverse i386 Packages [3,884 B]

Get:73 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/multiverse Translation-en [2,908 B]

Get:74 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]

Get:75 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/multiverse DEP-11 48x48 Icons [29 B]

Get:76 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security/multiverse DEP-11 64x64 Icons [2,638 B]

Fetched 50.7 MB in 17s (3,019 kB/s)                                           

Reading package lists... Done


Step2: 安装 Vim

ploso@ploso-ThinkPad-T420:~$ sudo apt-get install vim

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.3) but 2:8.0.1766-1ubuntu1 is to be installed

E: Unable to correct problems, you have held broken packages.



ploso@ploso-ThinkPad-T420:~$ sudo apt-get install vim-common=2:9.0.1453-1ubuntu1.3

Reading package lists... Done

Building dependency tree     

Reading state information... Done

E: Version '2:9.0.1453-1ubuntu1.3' for 'vim-common' was not found

ploso@ploso-ThinkPad-T420:~$ sudo apt-get install vim-common=2:8.0.1453-1ubuntu1.3

Reading package lists... Done

Building dependency tree     

Reading state information... Done

Recommended packages:

  vim | vim-gtk | vim-gtk3 | vim-athena | vim-nox | vim-tiny

The following packages will be REMOVED:

  ubuntu-minimal vim-tiny

The following packages will be DOWNGRADED:

  vim-common

0 upgraded, 0 newly installed, 1 downgraded, 2 to remove and 133 not upgraded.

Need to get 70.6 kB of archives.

After this operation, 1,425 kB disk space will be freed.

Do you want to continue? [Y/n] y

Get:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 vim-common all 2:8.0.1453-1ubuntu1.3 [70.6 kB]

Fetched 70.6 kB in 0s (179 kB/s)     

(Reading database ... 130363 files and directories currently installed.)

Removing ubuntu-minimal (1.425) ...

Removing vim-tiny (2:8.0.1766-1ubuntu1) ...

dpkg: warning: downgrading vim-common from 2:8.0.1766-1ubuntu1 to 2:8.0.1453-1ubuntu1.3

(Reading database ... 130347 files and directories currently installed.)

Preparing to unpack .../vim-common_2%3a8.0.1453-1ubuntu1.3_all.deb ...

Unpacking vim-common (2:8.0.1453-1ubuntu1.3) over (2:8.0.1766-1ubuntu1) ...

Processing triggers for mime-support (3.60ubuntu1) ...

Processing triggers for desktop-file-utils (0.23-3ubuntu2) ...

Setting up vim-common (2:8.0.1453-1ubuntu1.3) ...

Processing triggers for man-db (2.8.4-2) ...

Processing triggers for gnome-menus (3.13.3-11ubuntu2) ...

Processing triggers for hicolor-icon-theme (0.17-2) ...


ploso@ploso-ThinkPad-T420:~$ sudo apt-get install vim

Reading package lists... Done

Building dependency tree     

Reading state information... Done

The following additional packages will be installed:

  vim-runtime

Suggested packages:

  ctags vim-doc vim-scripts

The following NEW packages will be installed:

  vim vim-runtime

0 upgraded, 2 newly installed, 0 to remove and 133 not upgraded.

Need to get 6,589 kB of archives.

After this operation, 32.0 MB of additional disk space will be used.

Do you want to continue? [Y/n] y

Get:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 vim-runtime all 2:8.0.1453-1ubuntu1.3 [5,436 kB]

Get:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 vim amd64 2:8.0.1453-1ubuntu1.3 [1,153 kB]

Fetched 6,589 kB in 3s (2,134 kB/s)

Selecting previously unselected package vim-runtime.

(Reading database ... 130347 files and directories currently installed.)

Preparing to unpack .../vim-runtime_2%3a8.0.1453-1ubuntu1.3_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.3) ...

Selecting previously unselected package vim.

Preparing to unpack .../vim_2%3a8.0.1453-1ubuntu1.3_amd64.deb ...

Unpacking vim (2:8.0.1453-1ubuntu1.3) ...

Processing triggers for man-db (2.8.4-2) ...

Setting up vim-runtime (2:8.0.1453-1ubuntu1.3) ...

Setting up vim (2:8.0.1453-1ubuntu1.3) ...

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

ploso@ploso-ThinkPad-T420:~$



最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,793评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 87,567评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,342评论 0 338
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,825评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,814评论 5 368
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,680评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,033评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,687评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 42,175评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,668评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,775评论 1 332
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,419评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,020评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,978评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,206评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,092评论 2 351
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,510评论 2 343