Skip to content

Commit

Permalink
新增适配 Armbian 操作系统 & 调整部分软件源
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperManito committed Feb 3, 2024
1 parent c1f9c20 commit 8ab91f7
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 127 deletions.
35 changes: 28 additions & 7 deletions ChangeMirrors.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
## Author: SuperManito
## Modified: 2024-01-31
## Modified: 2024-02-03
## License: MIT
## GitHub: https://github.com/SuperManito/LinuxMirrors
## Website: https://linuxmirrors.cn
Expand All @@ -18,10 +18,9 @@ mirror_list_default=(
"北京大学@mirrors.pku.edu.cn"
"浙江大学@mirrors.zju.edu.cn"
"南京大学@mirrors.nju.edu.cn"
"重庆大学@mirrors.cqu.edu.cn"
"兰州大学@mirror.lzu.edu.cn"
"上海交通大学@mirror.sjtu.edu.cn"
"哈尔滨工业大学@mirrors.hit.edu.cn"
"重庆邮电大学@mirrors.cqupt.edu.cn"
"中国科学技术大学@mirrors.ustc.edu.cn"
"中国科学院软件研究所@mirror.iscas.ac.cn"
)
Expand Down Expand Up @@ -112,15 +111,17 @@ mirror_list_edu=(
"上海科技大学@mirrors.shanghaitech.edu.cn"
"南方科技大学@mirrors.sustech.edu.cn"
"南京邮电大学@mirrors.njupt.edu.cn"
"南京工业大学@mirrors.njtech.edu.cn"
"电子科技大学@mirrors.uestc.cn"
"北京交通大学@mirror.bjtu.edu.cn"
"北京邮电大学@mirrors.bupt.edu.cn"
"齐鲁工业大学@mirrors.qlu.edu.cn"
"华南农业大学@mirrors.scau.edu.cn"
"西安交通大学@mirrors.xjtu.edu.cn"
"江西理工大学@mirrors.jxust.edu.cn"
"重庆邮电大学@mirrors.cqupt.edu.cn"
"南阳理工学院@mirror.nyist.edu.cn"
"武昌首义学院@mirrors.wsyu.edu.cn"
"哈尔滨工业大学@mirrors.hit.edu.cn"
"北京外国语大学@mirrors.bfsu.edu.cn"
"中国科学技术大学@mirrors.ustc.edu.cn"
"西北农林科技大学@mirrors.nwafu.edu.cn"
Expand Down Expand Up @@ -169,6 +170,7 @@ SYSTEM_ALPINE="Alpine"
File_LinuxRelease=/etc/os-release
File_RedHatRelease=/etc/redhat-release
File_DebianVersion=/etc/debian_version
File_ArmbianRelease=/etc/armbian-release
File_OpenCloudOSRelease=/etc/opencloudos-release
File_openEulerRelease=/etc/openEuler-release
File_ArchRelease=/etc/arch-release
Expand All @@ -177,6 +179,8 @@ File_AlpineRelease=/etc/alpine-release
## 定义软件源相关文件或目录
File_DebianSourceList=/etc/apt/sources.list
File_DebianSourceListBackup=/etc/apt/sources.list.bak
File_ArmbianSourceList=/etc/apt/sources.list.d/armbian.list
File_ArmbianSourceListBackup=/etc/apt/sources.list.d/armbian.list.bak
Dir_DebianExtendSource=/etc/apt/sources.list.d
Dir_DebianExtendSourceBackup=/etc/apt/sources.list.d.bak
File_ArchMirrorList=/etc/pacman.d/mirrorlist
Expand Down Expand Up @@ -793,7 +797,11 @@ function BackupOriginalMirrors() {
case "${SYSTEM_FACTIONS}" in
"${SYSTEM_DEBIAN}")
# /etc/apt/sources.list
BackupFile $File_DebianSourceList $File_DebianSourceListBackup "list"
BackupFile $File_DebianSourceList $File_DebianSourceListBackup "sources.list"
## Armbian
if [ -f $File_ArmbianRelease ]; then
BackupFile $File_ArmbianSourceList $File_ArmbianSourceListBackup "armbian.list"
fi
;;
"${SYSTEM_REDHAT}" | "${SYSTEM_OPENCLOUDOS}" | "${SYSTEM_OPENEULER}")
# /etc/yum.repos.d
Expand All @@ -820,6 +828,11 @@ function RemoveOriginMirrors() {
case "${SYSTEM_FACTIONS}" in
"${SYSTEM_DEBIAN}")
[ -f $File_DebianSourceList ] && sed -i '1,$d' $File_DebianSourceList
[ -d $Dir_DebianExtendSource ] || mkdir -p $Dir_DebianExtendSource
## Armbian
if [ -f $File_ArmbianRelease ]; then
[ -f $File_ArmbianSourceList ] && sed -i '1,$d' $File_ArmbianSourceList
fi
;;
"${SYSTEM_REDHAT}")
if [ ! -d $Dir_YumRepos ]; then
Expand Down Expand Up @@ -928,6 +941,10 @@ function ChangeMirrors() {
case "${SYSTEM_FACTIONS}" in
"${SYSTEM_DEBIAN}")
DiffFile $File_DebianSourceListBackup $File_DebianSourceList
## Armbian
if [ -f $File_ArmbianRelease ]; then
DiffFile $File_ArmbianSourceListBackup $File_ArmbianSourceList
fi
;;
"${SYSTEM_REDHAT}" | "${SYSTEM_OPENCLOUDOS}" | "${SYSTEM_OPENEULER}")
DiffDir $Dir_YumReposBackup $Dir_YumRepos
Expand Down Expand Up @@ -1094,8 +1111,8 @@ function UpgradeSoftware() {
## 运行结束
function RunEnd() {
echo -e "\n------ 脚本执行结束 ------"
echo -e "\n\033[1;34mPowered by linuxmirrors.cn\033[0m\n"
echo -e "\n---------- 脚本执行结束 ----------"
echo -e "\n\033[1;34mPowered by https://linuxmirrors.cn\033[0m\n"
}
##############################################################################
Expand Down Expand Up @@ -1182,6 +1199,10 @@ deb ${basic_url} ${source_suffix}
# deb-src ${basic_url} ${source_suffix}" >>$File_DebianSourceList
;;
esac
## Armbian
if [ -f $File_ArmbianRelease ]; then
echo "deb ${WEB_PROTOCOL}://${SOURCE}/armbian ${SYSTEM_VERSION_CODENAME} main ${SYSTEM_VERSION_CODENAME}-utils ${SYSTEM_VERSION_CODENAME}-desktop" >>$File_DebianSourceList
fi
}
## 更换基于 RedHat 系 Linux 发行版软件源
Expand Down
4 changes: 2 additions & 2 deletions DockerInstallation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -698,14 +698,14 @@ function CheckVersion() {
## 运行结束
function RunEnd() {
echo -e "\n------ 脚本执行结束 ------"
echo -e "\n ------ 脚本执行结束 ------"
echo -e ' \033[0;1;35;95m┌─\033[0;1;31;91m──\033[0;1;33;93m──\033[0;1;32;92m──\033[0;1;36;96m──\033[0;1;34;94m──\033[0;1;35;95m──\033[0;1;31;91m──\033[0;1;33;93m──\033[0;1;32;92m──\033[0;1;36;96m──\033[0;1;34;94m──\033[0;1;35;95m──\033[0;1;31;91m──\033[0;1;33;93m──\033[0;1;32;92m──\033[0;1;36;96m┐\033[0m'
echo -e ' \033[0;1;31;91m│▞\033[0;1;33;93m▀▖\033[0m \033[0;1;32;92m▙▗\033[0;1;36;96m▌\033[0m \033[0;1;31;91m▗\033[0;1;33;93m▐\033[0m \033[0;1;34;94m│\033[0m'
echo -e ' \033[0;1;33;93m│▚\033[0;1;32;92m▄\033[0m \033[0;1;36;96m▌\033[0m \033[0;1;34;94m▌▛\033[0;1;35;95m▀▖\033[0;1;31;91m▞▀\033[0;1;33;93m▖▙\033[0;1;32;92m▀▖\033[0;1;36;96m▌▘\033[0;1;34;94m▌▝\033[0;1;35;95m▀▖\033[0;1;31;91m▛▀\033[0;1;33;93m▖▄\033[0;1;32;92m▜▀\033[0m \033[0;1;36;96m▞\033[0;1;34;94m▀▖\033[0;1;35;95m│\033[0m'
echo -e ' \033[0;1;32;92m│▖\033[0m \033[0;1;36;96m▌\033[0;1;34;94m▌\033[0m \033[0;1;35;95m▌▙\033[0;1;31;91m▄▘\033[0;1;33;93m▛▀\033[0m \033[0;1;32;92m▌\033[0m \033[0;1;34;94m▌\033[0m \033[0;1;35;95m▌▞\033[0;1;31;91m▀▌\033[0;1;33;93m▌\033[0m \033[0;1;32;92m▌▐\033[0;1;36;96m▐\033[0m \033[0;1;34;94m▖▌\033[0m \033[0;1;35;95m▌\033[0;1;31;91m│\033[0m'
echo -e ' \033[0;1;36;96m│▝\033[0;1;34;94m▀\033[0m \033[0;1;35;95m▝▀\033[0;1;31;91m▘▌\033[0m \033[0;1;32;92m▝▀\033[0;1;36;96m▘▘\033[0m \033[0;1;35;95m▘\033[0m \033[0;1;31;91m▘▝\033[0;1;33;93m▀▘\033[0;1;32;92m▘\033[0m \033[0;1;36;96m▘▀\033[0;1;34;94m▘▀\033[0m \033[0;1;35;95m▝\033[0;1;31;91m▀\033[0m \033[0;1;33;93m│\033[0m'
echo -e ' \033[0;1;34;94m└─\033[0;1;35;95m──\033[0;1;31;91m──\033[0;1;33;93m──\033[0;1;32;92m──\033[0;1;36;96m──\033[0;1;34;94m──\033[0;1;35;95m──\033[0;1;31;91m──\033[0;1;33;93m──\033[0;1;32;92m──\033[0;1;36;96m──\033[0;1;34;94m──\033[0;1;35;95m──\033[0;1;31;91m──\033[0;1;33;93m──\033[0;1;32;92m┘\033[0m'
echo -e " \033[1;34mPowered by linuxmirrors.cn\033[0m\n"
echo -e " \033[1;34mPowered by linuxmirrors.cn\033[0m\n"
}
## 处理命令选项
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,19 @@
<td align="center">all</td>
</tr>
<tr>
<td><a href="https://access.redhat.com/products/red-hat-enterprise-linux" target="_blank"><img src="./docs/assets/images/icon/redhat.svg" width="16" height="16" style="vertical-align: -0.15em"></a>&nbsp;Red Hat Enterprise Linux</td>
<td><a href="https://www.armbian.org" target="_blank"><img src="./docs/assets/images/icon/armbian.png" width="16" height="16" style="vertical-align: -0.2em"></a>&nbsp;Armbian</td>
<td align="center">all</td>
</tr>
<tr>
<td><a href="https://access.redhat.com/products/red-hat-enterprise-linux" target="_blank"><img src="./docs/assets/images/icon/redhat.svg" width="16" height="16" style="vertical-align: -0.1em"></a>&nbsp;Red Hat Enterprise Linux</td>
<td align="center">7.0 ~ 9</td>
</tr>
<tr>
<td><a href="https://fedoraproject.org/zh-Hans" target="_blank"><img src="./docs/assets/images/icon/fedora.ico" width="16" height="16" style="vertical-align: -0.15em"></a>&nbsp;Fedora</td>
<td><a href="https://fedoraproject.org/zh-Hans" target="_blank"><img src="./docs/assets/images/icon/fedora.ico" width="16" height="16" style="vertical-align: -0.2em"></a>&nbsp;Fedora</td>
<td align="center">30 ~ 39</td>
</tr>
<tr>
<td><a href="https://www.centos.org" target="_blank"><img src="./docs/assets/images/icon/centos.svg" width="16" height="16" style="vertical-align: -0.15em"></a>&nbsp;CentOS</td>
<td><a href="https://www.centos.org" target="_blank"><img src="./docs/assets/images/icon/centos.svg" width="16" height="16" style="vertical-align: -0.2em"></a>&nbsp;CentOS</td>
<td align="center">7.0 ~ 8.5 / Stream 8 ~ 9</td>
</tr>
<tr>
Expand All @@ -59,7 +63,7 @@
<td align="center">8.6 / 8.8 / 9.0</td>
</tr>
<tr>
<td><a href="https://www.openeuler.org/zh" target="_blank"><img src="./docs/assets/images/icon/openeuler.ico" width="16" height="16" style="vertical-align: -0.15em"></a>&nbsp;openEuler</td>
<td><a href="https://www.openeuler.org/zh" target="_blank"><img src="./docs/assets/images/icon/openeuler.ico" width="16" height="16" style="vertical-align: -0.2em"></a>&nbsp;openEuler</td>
<td align="center">21.03 ~ 23</td>
</tr>
<tr>
Expand Down Expand Up @@ -88,6 +92,6 @@

### LICENSE

Copyright © 2023, [SuperManito](https://github.com/SuperManito). Released under the [MIT](https://github.com/SuperManito/LinuxMirrors/blob/main/LICENSE).
Copyright © 2024, [SuperManito](https://github.com/SuperManito). Released under the [MIT](https://github.com/SuperManito/LinuxMirrors/blob/main/LICENSE).

__如果您觉得这个项目不错对您有所帮助的话,方便在右上角给颗 ⭐ 并分享给更多的朋友吗?__
Binary file added docs/assets/images/icon/armbian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 46 additions & 32 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,41 @@
---
title: LinuxMirrors · 让换源更简单
comments: true
glightbox: false
hide:
- navigation
- toc
- feedback
- footer
---

![](assets/images/brand/light/2.png#only-light){ width="300" }
![](assets/images/brand/dark/2.png#only-dark){ width="300" }
<figure style="margin: 0" markdown>
![](assets/images/brand/light/2.png#only-light){ width="300" }
![](assets/images/brand/dark/2.png#only-dark){ width="300" }
<figcaption>GNU/Linux 一键更换系统软件源脚本</figcaption>
</figure>

!!! note inline end "说明"
<div class="grid" markdown>

当前支持基于 `Debian`、`RedHat`、`OpenCloudOS`、`openEuler`、`openSUSE`、`Arch Linux`、`Alpine Linux` 的发行版和及其部分衍生版本
点击列表中的图标可快速前往其官网,理论支持所有处理器架构的环境
<div class="grid cards" style="height: fit-content" markdown>

暂无计划适配更多系统或版本
如果你有需求那么请提交至 [Issues](https://github.com/SuperManito/LinuxMirrors/issues)
- :material-source-branch:{ .lg .middle } __软件源适配__

<div class="annotate" markdown>
| 系统名称 | 适配版本 |
| --- | :---: |
| <a href="https://www.debian.org" target="_blank"><img src="/assets/images/icon/debian.svg" width="16" height="16" style="vertical-align: -0.45em"></a> Debian | 8.0 ~ 12 |
| <a href="https://cn.ubuntu.com" target="_blank"><img src="/assets/images/icon/ubuntu.svg" width="16" height="16" style="vertical-align: -0.15em"></a> Ubuntu :material-information-outline:{ title="支持乌班图家族衍生操作系统,例如 <code>优麒麟</code> <code>Kubuntu</code> 等" } | 14.04 ~ 23 |
| <a href="https://www.kali.org" target="_blank"><img src="/assets/images/icon/kali-linux.svg" width="16" height="16"></a> Kali Linux | 2.0 ~ 2023 |
| <a href="https://www.deepin.org" target="_blank"><img src="/assets/images/icon/deepin.svg" width="16" height="16" style="vertical-align: -0.25em"></a> Deepin | all |
| <a href="https://access.redhat.com/products/red-hat-enterprise-linux" target="_blank"><img src="/assets/images/icon/redhat.svg" width="16" height="16"></a> Red Hat Enterprise Linux :material-information-outline:{ title="使用 <code>Rocky Linux</code> 或 <code>CentOS</code> 源" } | 7.0 ~ 9 |
| <a href="https://fedoraproject.org/zh-Hans" target="_blank"><img src="/assets/images/icon/fedora.ico" width="16" height="16" style="vertical-align: -0.15em"></a> Fedora | 30 ~ 39 |
| <a href="https://www.centos.org" target="_blank"><img src="/assets/images/icon/centos.svg" width="16" height="16" style="vertical-align: -0.15em"></a> CentOS | 7.0 ~ 8.5 / Stream 8 ~ 9 |
| <a href="https://rockylinux.org/zh_CN" target="_blank"><img src="/assets/images/icon/rocky-linux.svg" width="16" height="16" style="vertical-align: -0.25em"></a> Rocky Linux | 8 ~ 9 |
| <a href="https://almalinux.org/zh-hans" target="_blank"><img src="/assets/images/icon/almalinux.svg" width="16" height="16" style="vertical-align: -0.25em"></a> AlmaLinux | 8 ~ 9 |
| <a href="https://www.opencloudos.org" target="_blank"><img src="/assets/images/icon/opencloudos.png" width="16" height="16" style="vertical-align: -0.25em"></a> OpenCloudOS | 8.6 / 8.8 / 9.0 |
| <a href="https://www.openeuler.org/zh" target="_blank"><img src="/assets/images/icon/openeuler.ico" width="16" height="16" style="vertical-align: -0.3em"></a> openEuler | 21.03 ~ 23 |
| <a href="https://www.opensuse.org" target="_blank"><img src="/assets/images/icon/opensuse.svg" width="16" height="16"></a> openSUSE | Leep 15 / Tumbleweed |
| <a href="https://archlinux.org" target="_blank"><img src="/assets/images/icon/arch-linux.ico" width="16" height="16" style="vertical-align: -0.15em"></a> Arch Linux | all |
| <a href="https://www.alpinelinux.org" target="_blank"><img src="/assets/images/icon/alpine.png" width="16" height="16" style="vertical-align: -0.15em"></a> Alpine Linux | v3 / edge |
</div>
---

<div class="grid cards" markdown>
实际考察了国内众多主流镜像站,针对适配情况进行了考察,并测试了速度与IPv6
另外还提供众多中国大陆教育网镜像站、海外镜像站可控选择

- :octicons-report-24:{ .lg .middle } __意见与建议__
[:octicons-arrow-right-24: Mirrors](/mirrors)

- :octicons-command-palette-16:{ .lg .middle } __低技术成本__

---

如有意见与建议你可以提交至 [Issues](https://github.com/SuperManito/LinuxMirrors/issues)
如果你需要提交代码请前往 GitHub 仓库提交 [Pull Requests](https://github.com/SuperManito/LinuxMirrors/pulls)
一键脚本让换源更简单,用户无需掌握相关技术可通过交互完成更换
并且提供了命令选项可为自动化项目实现无交互换源

[:octicons-arrow-right-24: Issues](https://github.com/SuperManito/LinuxMirrors/issues)
[:octicons-arrow-right-24: Mirrors](/mirrors)

- :material-scale-balance:{ .lg .middle } __开源, MIT__

Expand All @@ -58,9 +46,35 @@ hide:

[:octicons-arrow-right-24: License](https://github.com/SuperManito/LinuxMirrors/blob/main/LICENSE)

- :octicons-report-24:{ .lg .middle } __意见与建议__

---

如有意见与建议你可以提交至 [Issues](https://github.com/SuperManito/LinuxMirrors/issues)
如果你需要提交代码请前往 GitHub 仓库提交 [Pull Requests](https://github.com/SuperManito/LinuxMirrors/pulls)

[:octicons-arrow-right-24: Issues](https://github.com/SuperManito/LinuxMirrors/issues)

</div>

> 这是一个开源的非盈利项目,旨在为从事计算机相关行业的朋友们提供便利
| 系统名称 | 适配版本 |
| --- | :---: |
| <a href="https://www.debian.org" target="_blank"><img src="/assets/images/icon/debian.svg" width="16" height="16" style="vertical-align: -0.45em"></a> Debian | 8.0 ~ 12 |
| <a href="https://cn.ubuntu.com" target="_blank"><img src="/assets/images/icon/ubuntu.svg" width="16" height="16" style="vertical-align: -0.15em"></a> Ubuntu :material-information-outline:{ title="支持乌班图家族衍生操作系统,例如 <code>优麒麟</code> <code>Kubuntu</code> 等" } | 14.04 ~ 23 |
| <a href="https://www.kali.org" target="_blank"><img src="/assets/images/icon/kali-linux.svg" width="16" height="16"></a> Kali Linux | 2.0 ~ 2023 |
| <a href="https://www.deepin.org" target="_blank"><img src="/assets/images/icon/deepin.svg" width="16" height="16" style="vertical-align: -0.25em"></a> Deepin | all |
| <a href="https://www.armbian.com" target="_blank"><img src="/assets/images/icon/armbian.png" width="16" height="16" style="vertical-align: -0.2em"></a> Armbian | all |
| <a href="https://access.redhat.com/products/red-hat-enterprise-linux" target="_blank"><img src="/assets/images/icon/redhat.svg" width="16" height="16" style="vertical-align: -0.1em"></a> Red Hat Enterprise Linux :material-information-outline:{ title="使用 <code>Rocky Linux</code> 或 <code>CentOS</code> 源" } | 7.0 ~ 9 |
| <a href="https://fedoraproject.org/zh-Hans" target="_blank"><img src="/assets/images/icon/fedora.ico" width="16" height="16" style="vertical-align: -0.2em"></a> Fedora | 30 ~ 39 |
| <a href="https://www.centos.org" target="_blank"><img src="/assets/images/icon/centos.svg" width="16" height="16" style="vertical-align: -0.2em"></a> CentOS | 7.0 ~ 8.5 / Stream 8 ~ 9 |
| <a href="https://rockylinux.org/zh_CN" target="_blank"><img src="/assets/images/icon/rocky-linux.svg" width="16" height="16" style="vertical-align: -0.25em"></a> Rocky Linux | 8 ~ 9 |
| <a href="https://almalinux.org/zh-hans" target="_blank"><img src="/assets/images/icon/almalinux.svg" width="16" height="16" style="vertical-align: -0.25em"></a> AlmaLinux | 8 ~ 9 |
| <a href="https://www.opencloudos.org" target="_blank"><img src="/assets/images/icon/opencloudos.png" width="16" height="16" style="vertical-align: -0.25em"></a> OpenCloudOS | 8.6 / 8.8 / 9.0 |
| <a href="https://www.openeuler.org/zh" target="_blank"><img src="/assets/images/icon/openeuler.ico" width="16" height="16" style="vertical-align: -0.2em"></a> openEuler | 21.03 ~ 23 |
| <a href="https://www.opensuse.org" target="_blank"><img src="/assets/images/icon/opensuse.svg" width="16" height="16"></a> openSUSE | Leep 15 / Tumbleweed |
| <a href="https://archlinux.org" target="_blank"><img src="/assets/images/icon/arch-linux.ico" width="16" height="16" style="vertical-align: -0.15em"></a> Arch Linux | all |
| <a href="https://www.alpinelinux.org" target="_blank"><img src="/assets/images/icon/alpine.png" width="16" height="16" style="vertical-align: -0.15em"></a> Alpine Linux | v3 / edge |

</div>

[开 始 使 用](use/index.md){ .md-button .md-button--primary } [查看软件源列表](mirrors/index.md){ .md-button }
[开 始 使 用](use/index.md){ .md-button .md-button--primary } &nbsp; [查看软件源列表](mirrors/index.md){ .md-button }
Loading

0 comments on commit 8ab91f7

Please sign in to comment.