IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> wsl中安装vim-gnome失败解决方法 -> 正文阅读

[系统运维]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

  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2022-02-06 14:09:05  更:2022-02-06 14:10:02 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/16 5:48:33-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码