SuperManito/LinuxMirrors

适配绿联 UGOS 系统

Opened this issue · 13 comments

描述您的功能请求或建议

✘ 不支持当前操作系统(未知系统),请前往官网查看支持列表!

cat /etc/debian_version

cat: /etc/debian_version: No such file or directory

uname -a

Linux DXP4800PLUS-46C 6.12.30+ #2 SMP PREEMPT_DYNAMIC Tue Oct 14 15:48:34 CST 2025 x86_64 GNU/Linux

lsb_release -a

No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm

什么系统环境?不存在这个文件是不正常的

你需要提供 /etc/os-release

什么系统环境?不存在这个文件是不正常的

你需要提供 /etc/os-release

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
OS_VERSION=1.10.0.0112

系统是绿联改造过的debian12吧,我写死main.sh中的变量然后更新成功了。
系统介绍可以看【UGOS Pro 系统介绍】,如果需要机器验证可以点页面上的 【在线体验】
Image

从日志看,已经拿到不少系统信息了,一定需要用 cat /etc/debian_version来判定吗?
比如说PRETTY_NAME,SYSTEM_VERSION_ID,os-release等等。

Image

从日志看,已经拿到不少系统信息了,一定需要用 cat /etc/debian_version来判定吗?
比如说PRETTY_NAME,SYSTEM_VERSION_ID,os-release等等。

Image

Linux 有很多派系和分支,脚本是先判定派系再判断具体系统,debian_version 是判定系统处于 Debian 派系的重要凭证,某些国产系统就是个例子,它们在特定版本起宣称不再基于红帽并删除了 redhat-release这个文件。另外根据以往实践经验,os-release 中定义的系统名称比较杂乱,不能作为首要判定依据。

关于你这个系统,我晚点考察后再进行回复。

