GithubHelp home page GithubHelp logo

reckyf / linuxmirrors Goto Github PK

View Code? Open in Web Editor NEW

This project forked from supermanito/linuxmirrors

0.0 0.0 0.0 861 KB

GNU/Linux 一键更换国内软件源脚本

Home Page: https://github.com/SuperManito/LinuxMirrors

License: GNU General Public License v2.0

Shell 100.00%

linuxmirrors's Introduction

LinuxMirrors

 

  • GNU/Linux 一键更换国内软件源脚本
  • 本项目旨在为从事计算机相关行业的朋友们提供便利
  • 理论支持所有架构的环境,arm64 环境已经过测试

🏷️点击上方图片可快速跳转至本项目所发布在的其它仓库或博客

更新日志

  • 2021 / 05 / 30 ㅤ新增选择软件源的 WEB 协议功能,修复了一些错误。
  • 2021 / 05 / 05 ㅤ新增关闭防火墙功能。
  • 2021 / 04 / 24 ㅤ新增基于 CentOS 的添加 EPEL 扩展源功能,修复了一些错误。
  • 2021 / 04 / 22 ㅤ重新定义了备份原有源功能,可以通过检测判断是否执行覆盖备份操作。

已适配的 GNU/Linux 发行版 Linux Logo

 Ubuntu  Debian  Kali Linux  Fedora  CentOS
支持的版本 14.04 ~ 21.04 8.0 ~ 10.9 2.0 ~ 2021.1 28 ~ 34 7.0 ~ 8.3

目前仅支持上述基于 Debian 与 Redhat 系的发行版和及其部分衍生版本
同样支持上述版本中拥有相同底层核心的其它发行版,例如 Armbian Kubuntu

脚本当前使用的开源镜像站

镜像站名称 镜像站地址 IPv4 IPv6
1 阿里云 mirrors.aliyun.com
2 腾讯云 mirrors.cloud.tencent.com
3 华为云 mirrors.huaweicloud.com
4 网易 mirrors.163.com ×
5 搜狐 mirrors.sohu.com ×
6 清华大学 mirrors.tuna.tsinghua.edu.cn
7 浙江大学 mirrors.zju.edu.cn ×
8 重庆大学 mirrors.cqu.edu.cn ×
9 兰州大学 mirror.lzu.edu.cn
10 上海交通大学 ftp.sjtu.edu.cn
11 **科学技术大学 mirrors.ustc.edu.cn

如果使用过程中脚本不能正常输出中文内容则可对照此列表使用,顺序与脚本一致

脚本执行流程

  • └ 选择国内源 交互
    • └ 检测如果是 CentOS 选择是否安装/覆盖 EPEL 扩展国内源 交互
  • └ 选择软件源使用的 WEB 协议 交互
  • └ 检测 防火墙 和 SELINUX 如果开启选择是否关闭 交互
  • └ 备份原有源
    • └ 检测如果存在重复的备份文件选择是否覆盖 交互
  • └ 更换国内源
  • └ 选择是否更新软件包 交互
    • └ 选择是否清理已下载的软件包缓存 交互

如何使用

  1. 完整复制下面的命令到终端按回车键即可执行,若无法安装 curl 软件包可复制源码到本地后手动执行。
  2. 为了适配所有环境,建议使用 Root 用户执行脚本,切换命令为 sudo -i ,如遇报错请查看常见问题与帮助。
  3. 如果您使用的环境没有安装或不支持简体中文环境,请通过 SSH客户端工具 使用,否则将无法正确选择交互内容。
  4. 执行脚本过程中会自动备份原有源无需手动备份,期间会在终端输出多个主观选择交互内容,可按回车键快速确认。
  5. 脚本支持在原有源配置错误或者不存在的情况下使用,并且可以重复使用;脚本变更的软件源默认使用 Https 协议
  • GNU/Linux 一键更换国内软件源脚本

    bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)
    

注意:

  • Debian 系 Linux 默认注释了源码仓库和预发布软件源,若需启用可将 list 源文件中相关内容的所在行 取消注释
  • RedHat 系 Linux 配置了所有可以配置的仓库,但有一些仓库默认没有启用,若需启用可将 repo 源文件中的 enabled=0修改成 enabled=1

其它脚本

  • Docker 一键安装脚本

    bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh)
    

注意:脚本集成安装最新版的 Docker EngineDocker Compose,可手动选择 Docker CE源与 Docker Hub源(镜像加速器),支持国内外服务器环境和 ARM架构处理器环境使用。


常见问题与帮助

    1. 如果提示 Command 'curl' not found 则说明当前未安装 curl 软件包,安装命令如下:

      sudo apt install -y curl  或  sudo yum install -y curl
      
    1. 如果提示 bash: /proc/self/fd/11: No such file or directory,请切换至 Root 用户执行。
    1. 如果您想使用 Http 协议 同步软件源可执行下面的命令:

      sed -i 's/http/https/g' /etc/apt/sources.list  或  sed -i 's/http/https/g' /etc/yum.repos.d/*
      

捐助作者

微信赞赏码


项目已设立开源许可协议,传播时需在显著位置标注来源和作者,请尊重本人的知识成果
建议通过命令直接调用脚本,如有意见与建议您可以提交至 Issues,谢谢


如果您觉得这个项目不错的话可以在右上角给颗⭐吗?方便分享给更多的朋友吗?

linuxmirrors's People

Contributors

supermanito avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.