mirror of
https://gitee.com/SuperManito/LinuxMirrors
synced 2025-12-27 02:06:35 +08:00
适配 Alpine Linux & 优化
This commit is contained in:
@@ -37,9 +37,9 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \
|
||||
|
||||
### 指定软件源分支
|
||||
|
||||
使用场景:目标软件源有对应系统镜像但是不符合本脚本关于软件源分支设置的默认规则
|
||||
使用场景:目标镜像站有对应的系统镜像但是不符合本项目脚本关于软件源分支设置的默认规则
|
||||
|
||||
本脚本为了适配大的环境不会针对某一镜像站独特的镜像分支名称而单独定制,最开始是为了更换国内软件源而设计适配的,默认使用的分支名称如下
|
||||
项目脚本为了适配大的环境不会针对某一镜像站独特的镜像分支名称而单独适配,默认使用的分支名称如下
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
@@ -48,7 +48,7 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \
|
||||
</tr>
|
||||
<tr>
|
||||
<td><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</td>
|
||||
<td align="center">ubuntu/ubuntu-ports</td>
|
||||
<td align="center">ubuntu / ubuntu-ports</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.kali.org" target="_blank"><img src="/../assets/images/icon/kali-linux.svg" width="16" height="16"/></a> Kali Linux</td>
|
||||
@@ -60,7 +60,7 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \
|
||||
</tr>
|
||||
<tr>
|
||||
<td><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.15em"/></a> Red Hat Enterprise Linux</td>
|
||||
<td align="center">centos/rocky</td>
|
||||
<td align="center">centos / centos-altarch / rocky</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><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</td>
|
||||
@@ -68,7 +68,7 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \
|
||||
</tr>
|
||||
<tr>
|
||||
<td><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</td>
|
||||
<td align="center">centos/centos-stream/centos-altarch/centos-vault</td>
|
||||
<td align="center">centos / centos-stream / centos-altarch / centos-vault</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://rockylinux.org" target="_blank"><img src="/../assets/images/icon/rocky-linux.svg" width="16" height="16" style="vertical-align: -0.25em"/></a> Rocky Linux</td>
|
||||
@@ -76,7 +76,7 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \
|
||||
</tr>
|
||||
<tr>
|
||||
<td><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</td>
|
||||
<td align="center">almalinux/almalinux-vault</td>
|
||||
<td align="center">almalinux / almalinux-vault</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><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</td>
|
||||
@@ -92,7 +92,11 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \
|
||||
</tr>
|
||||
<tr>
|
||||
<td><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</td>
|
||||
<td align="center">archlinux/archlinuxarm</td>
|
||||
<td align="center">archlinux / archlinuxarm</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><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</td>
|
||||
<td align="center">alpine</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -116,7 +120,7 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \
|
||||
bash <(curl -sSL https://linuxmirrors.cn/main.sh) --only-epel
|
||||
```
|
||||
|
||||
### 恢复官方源
|
||||
### 恢复使用官方源
|
||||
|
||||
当你不小心删除了官方源的备份时可以使用此命令来恢复,使用此命令选项后将跳过选择软件源步骤
|
||||
|
||||
@@ -134,9 +138,9 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) \
|
||||
--branch-security debian-security
|
||||
```
|
||||
|
||||
### 指定 Debian 系操作系统的版本名称
|
||||
### 指定 Debian 系 Linux 版本代号
|
||||
|
||||
你可以自定义该版本名称,大多数情况下用于升级系统版本,请看下面的例子
|
||||
大多数情况下自定义版本代号用于升级系统版本,请看下面的例子
|
||||
|
||||
``` { .bash .no-copy title="升级 Debian 至最新 12 版本 Bookworm" }
|
||||
bash <(curl -sSL https://linuxmirrors.cn/main.sh) \
|
||||
|
||||
@@ -3,39 +3,43 @@
|
||||
|
||||
!!! quote ""
|
||||
|
||||
- 如果提示 `Command 'curl' not found` 则说明当前未安装 `curl` 软件包
|
||||
=== "Debian 系"
|
||||
|
||||
=== "Debian 系 Linux"
|
||||
``` sh
|
||||
apt-get install -y curl
|
||||
```
|
||||
|
||||
``` sh
|
||||
apt-get install -y curl
|
||||
```
|
||||
> `Debian` `Ubuntu` `Kali` `Deepin`
|
||||
|
||||
> `Debian` `Ubuntu` `Kali` `Deepin`
|
||||
新装系统需要先执行一遍更新 `apt-get update`
|
||||
|
||||
新装系统需要先执行一遍更新 `apt-get update`
|
||||
=== "RedHat 系 / OpenCloudOS / openEuler"
|
||||
|
||||
=== "RedHat 系 Linux / OpenCloudOS / openEuler"
|
||||
``` sh
|
||||
yum install -y curl || dnf install -y curl
|
||||
```
|
||||
|
||||
``` sh
|
||||
yum install -y curl || dnf install -y curl
|
||||
```
|
||||
> `Red Hat Enterprise Linux` `CentOS` `Rocky Linux` `AlmaLinux` `Fedora` `OpenCloudOS` `openEuler`
|
||||
|
||||
> `Red Hat Enterprise Linux` `CentOS` `Rocky Linux` `AlmaLinux` `Fedora` `OpenCloudOS` `openEuler`
|
||||
新装系统需要先执行一遍更新 `yum makecache`
|
||||
|
||||
新装系统需要先执行一遍更新 `yum makecache`
|
||||
=== "openSUSE"
|
||||
|
||||
=== "openSUSE"
|
||||
``` sh
|
||||
zypper install curl
|
||||
```
|
||||
|
||||
``` sh
|
||||
zypper install curl
|
||||
```
|
||||
=== "Arch Linux"
|
||||
|
||||
=== "Arch Linux"
|
||||
``` sh
|
||||
pacman -S curl
|
||||
```
|
||||
|
||||
``` sh
|
||||
pacman -S curl
|
||||
```
|
||||
=== "Alpine Linux"
|
||||
|
||||
``` sh
|
||||
apk --no-cache add -f curl bash
|
||||
```
|
||||
|
||||
## 关于开启 SSH 远程登录的方法
|
||||
|
||||
@@ -70,7 +74,7 @@
|
||||
|
||||
!!! quote ""
|
||||
|
||||
=== "Debian 系 Linux"
|
||||
=== "Debian 系"
|
||||
|
||||
``` sh
|
||||
cp -rvf /etc/apt/sources.list.bak /etc/apt/sources.list
|
||||
@@ -79,7 +83,7 @@
|
||||
|
||||
> `Debian` `Ubuntu` `Kali` `Deepin`
|
||||
|
||||
=== "RedHat 系 Linux / OpenCloudOS / openEuler"
|
||||
=== "RedHat 系 / OpenCloudOS / openEuler"
|
||||
|
||||
``` sh
|
||||
cp -rvf /etc/yum.repos.d.bak /etc/yum.repos.d
|
||||
@@ -102,6 +106,13 @@
|
||||
pacman -Sy
|
||||
```
|
||||
|
||||
=== "Alpine Linux"
|
||||
|
||||
``` sh
|
||||
cp -rvf /etc/apk/repositories.bak /etc/apk/repositories
|
||||
apk update -f
|
||||
```
|
||||
|
||||
## 其它
|
||||
|
||||
!!! quote ""
|
||||
|
||||
@@ -11,7 +11,7 @@ hide:
|
||||
bash <(curl -sSL https://linuxmirrors.cn/main.sh)
|
||||
```
|
||||
|
||||
!!! question "请在使用前检查目标镜像站是否支持您正在使用的操作系统"
|
||||
!!! question "请在使用前检查目标镜像站是否支持您所使用的操作系统"
|
||||
|
||||
??? quote "原始执行命令"
|
||||
|
||||
@@ -37,7 +37,7 @@ hide:
|
||||
|
||||
1. 通过 `--edu` 命令选项来使用中国大陆教育单位软件源
|
||||
|
||||
!!! question "请在使用前检查目标镜像站是否支持您正在使用的操作系统"
|
||||
!!! question "请在使用前检查目标镜像站是否支持您所使用的操作系统"
|
||||
|
||||
??? quote "原始执行命令"
|
||||
|
||||
@@ -63,7 +63,7 @@ hide:
|
||||
|
||||
1. 通过 `--abroad` 命令选项来使用海外软件源
|
||||
|
||||
!!! question "请在使用前检查目标镜像站是否支持您正在使用的操作系统"
|
||||
!!! question "请在使用前检查目标镜像站是否支持您所使用的操作系统"
|
||||
|
||||
??? quote "原始执行命令"
|
||||
|
||||
@@ -109,13 +109,13 @@ hide:
|
||||
|
||||
遵循系统默认设置即没有启用的软件源不会在运行完本脚本后被启用,但是它们也随脚本更换了目标软件源地址,如果你有使用需求请阅读下面的启用方法
|
||||
|
||||
=== "Debian 系 Linux"
|
||||
=== "Debian 系"
|
||||
|
||||
默认禁用了`deb-src`源码仓库和`proposed`预发布软件源,若需启用请将 `/etc/apt/sources.list` 文件中相关内容的所在行取消注释
|
||||
|
||||
> `Debian` `Ubuntu` `Kali` `Deepin`
|
||||
|
||||
=== "RedHat 系 Linux / OpenCloudOS / openEuler"
|
||||
=== "RedHat 系 / OpenCloudOS / openEuler"
|
||||
|
||||
部分仓库默认没有启用,若需启用请将 `/etc/yum.repos.d` 目录下相关 repo 文件中的 `enabled` 值修改为 `1`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user