Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

请问如何在非tmoe容器的debian中安装tmoe tools? #223

Answered by 2moe
Sunrongguo2008 asked this question in Q&A
Discussion options

You must be logged in to vote
# 更新 apt 索引
sudo apt update
# 安装依赖
sudo apt install curl whiptail

# match_dpkg_ver(pkg: string, ver: regex_str) -> bool
match_dpkg_ver() {
    LANG=C dpkg-query -W $1 2>/dev/null | awk -v ver=$2 '{ b = match($2, ver)} END{ print (b)?"true":"false"}' 2>/dev/null
}

# 判断 libpopt0 版本是否为 1.19
is_libpopt_1_19=$(match_dpkg_ver libpopt0 '^1\.19[+\-.~]')

# 判断 libnewt 是否为 0.52.21
is_libnewt_0_52_21=$(match_dpkg_ver libnewt0.52 '^0\.52\.21[+\-.~]')

# 如果二者皆为 true 的话,说明需要修复
$is_libpopt_1_19 && $is_libnewt_0_52_21 && {
  _file="wrapper.tar.gz"
  curl -Lo $_file "https://packages.tmoe.me/patch/debian/w/whiptail/whiptail-wrapper_0.52.21_$(dpkg --print-architecture).tar.gz"
  sudo tar -zxvf $_file -C …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Sunrongguo2008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants