Ubuntu换源——解决sudo apt-get install 的 connect(111:拒绝连接)错误

在sudo apt-get install wireshark
下载时,报错 connect(111:拒绝连接)
原因是源的问题
需要更换源并更新
第一次接触“Ubuntu换源”特分享之
步骤如下:
1.备份原源文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
2.修改更新源
sudo gedit /etc/apt/sources.list
3.删除原有的源,将新的源的代码复制粘贴进去
源的版本要和Ubuntu的版本一致,除以下的阿里源,还有很多,如网易源,有些高校还有自己学校的源
Ubuntu12.04源
阿里源
deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse

Ubuntu16.04源
阿里源
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main

deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main

deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe

4.最后 sudo apt-get update .

你可能感兴趣的:(学习笔记)