• 树莓派更新软件源的脚本


    每次树莓派重新刷镜像都要手动换源,太麻烦了。直接整理成脚本。其他linux系统也可以参考

    当前脚本对应raspberry的debain10版本

    #!/bin/bash
    #设置时区上海
    timedatectl set-timezone Asia/Shanghai
    #备份并且更新 软件更新源
    cp /etc/apt/sources.list /etc/apt/sources.list.bak
    echo "deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi" > /etc/apt/sources.list
    echo "deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi" >> /etc/apt/sources.list
    #备份并且更新 系统更新源
    cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak
    echo "deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui" > /etc/apt/sources.list.d/raspi.list
    echo "deb-src http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui" > /etc/apt/sources.list.d/raspi.list
    #同步更新源
    sudo apt-get update
    #更新升级以安装软件包 耗时较长,需要的时候再放开注释
    #sudo apt-get upgrade
    #安装vim,根据需要再放开注释
    sudo apt-get install vim
    #pip换源
    mkdir -p ~/.pip
    touch ~/.pip/pip.conf
    echo "index-url = https://mirrors.aliyun.com/pypi/simple/" > ~/.pip/pip.conf
    

      

      

  • 相关阅读:
    PAT-A 1004. Counting Leaves
    PAT-A 1094. The Largest Generation
    图的邻接表表示及其BFS遍历
    图的邻接表表示及其遍历
    PAT-A 1024. Palindromic Number
    PAT-A 1019. General Palindromic Number
    PAT-B 1007.素数对猜想
    PAT-A 1048. Find Coins
    PAT-A 1037. Magic Coupon
    PAT-A 1099.Build A Binary Search Tree
  • 原文地址:https://www.cnblogs.com/kgtone/p/13874521.html
Copyright © 2020-2023  润新知