【树莓派】Raspbian 中国软件镜像源 今天药忘吃喽~ 2022-09-03 15:26 203阅读 0赞 中国科学技术大学 Raspbian [http://mirrors.ustc.edu.cn/raspbian/raspbian/][http_mirrors.ustc.edu.cn_raspbian_raspbian] 阿里云 Raspbian [http://mirrors.aliyun.com/raspbian/raspbian/][http_mirrors.aliyun.com_raspbian_raspbian] 清华大学 Raspbian [http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/][http_mirrors.tuna.tsinghua.edu.cn_raspbian_raspbian] 华中科技大学 Raspbian [http://mirrors.hustunique.com/raspbian/raspbian/][http_mirrors.hustunique.com_raspbian_raspbian] Arch Linux ARM [http://mirrors.hustunique.com/archlinuxarm/][http_mirrors.hustunique.com_archlinuxarm] 华南农业大学(华南用户) Raspbian [http://mirrors.scau.edu.cn/raspbian/][http_mirrors.scau.edu.cn_raspbian] 大连东软信息学院源(北方用户) Raspbian [http://mirrors.neusoft.edu.cn/raspbian/raspbian/][http_mirrors.neusoft.edu.cn_raspbian_raspbian] 重庆大学源(中西部用户) Raspbian [http://mirrors.cqu.edu.cn/Raspbian/raspbian/][http_mirrors.cqu.edu.cn_Raspbian_raspbian] 中山大学 已跳转至中国科学技术大学源 Raspbian [http://mirror.sysu.edu.cn/raspbian/raspbian/][http_mirror.sysu.edu.cn_raspbian_raspbian] 新加坡国立大学 Raspbian [http://mirror.nus.edu.sg/raspbian/raspbian][http_mirror.nus.edu.sg_raspbian_raspbian] 牛津大学 Raspbian [http://mirror.ox.ac.uk/sites/archive.raspbian.org/archive/raspbian/][http_mirror.ox.ac.uk_sites_archive.raspbian.org_archive_raspbian] 韩国KAIST大学 Raspbian [http://ftp.kaist.ac.kr/raspbian/raspbian/][http_ftp.kaist.ac.kr_raspbian_raspbian] -------------------- ### 使用说明 ### #### 备份原始文件(可选步骤) #### <table> <tbody> <tr> <td> <div> 1 </div> <div> 2 </div> </td> <td> <div> <div> <code>sudo</code> <code>cp</code> <code>/etc/apt/sources</code> <code>.list </code> <code>/etc/apt/sources</code> <code>.list.bak</code> </div> <div> <code>sudo</code> <code>cp</code> <code>/etc/apt/sources</code> <code>.list.d</code> <code>/raspi</code> <code>.list </code> <code>/etc/apt/sources</code> <code>.list.d</code> <code>/raspi</code> <code>.list.bak</code> </div> </div> </td> </tr> </tbody> </table> #### 编辑软件源配置 #### 1、编辑 /etc/apt/sources.list 文件(软件源),参考如下命令: <table> <tbody> <tr> <td> <div> 1 </div> </td> <td> <div> <div> <code>sudo</code> <code>nano </code> <code>/etc/apt/sources</code> <code>.list</code> </div> </div> </td> </tr> </tbody> </table> 2、删除原文件所有内容,**buster** 系统用以下内容取代: <table> <tbody> <tr> <td> <div> 1 </div> <div> 2 </div> </td> <td> <div> <div> <code>deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib</code> </div> <div> <code>deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib</code> </div> </div> </td> </tr> </tbody> </table> 注:网址末尾的raspbian重复两次是必须的。因为Raspbian的仓库中除了APT软件源还包含其他代码。APT软件源不在仓库的根目录,而在raspbian/子目录下。 **stretch** 系统用以下内容取代: <table> <tbody> <tr> <td> <div> 1 </div> <div> 2 </div> </td> <td> <div> <div> <code>deb http://mirrors.sysu.edu.cn/raspbian/raspbian/ stretch main contrib non-free</code> </div> <div> <code>deb-src http://mirrors.sysu.edu.cn/raspbian/raspbian/ stretch main contrib non-free</code> </div> </div> </td> </tr> </tbody> </table> **jessie** 用以下内容取代: <table> <tbody> <tr> <td> <div> 1 </div> <div> 2 </div> </td> <td> <div> <div> <code>deb http://mirrors.sysu.edu.cn/raspbian/raspbian/ jessie main contrib non-free</code> </div> <div> <code>deb-src http://mirrors.sysu.edu.cn/raspbian/raspbian/ jessie main contrib non-free</code> </div> </div> </td> </tr> </tbody> </table> **wheezy** 用以下内容取代: <table> <tbody> <tr> <td> <div> 1 </div> <div> 2 </div> </td> <td> <div> <div> <code>deb http://mirrors.sysu.edu.cn/raspbian/raspbian/ wheezy main contrib non-free</code> </div> <div> <code>deb-src http://mirrors.sysu.edu.cn/raspbian/raspbian/ wheezy main contrib non-free</code> </div> </div> </td> </tr> </tbody> </table> Ctrl+o 保存,之后回车确认,然后 Ctrl+x 退出。 #### 编辑系统源配置 #### 1、编辑 /etc/apt/sources.list.d/raspi.list 文件(系统更新源),参考如下命令: <table> <tbody> <tr> <td> <div> 1 </div> </td> <td> <div> <div> <code>sudo</code> <code>nano </code> <code>/etc/apt/sources</code> <code>.list.d</code> <code>/raspi</code> <code>.list</code> </div> </div> </td> </tr> </tbody> </table> 2、同样修改首行网址,修改后文件如下: <table> <tbody> <tr> <td> <div> 1 </div> <div> 2 </div> <div> 3 </div> </td> <td> <div> <div> <code>deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui</code> </div> <div> <code># Uncomment line below then 'apt-get update' to enable 'apt-get source'</code> </div> <div> <code>#deb-src http://archive.raspberrypi.org/debian/ stretch main ui</code> </div> </div> </td> </tr> </tbody> </table> jessie、wheezy 版本的系统按照之前修改软件源的的规则修改即可,这里不再赘述。 Ctrl+o 保存,之后回车确认,然后 Ctrl+x 退出。 #### 更新 #### 配置好了可以尝试更新,用下面的命令分别更新软件源列表、软件版本和系统内核版本,完整的更新过程需要等挺久的。一般只用更新软件源列表即可。 <table> <tbody> <tr> <td> <div> 1 </div> <div> 2 </div> <div> 3 </div> <div> 4 </div> <div> 5 </div> <div> 6 </div> <div> 7 </div> </td> <td> <div> <div> <code>#更新软件源列表</code> </div> <div> <code>sudo</code> <code>apt-get update</code> </div> <div> <code>#更新软件版本</code> </div> <div> <code>sudo</code> <code>apt-get upgrade</code> </div> <div> <code>sudo</code> <code>apt-get dist-upgrade</code> </div> <div> <code>#更新系统内核</code> </div> <div> <code>sudo</code> <code>rpi-update</code> </div> </div> </td> </tr> </tbody> </table> 如果需要,你可以执行以下命令将Raspbian public key加入你的 apt-get keyring : <table> <tbody> <tr> <td> <div> 1 </div> </td> <td> <div> <div> <code>wget http:</code> <code>//archive</code> <code>.raspbian.org</code> <code>/raspbian</code> <code>.public.key -O - | </code> <code>sudo</code> <code>apt-key add -</code> </div> </div> </td> </tr> </tbody> </table> [http_mirrors.ustc.edu.cn_raspbian_raspbian]: http://mirrors.ustc.edu.cn/raspbian/raspbian/ [http_mirrors.aliyun.com_raspbian_raspbian]: http://mirrors.aliyun.com/raspbian/raspbian/ [http_mirrors.tuna.tsinghua.edu.cn_raspbian_raspbian]: http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ [http_mirrors.hustunique.com_raspbian_raspbian]: http://mirrors.hustunique.com/raspbian/raspbian/ [http_mirrors.hustunique.com_archlinuxarm]: http://mirrors.hustunique.com/archlinuxarm/ [http_mirrors.scau.edu.cn_raspbian]: http://mirrors.scau.edu.cn/raspbian/ [http_mirrors.neusoft.edu.cn_raspbian_raspbian]: http://mirrors.neusoft.edu.cn/raspbian/raspbian/ [http_mirrors.cqu.edu.cn_Raspbian_raspbian]: http://mirrors.cqu.edu.cn/Raspbian/raspbian/ [http_mirror.sysu.edu.cn_raspbian_raspbian]: http://mirror.sysu.edu.cn/raspbian/raspbian/ [http_mirror.nus.edu.sg_raspbian_raspbian]: http://mirror.nus.edu.sg/raspbian/raspbian [http_mirror.ox.ac.uk_sites_archive.raspbian.org_archive_raspbian]: http://mirror.ox.ac.uk/sites/archive.raspbian.org/archive/raspbian/ [http_ftp.kaist.ac.kr_raspbian_raspbian]: http://ftp.kaist.ac.kr/raspbian/raspbian/
还没有评论,来说两句吧...