首页 > 系统相关 >嵌入式LINUX开发系列

嵌入式LINUX开发系列

时间:2024-03-21 12:30:55浏览次数:22  
标签:jessie 系列 cn mirrors LINUX 嵌入式 tsinghua edu tuna

LINUX系列文章目录

第一章 ARM板子如何替换debian镜像源

文章目录


前言

当你做嵌入式开发过程中拿到一个开发板,遇到apt update,发现无法成功,镜像源无法使用,这样的话大大增加了开发难度。最近一个项目遇到这个问题,搜寻网络却无法得到有效答案,本人作为一名嵌入式开发工程师,在这里总结了一下,希望对大家做开发有所帮助,共同进步,这是我的第一篇文章,都是干货,希望大家多多支持,点点关注订阅,持续更新,致力于有效解决我们项目开发过程中遇到问题。


一、镜像源是什么?

下面先普及一下概念(此部分引用别人的哦)

  1. 源: 源就是来源,就是你安装软件时,程序从哪里获取软件包(安装程序在你的机器上,但需要安装的东西在软件源服务器上)。
  2. 镜像:镜像原意是光学里指的物体在镜面所成之像。引用到电脑网络上,一个网站的镜像是指对一个网站内容的拷贝。镜像通常用于为相同信息内容提供不同的源,特别是在下载量大的时候提供了一种可靠的网络连接。
  3. 镜像源:镜像源就是把官方的源作为一个镜像,你可以在这下载软件。比如ubuntu官方源在国外,下载软件可能会很慢,这时候就需要换成国内的镜像源。

二、问题复现

root@zynq:/etc/apt# apt-get update
Ign http://mirrors.tuna.tsinghua.edu.cn jessie InRelease
Ign http://mirrors.tuna.tsinghua.edu.cn jessie-updates InRelease
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/updates InRelease
Ign http://mirrors.tuna.tsinghua.edu.cn jessie Release.gpg
Ign http://mirrors.tuna.tsinghua.edu.cn jessie-updates Release.gpg
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/updates Release.gpg
Ign http://mirrors.tuna.tsinghua.edu.cn jessie Release
Ign http://mirrors.tuna.tsinghua.edu.cn jessie-updates Release
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/updates Release
Err http://mirrors.tuna.tsinghua.edu.cn jessie/main Sources
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie/contrib Sources
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie/non-free Sources
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie/main armhf Packages
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie/contrib armhf Packages
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie/non-free armhf Packages
  404  Not Found [IP: 101.6.15.130 80]
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/contrib Translation-en_US
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/contrib Translation-en
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/main Translation-en_US
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/main Translation-en
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/non-free Translation-en_US
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/non-free Translation-en
Err http://mirrors.tuna.tsinghua.edu.cn jessie-updates/main Sources
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie-updates/contrib Sources
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie-updates/non-free Sources
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie-updates/main armhf Packages
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie-updates/contrib armhf Packages
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie-updates/non-free armhf Packages
  404  Not Found [IP: 101.6.15.130 80]
Ign http://mirrors.tuna.tsinghua.edu.cn jessie-updates/contrib Translation-en_US
Ign http://mirrors.tuna.tsinghua.edu.cn jessie-updates/contrib Translation-en
Ign http://mirrors.tuna.tsinghua.edu.cn jessie-updates/main Translation-en_US
Ign http://mirrors.tuna.tsinghua.edu.cn jessie-updates/main Translation-en
Ign http://mirrors.tuna.tsinghua.edu.cn jessie-updates/non-free Translation-en_US
Ign http://mirrors.tuna.tsinghua.edu.cn jessie-updates/non-free Translation-en
Err http://mirrors.tuna.tsinghua.edu.cn jessie/updates/main Sources
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie/updates/contrib Sources
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie/updates/non-free Sources
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie/updates/main armhf Packages
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie/updates/contrib armhf Packages
  404  Not Found [IP: 101.6.15.130 80]
Err http://mirrors.tuna.tsinghua.edu.cn jessie/updates/non-free armhf Packages
  404  Not Found [IP: 101.6.15.130 80]
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/updates/contrib Translation-en_US
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/updates/contrib Translation-en
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/updates/main Translation-en_US
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/updates/main Translation-en
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/updates/non-free Translation-en_US
Ign http://mirrors.tuna.tsinghua.edu.cn jessie/updates/non-free Translation-en
W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie/main/source/Sources  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie/contrib/source/Sources  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie/non-free/source/Sources  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie/main/binary-armhf/Packages  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie/contrib/binary-armhf/Packages  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie/non-free/binary-armhf/Packages  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie-updates/main/source/Sources  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie-updates/contrib/source/Sources  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie-updates/non-free/source/Sources  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie-updates/main/binary-armhf/Packages  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie-updates/contrib/binary-armhf/Packages  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian/dists/jessie-updates/non-free/binary-armhf/Packages  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/jessie/updates/main/source/Sources  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/jessie/updates/contrib/source/Sources  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/jessie/updates/non-free/source/Sources  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/jessie/updates/main/binary-armhf/Packages  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/jessie/updates/contrib/binary-armhf/Packages  404  Not Found [IP: 101.6.15.130 80]

