mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
core: 修复 el7 无法安装 epel 里面的软件包
This commit is contained in:
parent
e6760deed3
commit
6024a8434a
@ -228,7 +228,6 @@ bash reinstall.sh windows \
|
||||
- Massgrave
|
||||
- <https://massgrave.dev/genuine-installation-media.html> (Recommended, iso sourced from official channels, updated monthly, includes the latest patches)
|
||||
- Microsoft
|
||||
- <https://www.microsoft.com/software-download/windows8>
|
||||
- <https://www.microsoft.com/software-download/windows10> (Need to open it with a mobile User-Agent)
|
||||
- <https://www.microsoft.com/software-download/windows11>
|
||||
- <https://www.microsoft.com/software-download/windowsinsiderpreviewiso> (Preview)
|
||||
|
@ -228,7 +228,6 @@ bash reinstall.sh windows \
|
||||
- Massgrave
|
||||
- <https://massgrave.dev/genuine-installation-media.html> (推荐,iso 来自官方,每月更新,包含最新补丁)
|
||||
- 微软
|
||||
- <https://www.microsoft.com/software-download/windows8>
|
||||
- <https://www.microsoft.com/software-download/windows10> (需用手机 User-Agent 打开)
|
||||
- <https://www.microsoft.com/software-download/windows11>
|
||||
- <https://www.microsoft.com/software-download/windowsinsiderpreviewiso> (预览版)
|
||||
|
19
reinstall.sh
19
reinstall.sh
@ -1385,17 +1385,24 @@ install_pkg() {
|
||||
esac
|
||||
}
|
||||
|
||||
try_find_epel_name() {
|
||||
epel=$($pkg_mgr repolist --all | awk '{print $1}' | grep -Ei '(epel|epol)$')
|
||||
get_epel_repo_name() {
|
||||
# el7 不支持 yum repolist --all,要使用 yum repolist all
|
||||
# el7 yum repolist 第一栏有 /x86_64 后缀,因此要去掉。而 el9 没有
|
||||
$pkg_mgr repolist all | awk '{print $1}' | awk -F/ '{print $1}' | grep -Ei '(epel|epol)$'
|
||||
}
|
||||
|
||||
get_epel_pkg_name() {
|
||||
$pkg_mgr list | grep -E '(epel|epol)-release' | awk '{print $1}' | cut -d. -f1 | head -1
|
||||
}
|
||||
|
||||
if is_need_epel; then
|
||||
if ! try_find_epel_name; then
|
||||
epel_release="$($pkg_mgr list | grep -E '(epel|epol)-release' | awk '{print $1}' | cut -d. -f1 | head -1)"
|
||||
$pkg_mgr install -y $epel_release
|
||||
try_find_epel_name
|
||||
if ! epel=$(get_epel_repo_name); then
|
||||
$pkg_mgr install -y "$(get_epel_pkg_name)"
|
||||
epel=$(get_epel_repo_name)
|
||||
fi
|
||||
enable_epel="--enablerepo=$epel"
|
||||
else
|
||||
enable_epel=
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user