This commit is contained in:
Super Manito
2024-11-14 21:57:28 +08:00
parent f6b2f6c1f6
commit 01c6afa4f6
3 changed files with 60 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
## Author: SuperManito ## Author: SuperManito
## Modified: 2024-11-08 ## Modified: 2024-11-14
## License: MIT ## License: MIT
## GitHub: https://github.com/SuperManito/LinuxMirrors ## GitHub: https://github.com/SuperManito/LinuxMirrors
## Website: https://linuxmirrors.cn ## Website: https://linuxmirrors.cn
@@ -973,7 +973,7 @@ function choose_mirrors() {
local system_name="${SYSTEM_PRETTY_NAME:-"${SYSTEM_NAME} ${SYSTEM_VERSION_NUMBER}"}" local system_name="${SYSTEM_PRETTY_NAME:-"${SYSTEM_NAME} ${SYSTEM_VERSION_NUMBER}"}"
local arch="${DEVICE_ARCH}" local arch="${DEVICE_ARCH}"
local date_time time_zone local date_time time_zone
date_time="$(date "+%Y-%m-%d %H:%M:%S")" date_time="$(date "+%Y-%m-%d %H:%M")"
time_zone="$(timedatectl status 2>/dev/null | grep "Time zone" | awk -F ':' '{print$2}' | awk -F ' ' '{print$1}')" time_zone="$(timedatectl status 2>/dev/null | grep "Time zone" | awk -F ':' '{print$2}' | awk -F ' ' '{print$1}')"
echo -e '' echo -e ''
@@ -1376,7 +1376,7 @@ function remove_original_mirrors() {
[ -d $Dir_YumRepos ] && rm -rf $Dir_YumRepos/AnolisOS* [ -d $Dir_YumRepos ] && rm -rf $Dir_YumRepos/AnolisOS*
;; ;;
"${SYSTEM_OPENSUSE}") "${SYSTEM_OPENSUSE}")
[ -d $Dir_openSUSERepos ] && ls $Dir_openSUSERepos/ | grep -E "^repo-" | grep -Ev "openh264" | xargs rm -rf [ -d $Dir_openSUSERepos ] && rm -rf $Dir_YumRepos/repo-*
;; ;;
"${SYSTEM_ARCH}") "${SYSTEM_ARCH}")
[ -f $File_ArchLinuxMirrorList ] && sed -i '1,$d' $File_ArchLinuxMirrorList [ -f $File_ArchLinuxMirrorList ] && sed -i '1,$d' $File_ArchLinuxMirrorList
@@ -2083,6 +2083,7 @@ function change_mirrors_openSUSE() {
repo-debug-update-non-oss.repo \ repo-debug-update-non-oss.repo \
repo-debug-update.repo \ repo-debug-update.repo \
repo-non-oss.repo \ repo-non-oss.repo \
repo-openh264.repo \
repo-oss.repo \ repo-oss.repo \
repo-sle-debug-update.repo \ repo-sle-debug-update.repo \
repo-sle-update.repo \ repo-sle-update.repo \
@@ -5301,6 +5302,15 @@ autorefresh=1
baseurl=http://download.opensuse.org/distribution/leap/$releasever/repo/non-oss/ baseurl=http://download.opensuse.org/distribution/leap/$releasever/repo/non-oss/
type=rpm-md type=rpm-md
keeppackages=0 keeppackages=0
EOF
cat <<'EOF' >$Dir_openSUSERepos/repo-openh264.repo
[repo-openh264]
name=Open H.264 Codec (openSUSE Leap)
enabled=1
autorefresh=1
baseurl=http://codecs.opensuse.org/openh264/openSUSE_Leap/
type=rpm-md
keeppackages=0
EOF EOF
cat <<'EOF' >$Dir_openSUSERepos/repo-oss.repo cat <<'EOF' >$Dir_openSUSERepos/repo-oss.repo
[repo-oss] [repo-oss]

View File

@@ -441,12 +441,13 @@ function choose_mirrors() {
function print_title() { function print_title() {
local system_name="${SYSTEM_PRETTY_NAME:-"${SYSTEM_NAME} ${SYSTEM_VERSION_NUMBER}"}" local system_name="${SYSTEM_PRETTY_NAME:-"${SYSTEM_NAME} ${SYSTEM_VERSION_NUMBER}"}"
local arch=""${DEVICE_ARCH}"" local arch=""${DEVICE_ARCH}""
local date="$(date "+%Y-%m-%d %H:%M:%S")" local date_time time_zone
local timezone="$(timedatectl status 2>/dev/null | grep "Time zone" | awk -F ':' '{print$2}' | awk -F ' ' '{print$1}')" date_time="$(date "+%Y-%m-%d %H:%M")"
timezone="$(timedatectl status 2>/dev/null | grep "Time zone" | awk -F ':' '{print$2}' | awk -F ' ' '{print$1}')"
echo -e '' echo -e ''
echo -e " 运行环境 ${BLUE}${system_name} ${arch}${PLAIN}" echo -e " 运行环境 ${BLUE}${system_name} ${arch}${PLAIN}"
echo -e " 系统时间 ${BLUE}${date} ${timezone}${PLAIN}" echo -e " 系统时间 ${BLUE}${date_time} ${timezone}${PLAIN}"
} }
print_title print_title

View File

@@ -98,7 +98,7 @@ hide:
apt-get remove -y docker* containerd.io runc && apt-get autoremove apt-get remove -y docker* containerd.io runc && apt-get autoremove
``` ```
> `Debian` &nbsp; `Ubuntu` &nbsp; `Kali` &nbsp; `Linux Mint` &nbsp; `Deepin` &nbsp; `Armbian` &nbsp; `Proxmox` > `Debian` &nbsp; `Ubuntu` &nbsp; `Kali` &nbsp; `Linux Mint` &nbsp; `Deepin` &nbsp; `Zorin OS` &nbsp; `Armbian` &nbsp; `Proxmox`
=== "RedHat 系 / OpenCloudOS / openEuler / Anolis OS" === "RedHat 系 / OpenCloudOS / openEuler / Anolis OS"
@@ -109,3 +109,45 @@ hide:
> `Red Hat Enterprise Linux` &nbsp; `CentOS` &nbsp; `Rocky Linux` &nbsp; `AlmaLinux` &nbsp; `Fedora` &nbsp; `OpenCloudOS` &nbsp; `openEuler` &nbsp; `Anolis OS` > `Red Hat Enterprise Linux` &nbsp; `CentOS` &nbsp; `Rocky Linux` &nbsp; `AlmaLinux` &nbsp; `Fedora` &nbsp; `OpenCloudOS` &nbsp; `openEuler` &nbsp; `Anolis OS`
卸载完成后重新执行脚本安装即可 卸载完成后重新执行脚本安装即可
## 其它
提供一些常见服务的一键换源命令,用于备忘
### NPM
适用于 `npm` `yarn` `pnpm` 等
=== "淘宝源"
``` bash
npm config set registry https://registry.npmmirror.com/
```
=== "腾讯云"
``` bash
npm config set registry https://mirrors.tencent.com/npm/
```
### PYPI
适用于 `pip` `pip3`
=== "阿里云"
``` bash
pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
```
=== "腾讯云"
``` bash
pip3 config set global.index-url https://mirrors.tencent.com/pypi/simple/
```
=== "中科大"
``` bash
pip3 config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/
```