Debian12 安装vim

文章讲述了在新安装Vim时,作者建议先更换为中国清华大学的镜像源。遇到依赖问题时,通过aptitude命令管理器解决了ncurses-base和ncurses-term的版本冲突,最终成功安装了Vim。
摘要由CSDN通过智能技术生成

新装vim,先改国内源,推荐清华,阿里的实在拉跨。

修改/etc/apt/sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
 
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
 
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
 
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
 

随后开始安装vim

sudo apt-get purge vim-common
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install aptitude
sudo aptitude install vim

为什么用aptitude?我在卸载vim-common,死活装不上vim,如下提示

The following packages have unmet dependencies:
 ncurses-base : Breaks: vim-common (< 2:9.0.1000-2) but 2:8.1.0875-5+deb10u5 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

可能的原因是有损坏的包,对此情况那就适合aptitude 命令了。

他会先给你一个解决方案:

The following NEW packages will be installed:
  vim vim-common{a} vim-runtime{a} xxd{a} 
0 packages upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 7,395 kB of archives. After unpacking 33.7 MB will be used.
The following packages have unmet dependencies:
 ncurses-term : Breaks: vim-common (< 2:9.0.1000-2) but 2:8.1.0875-5+deb10u5 is to be installed
 ncurses-base : Breaks: vim-common (< 2:9.0.1000-2) but 2:8.1.0875-5+deb10u5 is to be installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:                              
1)     vim [Not Installed]                                                              
2)     vim-common [Not Installed]                                                       

     Leave the following dependencies unresolved:                                       
3)     vim-runtime recommends vim | vim-gtk | vim-gtk3 | vim-athena | vim-nox | vim-tiny



Accept this solution? [Y/n/q/?]

说是保持原样,显然不是我要的,回车看下一个方案:

The following actions will resolve these dependencies:

     Downgrade the following packages:                                    
1)     ncurses-base [6.4-4 (now) -> 6.1+20181013-2+deb10u3 (oldoldstable)]
2)     ncurses-term [6.4-4 (now) -> 6.1+20181013-2+deb10u3 (oldoldstable)]



Accept this solution? [Y/n/q/?] 

似乎也不是我要的,继续回车

The following packages will be DOWNGRADED:
  ncurses-base ncurses-term 
The following NEW packages will be installed:
  vim vim-common{a} vim-runtime{a} xxd{a} 
0 packages upgraded, 4 newly installed, 2 downgraded, 0 to remove and 0 not upgraded.
Need to get 8,144 kB of archives. After unpacking 33.6 MB will be used.
Do you want to continue? [Y/n/?] Y

这个对了,选Y回车。vim安装成功。。。。。 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值