栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

wsl中安装vim-gnome失败解决方法

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

wsl中安装vim-gnome失败解决方法

文章目录

遇到问题解决方法参考

遇到问题
azheng@lishizheng:/mnt/e/shizheng_coding/fluent_python_reading_books$ sudo apt-get install vim-gnome
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-gnome : Depends: vim-gui-common (= 2:7.4.052-1ubuntu3.1) but 2:8.1.2269-1ubuntu5.7 is to be installed
             Depends: vim-common (= 2:7.4.052-1ubuntu3.1) but 2:8.1.2269-1ubuntu5.7 is to be installed
             Depends: vim-runtime (= 2:7.4.052-1ubuntu3.1) but 2:8.1.2269-1ubuntu5.7 is to be installed
             Depends: libperl5.18 (>= 5.18.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
解决方法

备份源文件

$sudo cp -i /etc/apt/sources.list /etc/apt/sources.list_backup

然后用vim打开/etc/apt/sources.list,替换源。

vim /etc/apt/sources.list

vim的具体用法就不赘述了

替换国内的源

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

发现错误

Err:11 http://ppa.launchpad.net/pkg-vim/vim-daily/ubuntu focal Release
  404  Not Found [IP: 91.189.95.85 80]

使用下面命令,删掉对应的ppa

先找到ppa所在的目录cd /etc/apt/sources.list.d/
然后删除对应的list

azheng@lishizheng:/mnt/e/shizheng_coding/fluent_python_reading_books$ cd  /etc/apt/sources.list.d/
azheng@lishizheng:/etc/apt/sources.list.d$ ls
pkg-vim-ubuntu-vim-daily-focal.list       ubuntu-desktop-ubuntu-ubuntu-make-focal.list
pkg-vim-ubuntu-vim-daily-focal.list.save  ubuntu-desktop-ubuntu-ubuntu-make-focal.list.save
azheng@lishizheng:/etc/apt/sources.list.d$ sudo rm pkg-vim-ubuntu-vim-daily-focal.list
azheng@lishizheng:/etc/apt/sources.list.d$ ls
pkg-vim-ubuntu-vim-daily-focal.list.save      ubuntu-desktop-ubuntu-ubuntu-make-focal.list.save
ubuntu-desktop-ubuntu-ubuntu-make-focal.list
azheng@lishizheng:/etc/apt/sources.list.d$ sudo rm pkg-vim-ubuntu-vim-daily-focal.list.save
azheng@lishizheng:/etc/apt/sources.list.d$ ls
ubuntu-desktop-ubuntu-ubuntu-make-focal.list  ubuntu-desktop-ubuntu-ubuntu-make-focal.list.save

然后再update就没事了

azheng@lishizheng:/etc/apt/sources.list.d$ sudo apt-get update
Hit:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
Hit:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease
Hit:3 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease
Hit:4 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease
Hit:5 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease
Reading package lists... Done

接下来再安装vim-gnome

azheng@lishizheng:/etc/apt/sources.list.d$ sudo apt-get install vim-gnome
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  vim-gnome
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 13.0 kB of archives.
After this operation, 171 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 vim-gnome all 2:8.0.1453-1ubuntu1.8 [13.0 kB]
Fetched 13.0 kB in 0s (64.3 kB/s)
Selecting previously unselected package vim-gnome.
(Reading database ... 92518 files and directories currently installed.)
Preparing to unpack .../vim-gnome_2%3a8.0.1453-1ubuntu1.8_all.deb ...
Unpacking vim-gnome (2:8.0.1453-1ubuntu1.8) ...
Setting up vim-gnome (2:8.0.1453-1ubuntu1.8) ...
参考

解决Ubuntu 安装vim 的Package vim has no installation candidate问题,100%有效
更换源
Ubuntu如何添加删除PPA

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/724875.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号