Ubuntu 18.04修改apt镜像源
官方镜像源实在慢的可怜,,,只怪国内墙太高,挂梯子都过不去了
遂直接换个镜像源吧
- 找到 sources.list文件
先备份一下,免得改崩
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
- 修改可读权限
chmod 777 /etc/apt/sources.list
- 修改文件内容
vim /etc/apt/sources.list
将原文件中的内容全部注释掉
加入以下内容(以阿里云镜像源为例)
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
#deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
#deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
#deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
#deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
#deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
如图所示



之后就大功告成了

安装GCC
sudo apt install build-essential
该命令将安装包括gcc,g ++和make。
验证是否安装成功
gcc --version

之后就完成了
本文介绍了如何在Ubuntu 18.04上更改慢速的官方apt镜像源,以提高更新速度。通过备份并修改sources.list文件,采用阿里云镜像源为例,详细说明了替换过程。接着,教程指导安装GCC,并验证安装是否成功。
6819

被折叠的 条评论
为什么被折叠?



