Linux系统—Ubuntu1804更换apt源

本文介绍如何在Ubuntu18.04系统中更换apt源,包括备份源配置文件、编辑并替换文件内容为中科大源或阿里源等步骤,并提供了更新配置文件及软件的方法。

1.备份源配置文件

sudo cp /etc/apt/sources.list /etc/apt/sources_init.list

2.编辑apt源文件

#方式一(远程连接)
sudo install vim /etc/apt/sources.list
#方式二(远程连接):编辑结束后按Ctrl+x,选择是否保存后退出
sudo nano /etc/apt/sources.list
#方式三(宿主机)
sudo gedit /etc/apt/sources.list

3.替换文件内容

原文件内容

#deb cdrom:[Ubuntu 18.04.5 LTS _Bionic Beaver_ - Release amd64 (20200806.1)]/ bionic main restricted
  
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb h
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值