问题
在Ubuntu18.10
下安装bochs
的时候出现了这个错误,提示没有安装libgtk2.0-dev
的问题
输入
sudo apt-get install libgtk2.0-dev
仍然无法安装,命令行提示很多依赖需要改变跟安装,自己手动安装后还是无法解决问题,上网搜索了很多博客也没找到解决问题的方法,最后是猜测是不是软件源的问题才发现自己长久以来使用的源跟我的Ubuntu18.10
版本不对应……
方案
问题根源
输入命令,查看自己的Ubuntu
版本跟对应的代号
sudo lsb_release -a
可以发现我的Ubuntu18.10
对应的代号叫做cosmic
而下面是我之前的源,却是xenial
,是16.04
版本的…….(我用了这么久竟然没事)
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
问题解决
去中科大的官网,可以看到这里有个帮忙配置源的地方
点击进去然后选择Ubuntu源帮助
进去后就会发现有很多详细的文档说明跟文档链接,在这里就不罗列了,主要说说这里,原来Ubuntu18.10
是Ubuntu
不再支持的版本了……
另外,中科大还提供了一个软件源配置生成器真的很良心了
最终改回来后的软件源如下
deb https://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu/ cosmic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu/ cosmic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu/ cosmic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu/ cosmic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu/ cosmic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu/ cosmic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu/ cosmic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu/ cosmic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu/ cosmic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu/ cosmic-proposed main restricted universe multiverse
换回来后sudo apt-get update
一下,就可以顺利的执行sudo apt-get install libgtk2.0-dev
命令啦