24.无法正常下载资源

问题描述:主要出现在这两个命令上:
1. git clone https://github.com/cartographer-project/cartographer_ros.git
2. sudo apt install liburdfdom-tools如图

在这里插入图片描述

解决方案:换源,即更改source list

https://blog.csdn.net/u010368556/article/details/104965055

  1. 备份源列表
# 首先备份源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
  1. 更改source.list
sudo vim /etc/apt/sources.list
  1. 换源

将原本内容全部替换

Ubuntu 18.04 TLS版本阿里云镜像源:

# https://opsx.alibaba.com/mirror
deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse 
deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse 
deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse 
deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse 
deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse 
 
# 仿照清华镜像源,注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse 
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse 
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse 
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse 
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

4.刷新

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
  1. 如果sudo apt-get update仍然报错

    问题在于DNS没有配置好

    解决方案:

    sudo vi /etc/resolv.conf
    

    向其中添加:

    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
    #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    nameserver 127.0.1.1
    #这里用的是阿里云的DNS服务器
    nameserver 223.5.5.5  
    nameserver 223.6.6.6
    
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值