ubuntu-源配置

2021/7/5 7:21:47

本文主要是介绍ubuntu-源配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

Ubuntu 源配置

1、首先切换到root用户

初始化 root  密码

ic@ic: sudo passwd root
输入两次密码
***
***

ic@ic: su root
root@ic:~ #

完成 root 的切换

2、备份原有源

cp /etc/apt/sources.list /etc/apt/sources.list.bak

3、替换源

替换sources.list文件

sudo vi /etc/apt/sources.list

由于原生的vi 并不好用可以安装vim

sudo vim /etc/apt/sources.list
# 使用vim的话 sudo:vim:command not found  
sudo apt-get install vim

sudo vim /etc/apt/sources.list
# 使用系统自带的文本编辑工具

sudo gedit  /etc/apt/sources.list

清华源

ubuntu | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

中科大源

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-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
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-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

阿里源

deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe 
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe 
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe 
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe 
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe

4、更新软件列表包

sudo apt-get update
sudo apt-get upgrade


这篇关于ubuntu-源配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程