今天笔者在windows上装linux双系统,选用的ubuntu,由于第> 一次用,因此出现了这个问题。linux
如题,安装个gcc一直要求我要装依赖,如图
接下来我又开始一个个安装那些依赖,好比 sudo apt-get install libc6-dev
,而后又报依赖出错。web
解决方法ubuntu
这个问题出在了源的配置上,由于我装的源配置的系统版本代号出问题了。vim
查询系统版本代号windows
lsb_release -a
例:bash
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal
这里的focal就是版本代号,记下或复制svg
看源列表
打开https://wiki.ubuntu.org.cn/%E6%BA%90%E5%88%97%E8%A1%A8
复制上面的模板
例:spa
deb http://cn.archive.ubuntu.com/ubuntu/ willy main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ willy-security main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ willy-updates main restricted universe multiverse deb http://cn.archive.ubuntu.com/ubuntu/ willy-backports main restricted universe multiverse ##測試版源 deb http://cn.archive.ubuntu.com/ubuntu/ willy-proposed main restricted universe multiverse #源碼 deb-src http://cn.archive.ubuntu.com/ubuntu/ willy main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ willy-security main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ willy-updates main restricted universe multiverse deb-src http://cn.archive.ubuntu.com/ubuntu/ willy-backports main restricted universe multiverse ##測試版源 deb-src http://cn.archive.ubuntu.com/ubuntu/ willy-proposed main restricted universe multiverse
接下来把里面的willy所有换成本身的版号,好比把所有willy换成focalrest
调用命令打开配置包源的文件
推荐先备份:code
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
调用命令打开配置包源的文件:
sudo vim /etc/apt/sources.list
在vim操做文件
输入如下指令
sudo apt-get update
sudo apt-get upgrade