Ubuntu 将apt-get修改为163的源或阿里的源

一.修改为163.com的源

ubuntu16.04,ubuntu14.04 gedit找不到命令

1)进入Ubuntu系统,打开终端,输入代码:

sudo apt-get remove gedit
sudo apt-get install gedit
1:编辑文件

gedit /etc/apt/sources.list

进行编辑只能在虚拟机的终端才可以,不可以在SecureCRT编辑

2:将文件的信息修改为如下:
deb http://mirrors.163.com/ubuntu/ precise main universe restricted multiverse 
deb-src http://mirrors.163.com/ubuntu/ precise main universe restricted multiverse 
deb http://mirrors.163.com/ubuntu/ precise-security universe main multiverse restricted 
deb-src http://mirrors.163.com/ubuntu/ precise-security universe main multiverse restricted 
deb http://mirrors.163.com/ubuntu/ precise-updates universe main multiverse restricted 
deb http://mirrors.163.com/ubuntu/ precise-proposed universe main multiverse restricted 
deb-src http://mirrors.163.com/ubuntu/ precise-proposed universe main multiverse restricted 
deb http://mirrors.163.com/ubuntu/ precise-backports universe main multiverse restricted 
deb-src http://mirrors.163.com/ubuntu/ precise-backports universe main multiverse restricted 
deb-src http://mirrors.163.com/ubuntu/ precise-updates universe main multiverse restricted
3:apt清除原先的配置并更新
apt-get clean
apt-get update
apt-get upgrade
4:测试安装
apt-get install mysql
5:使用图形界面操作
想要换成163的源的话,可以使用图形界面的方式去:
 
----->  Ubuntu Software Center   
----->  Ubuntu Software  
----->  Download from  
-----> choose ‘Other…’ 
-----> choose ‘China   
-----> mirrors.163.com   
-----> Choose server’
-----> Close

其实它的原理就是修改/etc/apt/sources.list文件为163对应的url

二.修改为aliyun.com的源

1:编辑文件

gedit /etc/apt/sources.list

2:将文件的信息修改为如下:
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
3:apt清除原先的配置并更新
apt-get clean
apt-get update
apt-get upgrade
4:测试安装
apt-get install mysql
5:使用图形界面操作
想要换成163的源的话,可以使用图形界面的方式去:
 
----->  Ubuntu Software Center   
----->  Ubuntu Software  
----->  Download from  
-----> choose ‘Other…’ 
-----> choose ‘China   
-----> mirrors.aliyun.com 
-----> Choose server’
-----> Close

其实它的原理就是修改/etc/apt/sources.list文件为mirrors.aliyun.com对应的url

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值