W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/jessie/updates/non-free/binary-armhf/Packages  404  Not Found [IP: 101.6.15.130 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.

我们用apt-get update时候发现更新失败,查询发现国内debian镜像源已经不维护这个jessie版本的源,所以导致更新失败。怎么去解决呢?毫无疑问,这个时候需要换一个国内持续维护的debian镜像源

三、更换镜像源步骤

  1. 先选择一个目前还在维护合适的镜像源:https://mirrors.tuna.tsinghua.edu.cn/help/debian/
  2. 在arm开发板上更换国内镜像源,这里我选择的debian 11 bullseye。
    # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
    
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
    
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
    
    deb https://security.debian.org/debian-security bullseye-security main contrib non-free
    # deb-src https://security.debian.org/debian-security bullseye-security main contrib non-free
    
  3. 执行apt update,之后会发现报错,信息如下:
    在这里插入图片描述
    解决方法:
    cd /usr/lib/apt/methods
    ln -s http https
    
    再次执行apt update,发现又出现报错,信息如下:
    在这里插入图片描述
    解决方法:
    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 6ED0E7B82643E131 605C66F00D6C9793 112695A0E562B32A 54404762BBB6E853
    
    最后再次执行:apt update 无报错。
  4. 执行apt upgrade,问题解决。

总结

以上就是今天要讲的内容,本文简单介绍了ARM板子debian镜像源替换方法,一个好的稳定的镜像源可以有效提升我们嵌入式开发效率。希望大家点点关注,订阅,持续更新,张工致力于有效解决我们项目开发过程中遇到的问题。

标签:jessie,系列,cn,mirrors,LINUX,嵌入式,tsinghua,edu,tuna
From: https://blog.csdn.net/qq_32706229/article/details/136902725

相关文章

  • 初识 Linux 操作系统_实验案例一
    实验案例一:安装Ubuntu操作系统1、实验环境    BDQN公司部分员工使用的Windows操作系统的笔记本式计算机频繁遭受到病毒.木马的威胁,公司要求管理员小王近期将这些员工的系统更换为Ubuntu操作系统。在进行前期准备工作时,需要公司现有的系统管理员尽快掌握Ubuntu操作......
  • Linux离线安装Docker-Oracle_11g
    拉取oracle11g镜像dockerpullregistry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g创建11g容器dockerrun-d-p1521:1521--nameoracle11gregistry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g查看容器是否创建成功dockerps-a导出oracle容器,查看正在运......
  • linux apache 使用记录
    1、安装集成phpyuminstallhttpdyuminstallphpsystemctlrestarthttpd2、开启url重写功能修改/etc/httpd/conf/httpd.conf:A开启重写模块:LoadModulerewrite_modulemodules/mod_rewrite.soIncludeconf.modules.d/*.confB修改参数 AllowOverrideAllC网站根目录添......
  • Linux系统下的文件描述符fd详解
    文章目录文件描述符本作者从代码及源码的角度来总结探究文件描述符fd参考:韦东山Linux嵌入式视频文件描述符Linux系统下一切皆文件。文件描述符是操作系统中用来唯一标识一个已打开文件的整数。本质上来说就是索引,即根据索引值寻找到对应的文件,可对其进行相应......
  • [DPDK]Linux平台上DPDK入门指南(一)
    [DPDK]Linux平台上DPDK入门指南(一)1.1简介1.1.1文档地图1.2系统要求1.2.1X86上预先设置BIOS1.2.2编译DPDK1.2.3运行DPDK应用程序系统软件在Linux环境中使用Hugepages预留Hugepages给DPDK使用DPDK使用Hugepages配置内存用于DPDK使用1.3使用源码编译DPDK......
  • 排查linux 定时任务cron crontab
    简介:我在使用shell编程来实现DDNS服务的注册更新工作。但是老发现cron不正常工作。为所有的排查做个指导记录吧。一:检查cron编写*/1****echohello>>/root/out.log每分钟执行一次写入临时文件。#查看cron日志journalctl--no-pager--sincetoday-g'cron'Ma......
  • Linux系统连接手机USB网络共享后无法联网
    如题,离线安装了ubantu系统的服务器的所有网口都设置了静态ip,通过usb口外接手机usb网络共享后,通过ipaddr命令查看,发现usb0网卡没有拿到ip,通过尝试可以用以下命令解决sudodhclientusb0usb0重新向dhcp服务器请求ip,ipaddr看到获取到ip后可以pingbaidu.com试下,如果还......
  • 集合系列(十) -Set接口详解
    一、摘要关于Set接口,在实际开发中,其实很少用到,但是如果你出去面试,它可能依然是一个绕不开的话题。言归正传,废话咱们也不多说了,相信使用过Set集合类的朋友都知道,Set集合的特点主要有:元素不重复、存储无序的特点。啥意思呢?你可以理解为,向一个瓶子里面扔东西,这些东西......
  • 集合系列(五) -TreeMap详解
    一、摘要在集合系列的第一章,咱们了解到,Map的实现类有HashMap、LinkedHashMap、TreeMap、IdentityHashMap、WeakHashMap、Hashtable、Properties等等。本文主要从数据结构和算法层面,探讨TreeMap的实现。二、简介JavaTreeMap实现了SortedMap接口,也就是说会按照key的大......
  • linux下常见服务的搭建搜集 —— 筑梦之路
    安装JDK官网下载地址:https://www.oracle.com/java/technologies/downloads#创建目录mkdir/usr/local/java/#解压tar-zxvfjdk-8u333-linux-x64.tar.gz-C/usr/local/java/#配置环境变量vim/etc/profileexportexportJAVA_HOME=/usr/local/java/jdk1.8.0_2......