ubuntu安装vim报错:vim : Depends: libpython3.5 (>= 3.5.0~b1) but it is not going to be installed

ubuntu安装vim报错:vim : Depends: libpython3.5 (>= 3.5.0~b1) but it is not going to be installed

1、换国内的源

  1. 打开网址,复制 国内阿里源
  2. 在宿主主机/opt目录创建一个sources.list文件
    a. 粘贴 阿里源进去
    b. 使用docker cp /opt/sources.list ubuntu:/etc/apt/,将ubuntu中的sources.list文件替换掉
    c. 进入ubuntu查看是否替换成功:cat /etc/apt/sources.list
  3. 直接粘贴源
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

2、执行以下操作

  1. 执行:apt-get update
  2. 执行:apt-get install -y 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: libpython3.5 (>= 3.5.0~b1) but it is not going to be installed
       Depends: libtinfo5 (>= 6) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

  1. 解决方法:
    a. 执行:apt-get install libtinfo5
    b. 如果出现
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  sysvinit
26 upgraded, 63 newly installed, 6 to remove and 292 not upgraded.
Need to get 14.3 MB/15.0 MB of archives.
After this operation, 21.1 MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
 ?] 

c. 输入:Yes, do as I say!
d. 再执行:apt-get install libpython3.5 ,输入y
e. 最后安装vim:apt-get install -y vim,完成

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值