Ubuntu 18.04修改默认源

安装Ubuntu 18.04后,使用国外源太慢了,修改为国内源会快很多。

修改阿里源为Ubuntu 18.04默认的源

备份/etc/apt/sources.list

#备份
cp /etc/apt/sources.list /etc/apt/sources.list.bak

在/etc/apt/sources.list文件前面添加如下条目

#添加阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

最后执行如下命令更新源

##更新
sudo apt-get update
sudo apt-get upgrade
  • 1
  • 2
  • 3

另外其他几个国内源如下: 
中科大源

##中科大源
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

163源

##163源
deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse

清华源

##清华源
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

原文地址:https://www.cnblogs.com/zmblx/p/Ubuntu.html

时间: 2024-10-01 14:40:57

Ubuntu 18.04修改默认源的相关文章

Ubuntu 18.04修改默认源为国内源

安装Ubuntu 18.04后,使用国外源太慢了,修改为国内源会快很多. 修改阿里源为Ubuntu 18.04默认的源 备份/etc/apt/sources.list#备份cp /etc/apt/sources.list /etc/apt/sources.list.bak 在/etc/apt/sources.list文件前面添加如下条目#添加阿里源deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multi

Ubuntu 18.04 修改默认源为国内源

1.备份/etc/apt/sources.list #备份 cp /etc/apt/sources.list /etc/apt/sources.list.bak 2.在/etc/apt/sources.list文件前面添加如下条目 #添加阿里源 deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-s

Ubuntu 18.04修改ip步骤

Ubuntu 18.04修改ip步骤: 注:配置/etc/network/interfaces已无用 vi /etc/netplan/50-cloud-init.yaml network:ethernets:eno1:addresses: [10.0.0.2/24]dhcp4: nogateway4: 10.0.0.1 :wq 注:1.":"后要有空格2.Ubuntu 18.04的网卡名已改为eno1.eno2.... 使配置生效(不需重启服务器): netplan apply 原文地

ubuntu 18.04 修改 固定ip

写在前面,问:为什么要固定ip.答:要知道固定IP的好处多多,随意搬动,固定共享地址,不怕断网等等 首先,我们要选取一个局域网内的IP,方法如下: 1.选取IP号段,一般是路由器DCHP以外的IP地址 比如:DCHP动态IP地址由192.168.1.11~255,那我们可以选取192.168.1.10(保证此IP没有被其他设备占用) 2.路由器内设置要固定的IP地址和Mac码,其中Mac码可以找一个正在用的IP下分配好的来用,然后起个名字记录下来 第二步,(Ctrl+Alt+T)打开命令行,if

Ubuntu 18.04 更换apt源

1.备份apt源 cp /etc/apt/sources.list /etc/apt/sources.list.bak 2.修改apt源 sudo gedit /etc/apt/sources.list 3.删除所有,添加阿里源 #添加阿里源 deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-se

Ubuntu 18.04 更换阿里源

1.备份 sudo cp /etc/apt/source.list /etc/apa/source.list.bak 2.编辑 sudo vim /etc/apt/source.list 3.修改内容 deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted uni

Ubuntu 18.04 修改swap分区大小

1.查看初始状态 查看原先swap大小 [email protected]:~# free -h 总计 已用 空闲 共享 缓冲/缓存 可用 内存: 62G 417M 38G 3.0M 23G 61G 交换: 2.0G 0B 2.0G [email protected]:~# 原先swap文件位置 [email protected]:~# swapon -s 文件名 类型 大小 已用 权限 /swapfile1 file 12582908 0 -2 [email protected]:~# 2.创

Ubuntu 18.04 安装java8

OpenJDK和Oracle Java有两个主要的实现,几乎没有区别,只是Oracle Java有一些额外的商业功能. 安装OpenJDK OpenJDK 10,Java平台的开源实现是Ubuntu 18.04中的默认Java开发和运行时. 一旦OpenJDK 11达到GA,它将成为Ubuntu 18.04的默认版本. 安装OpenJDK非常简单直接. 安装OpenJDK 10 JDK sudo apt install default-jdk 安装OpenJDK 8 JDK sudo apt i

Ubuntu 18.04配置OpenCV 4.2.0

目录 Step 1: 安装OpenCV的依赖包 Step 2: 下载OpenCV 4.2.0和OpenCV Contrib 4.2.0 Step 3: 使用cmake构建库 Step 4: 使用make构建库 Step 5: 修改opencv4.pc文件 Step 6: 在.bashrc文件中添加PKG_CONFIG_PATH Step 7: 使用C++代码进行验证 本文主要介绍在Ubuntu 18.04中从源码安装配置OpenCV,并使用一个简单的例子验证是否安装成功: 具体安装配置步骤,参考