mirror of
https://github.com/TheWhiteDog9487/lag2cn.git
synced 2026-08-13 07:41:28 +08:00
支持Rocky Linux和AlmaLinux
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
- Ubuntu
|
- Ubuntu
|
||||||
- Arch Linux
|
- Arch Linux
|
||||||
- CachyOS
|
- CachyOS
|
||||||
|
- Rocky Linux
|
||||||
|
- AlmaLinux
|
||||||
|
|
||||||
## 测试通过的系统
|
## 测试通过的系统
|
||||||
### **x86_64:**
|
### **x86_64:**
|
||||||
@@ -15,6 +17,8 @@
|
|||||||
| Debian | 13.2 <br/> 11.6 |
|
| Debian | 13.2 <br/> 11.6 |
|
||||||
| Ubuntu | 26.04 LTS <br/> 25.10 <br/> 25.04 <br/> 24.10 <br/> 24.04.1 LTS <br/> 22.04 LTS <br/> 20.04 LTS |
|
| Ubuntu | 26.04 LTS <br/> 25.10 <br/> 25.04 <br/> 24.10 <br/> 24.04.1 LTS <br/> 22.04 LTS <br/> 20.04 LTS |
|
||||||
| Arch Linux | 滚动发行 |
|
| Arch Linux | 滚动发行 |
|
||||||
|
| Rocky Linux | 10.2 |
|
||||||
|
| AlmaLinux | 10.2 |
|
||||||
|
|
||||||
### **aarch64:**
|
### **aarch64:**
|
||||||
| 系统名称 | 版本 |
|
| 系统名称 | 版本 |
|
||||||
@@ -50,7 +54,7 @@ rm language_arm
|
|||||||
- Clang
|
- Clang
|
||||||
- build-base或其他等效工具集
|
- build-base或其他等效工具集
|
||||||
|
|
||||||
推荐使用Alpine Linux进行编译,因为Alpine的系统libc就是musl,编译出的产物可以直接用而不需要管目标系统glibc的版本问题
|
推荐使用Alpine Linux进行编译,因为Alpine的系统libc就是musl,静态链接之后的体积会比glibc小一些
|
||||||
您可以使用下面的Docker命令获得一个Alpine环境
|
您可以使用下面的Docker命令获得一个Alpine环境
|
||||||
```shell
|
```shell
|
||||||
docker run --rm -it -v .:/src -w /src alpine
|
docker run --rm -it -v .:/src -w /src alpine
|
||||||
|
|||||||
+23
-1
@@ -69,6 +69,8 @@ string OsDescription = RuntimeInformation.OSDescription;
|
|||||||
if (Enum.TryParse<SupportedLinuxDistributions>(OsDescription.Split(' ')[0], out var CurrentSystem) == false){
|
if (Enum.TryParse<SupportedLinuxDistributions>(OsDescription.Split(' ')[0], out var CurrentSystem) == false){
|
||||||
if (OsDescription.Contains("Arch Linux")){
|
if (OsDescription.Contains("Arch Linux")){
|
||||||
CurrentSystem = SupportedLinuxDistributions.ArchLinux; }
|
CurrentSystem = SupportedLinuxDistributions.ArchLinux; }
|
||||||
|
else if (OsDescription.Contains("Rocky Linux")){
|
||||||
|
CurrentSystem = SupportedLinuxDistributions.RockyLinux; }
|
||||||
else{
|
else{
|
||||||
string CurrentSupportedLinuxDistributions = string.Join(", ", Enum.GetNames<SupportedLinuxDistributions>());
|
string CurrentSupportedLinuxDistributions = string.Join(", ", Enum.GetNames<SupportedLinuxDistributions>());
|
||||||
string Message = @$"
|
string Message = @$"
|
||||||
@@ -134,6 +136,24 @@ switch (CurrentSystem){
|
|||||||
if (File.Exists("/etc/default/locale")){
|
if (File.Exists("/etc/default/locale")){
|
||||||
File.Move("/etc/default/locale", "/etc/default/locale.bak", true); }
|
File.Move("/etc/default/locale", "/etc/default/locale.bak", true); }
|
||||||
File.CreateSymbolicLink("/etc/default/locale", "/etc/locale.conf"); }
|
File.CreateSymbolicLink("/etc/default/locale", "/etc/locale.conf"); }
|
||||||
|
break; }
|
||||||
|
case SupportedLinuxDistributions.RockyLinux or SupportedLinuxDistributions.AlmaLinux: {
|
||||||
|
CheckUser("即将开始安装中文语言包");
|
||||||
|
Console.WriteLine("开始更新语言配置");
|
||||||
|
Console.WriteLine("正在安装中文语言包");
|
||||||
|
ExecuteCommand("dnf", ["install", "-y", "--nogpgcheck", "glibc-langpack-zh", "langpacks-zh_CN"]);
|
||||||
|
Console.WriteLine("正在更新语言配置");
|
||||||
|
ExecuteCommand("localectl", ["set-locale", "LANG=zh_CN.UTF-8"]);
|
||||||
|
|
||||||
|
if (IsRunningInsideWSL() && CurrentSystem == SupportedLinuxDistributions.AlmaLinux) {
|
||||||
|
Console.ForegroundColor = ConsoleColor.Red;
|
||||||
|
Console.WriteLine();
|
||||||
|
Console.WriteLine("警告:检测到您正在WSL内使用AlmaLinux");
|
||||||
|
Console.WriteLine("目前已知AlmaLinux在WSL镜像可能存在一些问题");
|
||||||
|
Console.WriteLine("如果您遇到了诸如 dnf nano 等软件的显示仍然为英文的问题");
|
||||||
|
Console.WriteLine("请尝试使用dnf重新安装或升级出现问题的软件包,或者直接完整更新系统内所有软件包,这应当可以解决问题");
|
||||||
|
Console.WriteLine();
|
||||||
|
Console.ResetColor(); }
|
||||||
break; } }
|
break; } }
|
||||||
Console.WriteLine("配置完成,更改将在您下一次登录Shell时生效,按任意键退出");
|
Console.WriteLine("配置完成,更改将在您下一次登录Shell时生效,按任意键退出");
|
||||||
Console.ReadKey(true);
|
Console.ReadKey(true);
|
||||||
@@ -143,4 +163,6 @@ enum SupportedLinuxDistributions {
|
|||||||
Armbian,
|
Armbian,
|
||||||
Ubuntu,
|
Ubuntu,
|
||||||
ArchLinux,
|
ArchLinux,
|
||||||
CachyOS }
|
CachyOS,
|
||||||
|
RockyLinux,
|
||||||
|
AlmaLinux }
|
||||||
Reference in New Issue
Block a user