Linux   发布时间:2022-03-31  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了各种镜像源的更换大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

各种镜像源的更换 树莓派 本次采用的是一块树莓派3B-PLUS的板子 树莓派的版本信息确定 查看树莓派的版本信息的几种方式: uname -a Linux raspberrypi 4.19.57-v7+ #1244 SMP Thu Jul 4 18:45:25 BST 2019 armv7l GNU/Linux lsb_release -a No LSB modules are available

各种镜像源的更换

树莓派

本次采用的是一块树莓派3B-PLUS的板子

树莓派的版本信息确定

查看树莓派的版本信息的几种方式:

  • uname -a@H_489_43@

    Linux raspBerrypi 4.19.57-v7+ #1244 SMP Thu Jul 4 18:45:25 BST 2019 armv7l GNU/Linux
  • lsb_release -a@H_489_43@

    No LSB modules are available.
    DiStributor ID: Raspbian
    Description:    Raspbian GNU/Linux 10 (buster)
    Release:    10
    Codename:   buster
  • 使用软件查看:

    • 通过命令下载:sudo apt install screenfetch@H_489_43@

    • 下载成功后,输入命令screenfetch@H_489_43@,查看

        .,;:cc;,.    .,;::c:,.    [email protected],ooolcloooo:  oooooccloo:    OS: Raspbian 10 buster
       .looooc;;:ol  :oc;;:ooooo    Kernel: armv7l Linux 4.19.57-v7+
         ;oooooo:,ooooooc.     Uptime: 11m
           .,:;.       .;:;.       Packages: 1446
           .... ..‘‘‘‘‘. ....        SHell: 858
         .‘‘.   ..‘‘‘‘‘.  ..‘‘.      DE: LXDE 
         ..  .....    .....  ..      WM: OpenBox
        .  .‘‘‘‘‘‘‘  .‘‘‘‘‘‘.  .     cpu: ARMv7 rev 4 (v7l) @ 1.4GHz
      .‘‘ .‘‘‘‘‘‘‘‘  .‘‘‘‘‘‘‘. ‘‘.   RAM: 183MiB / 874R_388_11845@iB
      ‘‘‘  ‘‘‘‘‘‘‘    .‘‘‘‘‘‘  ‘‘‘  
      .    ........... ...    ..  
        ....    ‘‘‘‘‘‘‘‘.   .‘‘.    
        ‘‘‘‘‘.  ‘‘‘‘‘‘‘‘. .‘‘‘‘‘    
         ‘‘‘‘‘.  .‘‘‘‘‘. .‘‘‘‘‘.    
          ..‘‘.     .    .‘‘..      
                .‘‘‘‘‘‘‘            
                 ......   

总结

从上述三种方式中,可以看出其操作系统为Raspbian 10 buster@H_489_43@,有了这条信息,即可进行后续的换源操作。

换源

可参清华站的使用帮助即可:@H_723_262@https://mirrors.tuna.tsinghua.edu.cn/help/raspbian/

  • 进入上述网站;

  • 使用说明@H_489_43@栏中选择之前查询的树莓派操作系统的版本,例如我的为Debian 10@H_489_43@

    • 千万不要选错版本!

  • 编辑 /etc/apt/sources.list@H_489_43@文件,将其中的内容修改为:

    deb http://@H_131_312@mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib
    deb-src http://@H_131_312@mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib
  • 再编辑/etc/apt/sources.list.d/raspi.list@H_489_43@文件,将其中内容修改为:

    deb http://@H_131_312@mirrors.tuna.tsinghua.edu.cn/raspBerrypi/ buster main ui
  • 编辑镜像站后,使用sudo apt-get update@H_489_43@命令,更新软件源列表,同时检查方才的编辑是否正确。

Anaconda换源

参照清华站使用帮助:@H_723_262@https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

  • 找到用户目录下的 .condarc@H_489_43@文件

  • 将其内容修改为:

    chAnnels:
      - defaults
    show_chAnnel_urls: true
    default_chAnnels:
      - https://@H_131_312@mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
      - https://@H_131_312@mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
      - https://@H_131_312@mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
    custom_chAnnels:  # 这部分内容有需要再添加即可,一般也不需要添加
      conda-forge: https://@H_131_312@mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      msys2: https://@H_131_312@mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      bioconda: https://@H_131_312@mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      menpo: https://@H_131_312@mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      pytorch: https://@H_131_312@mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      simpleitk: https://@H_131_312@mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  • 若想恢复源,则通过输入命令:conda config --remove-key chAnnels@H_489_43@即可

PIP/PIP3的换源

参照清华站使用帮助:@H_723_262@https://mirrors.tuna.tsinghua.edu.cn/help/pypi/

  • 临时使用,推荐

    • 命令为pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 包的名字@H_489_43@

  • 永久:

    pip install pip -U
    pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
    • 如果您到 pip 认源的网络连接较差,临时使用本镜像站来升级 pip:

    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U

@H_723_262@https://jingyan.baidu.com/album/ca00d56c144644e99febcf4d.html?picindex=3

@H_723_262@https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/

@H_723_262@https://mirrors.tuna.tsinghua.edu.cn/help/raspbian/

@H_723_262@https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

@H_723_262@https://mirrors.tuna.tsinghua.edu.cn/help/pypi/

@H_801_589@

大佬总结

以上是大佬教程为你收集整理的各种镜像源的更换全部内容,希望文章能够帮你解决各种镜像源的更换所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。