它的在线体验公共账号无法使用终端,你需要以下信息:

  1. /etc/apt/sources.list.bak 中的原始软件源内容

  2. /etc 目录下除 os-release 以外任何关于 release 或 version 文件的文件内容(ls /etc | grep -E "release|version"

它的在线体验公共账号无法使用终端,你需要以下信息:

  1. /etc/apt/sources.list.bak 中的原始软件源内容
  2. /etc 目录下除 os-release 以外任何关于 release 或 version 文件的文件内容(ls /etc | grep -E "release|version"

$ ls /etc | grep -E "release|version"
os-release

$ cat /etc/apt/sources.list.bak
deb https://deb.debian.org/debian/ bookworm contrib main non-free non-free-firmware
deb-src https://deb.debian.org/debian/ bookworm contrib main non-free non-free-firmware
deb https://deb.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
deb-src https://deb.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
deb https://deb.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware
deb-src https://deb.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware
deb https://deb.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware
deb-src https://deb.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware
deb https://deb.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware
deb-src https://deb.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware

/etc# ls -akh
. dictionaries-common idmapd.conf lvm pam.scripts rsyslog.conf sysstat
.. discover.conf.d ifplugd machine-id papersize rsyslog.d systemd
acpi discover-modprobe.conf igfx_user_feature_next.txt magic passwd rtslib-fb-target target
adduser.conf dnsmasq.conf igfx_user_feature_report.txt magic.mime passwd- runit terminfo
adjtime dnsmasq.d igfx_user_feature.txt mailcap perl samba timezone
aliases docker init mailcap.order pki sasl2 tmpfiles.d
alsa domain init.d mailname polkit-1 securetty tpm2-tss
alternatives dpkg initramfs-tools manpath.config power.conf security ucf.conf
apparmor e2scrub.conf inputrc mdadm ppp selinux udev
apparmor.d emacs insserv.conf.d mecabrc profile sensors3.conf udisks2
apt environment iproute2 mime.types profile.d sensors.d ufw
arp-scan environment.d iptables mke2fs.conf protocols services ugminidlna.conf
avahi ethertypes iscsi modprobe.d pulse sethostname update-motd.d
bash.bashrc exports isns modules .pwd.lock sgml upnpd.conf
bash_completion fan.conf issue modules-load.d python3 shadow upnpd.rc
bash_completion.d firmware_config issue.net motd python3.11 shadow- upnpd.rc.conf
bindresvport.blacklist fonts kernel mtab qemu-ifdown shells UPower
binfmt.d fstab kernel-img.conf nanorc qemu-ifup skel usb_modeswitch.conf
buzzer.conf ftpusers krb5.conf nas_search quotagrpadmins smartd.conf usb_modeswitch.d
ca-certificates fuse.conf krb5.conf.d nas_storage quotatab smartmontools vdpau_wrapper.cfg
ca-certificates.conf fwupd krb5kdc needrestart rc0.d smbftpd vim
chatscripts gai.conf ldap netconfig rc1.d ssh vpnc
cni ghostscript ld.so.cache network rc2.d ssl warnquota.conf
console-setup gprofng.rc ld.so.conf networks rc3.d startpre.d webdav
containerd groff ld.so.conf.d nfs.conf rc4.d subgid wgetrc
cpufreq.conf group led.build nfs.json rc5.d subgid- wpa_supplicant
cracklib group- led.conf nfs.json.template rc6.d subuid X11
cron.d grub.d libaudit.conf nftables.conf rc.local subuid- xattr.conf
cron.daily gshadow libblockdev nginx rcS.d sudo.conf xdg
cron.hourly gshadow- libibverbs.d nsswitch.conf redis sudoers xinetd.conf
cron.monthly gss libnl-3 nut reportbug.conf sudoers.d xinetd.d
crontab gtk-3.0 libvirt nvme request-key.conf sudo_logsrvd.conf xl2tpd
cron.weekly hdparm.conf linuxigd oddjobd.conf request-key.d sv xml
cron.yearly host.conf locale.alias oddjobd.conf.d resolv.conf swtpm-localca.conf zram.conf
davfs2 hostname locale.gen openal resolvconf swtpm-localca.options
dbus-1 hosts localtime OpenCL .resolv.conf.lock swtpm_setup.conf
debconf.conf hosts.allow logcheck opt rmt sysconfig
default hosts.deny login.defs os-release rpc sysctl.conf
deluser.conf hwmon.conf logrotate.conf pam.conf rsyncd.json sysctl.conf.back
dhcp id_done logrotate.d pam.d rsyncd.json.template sysctl.d

它的在线体验公共账号无法使用终端,你需要以下信息:

  1. /etc/apt/sources.list.bak 中的原始软件源内容
  2. /etc 目录下除 os-release 以外任何关于 release 或 version 文件的文件内容(ls /etc | grep -E "release|version"

$ ls /etc | grep -E "release|version" os-release

$ cat /etc/apt/sources.list.bak deb https://deb.debian.org/debian/ bookworm contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian/ bookworm contrib main non-free non-free-firmware deb https://deb.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware deb https://deb.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware deb https://deb.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware deb https://deb.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware

看来没有什么有价值的信息,翻一下 /etc 目录找一下 UGOS 特有的文件吧,脚本不能直接通过 os-release 中的变量来直接判定系统,正确的处理方式是先判定为 UGOS 然后再走 Debian 换源的逻辑

它的在线体验公共账号无法使用终端,你需要以下信息:

  1. /etc/apt/sources.list.bak 中的原始软件源内容
  2. /etc 目录下除 os-release 以外任何关于 release 或 version 文件的文件内容(ls /etc | grep -E "release|version"

$ ls /etc | grep -E "release|version" os-release
$ cat /etc/apt/sources.list.bak deb https://deb.debian.org/debian/ bookworm contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian/ bookworm contrib main non-free non-free-firmware deb https://deb.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware deb https://deb.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware deb https://deb.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware deb https://deb.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware

看来没有什么有价值的信息,翻一下 /etc 目录找一下 UGOS 特有的文件吧,脚本不能直接通过 os-release 中的变量来直接判定系统,正确的处理方式是先判定为 UGOS 然后再走 Debian 换源的逻辑

没发现有啥有价值的信息,手动指定一下系统也能跑。
或者在系统无法判定时,增加os-release 中定义的系统名称作为兜底,是否可行。

它的在线体验公共账号无法使用终端,你需要以下信息:

  1. /etc/apt/sources.list.bak 中的原始软件源内容
  2. /etc 目录下除 os-release 以外任何关于 release 或 version 文件的文件内容(ls /etc | grep -E "release|version"

$ ls /etc | grep -E "release|version" os-release
$ cat /etc/apt/sources.list.bak deb https://deb.debian.org/debian/ bookworm contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian/ bookworm contrib main non-free non-free-firmware deb https://deb.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware deb https://deb.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware deb https://deb.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware deb https://deb.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware deb-src https://deb.debian.org/debian-security/ bookworm-security contrib main non-free non-free-firmware

看来没有什么有价值的信息,翻一下 /etc 目录找一下 UGOS 特有的文件吧,脚本不能直接通过 os-release 中的变量来直接判定系统,正确的处理方式是先判定为 UGOS 然后再走 Debian 换源的逻辑

没发现有啥有价值的信息,手动指定一下系统也能跑。 或者在系统无法判定时,增加os-release 中定义的系统名称作为兜底,是否可行。

不可以,假如我给 Debian 适配了,那其它系统要不要都适配一遍?红帽系还好一点,Debian系衍生系统太多了,这种 “兜底” 一定存在不可预料的风险。

Image

网上搜了搜,部分linux系统通过/etc/issue显示系统版本信息。
$ cat /etc/issue
UGOSPRO Linux \n \l

另外看了一下/proc/version,从这里判定会比/etc/xxx-version更准确吗?
$ cat /proc/version
Linux version 6.12.30+ (ugreen@debian) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #2 SMP PREEMPT_DYNAMIC Tue Oct 14 15:48:34 CST 2025

/proc/version

脚本不涉及 /proc 目录

核心判定逻辑位于 https://github.com/SuperManito/LinuxMirrors/blob/main/ChangeMirrors.sh#L752-L753 https://github.com/SuperManito/LinuxMirrors/blob/main/ChangeMirrors.sh#L779-L817

你需要寻找能够判定为 UGOS 的独特标志,它可以是目录也可以是文件。由于我没有实验环境,所以我无能为力。

什么系统环境?不存在这个文件是不正常的
你需要提供 /etc/os-release

$ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" OS_VERSION=1.10.0.0112

系统是绿联改造过的debian12吧,我写死main.sh中的变量然后更新成功了。 系统介绍可以看【UGOS Pro 系统介绍】,如果需要机器验证可以点页面上的 【在线体验】 Image

你可以看到这个特制系统对于 os-release 文件没有任何修改,只是添加了一个属于自己内部版本的标识变量 OS_VERSION,其它变量都是 Debian 默认的,这种不规范的现象就已经从侧面印证着我上面的解释,正确的判定思路我在上面提过了,那就是先判定系统为 UGOS 再按 Debian 换源的逻辑处理。