Ubunto18.04安装完成后没有gcc、make、g++、无法访问域名等解决方法
今天新安装完虚拟机后又安装了Ubunto,然后就碰到了个恶心的事情!就是这是个纯净版,里面好多东西都没有。没有gcc、make等等。按照其他博主的方法都不好使,最后东拼西凑下总算弄好了。
解决方法:
1、打开源列表
输入:sudo gedit /etc/apt/sources.list
2、在打开的文件中删除其他的,添加下面这种源******
#注意:在官网源https://mirrors.ustc.edu.cn/repogen/下载对应版本最新的源,我的版本是18.04
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
## Not recommended
# deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
3、更新源
终端输入:sudo apt update
4、安装gcc
安装gcc终端输入:sudo apt install gcc
安装 make 在终端输入:sudo apt install make
安装 g++ 在终端输入:sudo apt install g++