Ubuntu版本16:The following packages have unmet dependencies?,ubuntuunmet,最近不知道设置了什么,现
Ubuntu版本16:The following packages have unmet dependencies?,ubuntuunmet,最近不知道设置了什么,现
最近不知道设置了什么,现在在ubuntu16.04上使用apt安装软件都失败:
$ sudo apt-get upgrade Reading package lists... DoneBuilding dependency tree Reading state information... DoneYou might want to run 'apt-get -f install' to correct these.The following packages have unmet dependencies: libglib2.0-dev : Depends: libglib2.0-0 (= 2.48.1-1~ubuntu16.04.1) but 2.48.2-0ubuntu1 is installed Depends: libglib2.0-bin (= 2.48.1-1~ubuntu16.04.1)E: Unmet dependencies. Try using -f.
ps: sudo apt install ipython也是报同样的错误
然后我按照提示进行修复:
$ sudo apt-get -f installExtracting templates from packages: 100%Preconfiguring packages ...dpkg: error processing package libglib2.0-dev (--remove): package is in a very bad inconsistent state; you should reinstall it before attempting a removalErrors were encountered while processing: libglib2.0-devE: Sub-process /usr/bin/dpkg returned an error code (1)
准备卸载libglib2.0-dev,却无法卸载,而且报错信息和上面一样,提示reinstall,但是apt命令没有reinstall参数
$ sudo apt-get remove libglib2.0-dev...After this operation, 10.5 MB disk space will be freed.Do you want to continue? [Y/n] ydpkg: error processing package libglib2.0-dev (--remove): package is in a very bad inconsistent state; you should reinstall it before attempting a removalErrors were encountered while processing: libglib2.0-devE: Sub-process /usr/bin/dpkg returned an error code (1)
libglib2.0-dev处于bad inconsistent state所以要reinstall,但是却无法卸载那么该怎么进行reinstall,google以及在其他社区找了很久也没找到答案,请问这是什么原因?
补充
$ sudo apt-get checkReading package lists... DoneBuilding dependency tree Reading state information... DoneYou might want to run 'apt-get -f install' to correct these.The following packages have unmet dependencies: libglib2.0-dev : Depends: libglib2.0-0 (= 2.48.1-1~ubuntu16.04.1) but 2.48.2-0ubuntu1 is installed Depends: libglib2.0-bin (= 2.48.1-1~ubuntu16.04.1)E: Unmet dependencies. Try using -f.
解决方案
之前google的姿势不对,问题的关键是 package is in a very bad inconsistent state; you should reinstall it before attempting a removal。
参考资料强制卸载sudo dpkg --remove --force-remove-reinstreq libglib2.0-dev,但是又出现了新的问题,由于包不兼容python3,所以还要sudo ln -s /usr/bin/python2.7 /usr/bin/python,这样一来就只能使用python2.7,然后各种软件配置重新改。
比如youcompleteme要改成python3等等。
let g:ycm_server_python_interpreter = '/usr/bin/python3'let g:ycm_python_binary_path = '/usr/bin/python3'
libglib2.0-dev 依赖于 libglib2.48.1-1 和 libglib2.0-bin
但是你系统已经安装了libglib2.48.2-0 > 2.48.1-1 版本高了些
把 libglib2.48.2-0 卸载掉,使用sudo apt-get install package=version命令安装指定版本的libglib
编橙之家文章,
相关内容
- pyqt GUI类,继承自QTableWidget鼠标滚轮失效,pyqtqtablewid
- pyspider分布式控制某一工程的工作节点数量?,pyspide
- pyqt,tablewidget,单元格内容变化单元格背景颜色变化一
- python 调用selenium加载时间过长,pythonselenium,本人py新手
- 怎样防止对Python字符串变量转义,python字符串转义,例如
- keep-alive的http会话中用新的cookie、user-agent发起请求的结
- python暴力破解密码的问题,python暴力破解密码,我用自己
- Windows上Python3 pip安装出现UnicodeDecodeError,,我在通过pi
- pyqt tablewidget,实现一个快速定位到某一行并显示功能,
- python变量作用域的嵌套问题?,python变量嵌套,a=1def f
评论关闭