Linux更换安装软件源

无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) - 嫖老板 - 博客园

无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 

  • 最近在下载ubantu64位转32的一些库时出现了以下错误,网上查了以下,是由于在下载一些包时,被墙了,所以需要换一下国内的源,
  • 国内有很多源例如:阿里源,网易源,清华源等等。
  • 操作步骤:
  • 备份原来的源:

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

  • 更换源:

      sudo gedit /etc/apt/sources.list

  • 打开文档,把内容全删除,换成你找到的源,保存。
  • 我这里用的是阿里源,我的ubantu版本是16.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

  • 更新源

       sudo apt-get update

  •  复损坏的软件包,尝试卸载出错的包,重新安装正确版本的

       sudo apt-get -f install

  • 更新软件

      sudo apt-get upgrade

  • 其他源我没用过,但是都是一样的道理。
  • 更换后就不会出现上述问题了,下载速度也快了不止一点。

转载:

https://www.cnblogs.com/lizebiao/p/12875410.html

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在Linux服务器上更换软件,可以按照以下步骤进行操作: 1. 打开终端,以管理员权限登录到服务器。 2. 备份当前的软件配置文件,以防止出现问题。可以使用以下命令进行备份: ``` sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak ``` 3. 打开软件配置文件以进行编辑。可以使用文本编辑器(如vi或nano)进行编辑: ``` sudo vi /etc/apt/sources.list ``` 4. 在编辑器中,你可以看到当前的软件配置。根据你的需求,选择一个新的软件。 例如,如果你想将软件更换为阿里云的镜像站点,可以将配置文件中的内容替换为: ``` deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse ``` 注意:上述示例为Ubuntu系统的软件配置,如果你使用的是其他Linux发行版,请根据对应的官方文档进行配置。 5. 保存并退出编辑器。 6. 更新软件列表,使更改生效: ``` sudo apt update ``` 7. 完成后,你可以使用新的软件进行软件包的安装和更新。 请记住,在更换软件之前,最好先了解所选软件的可靠性和稳定性。同时,确保你的服务器与所选软件的版本兼容。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值