Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

从根本上解决unraid从github之类网站下载包经常失败问题

Featured Replies

首先大概描述下问题所在:

  1. github等网站经常被墙导致无法访问
  2. 就算能连上也经常无法下载或者速度特别慢

然后说下大概解决思路:

  1. 使用国内github镜像网站替换掉原始地址
  2. 发现很多网站https不能下载,http反而速度还可以,那就用把下载地址的https替换为http。
  3. unraid下载大多数时候使用的是wget命令,所以在wget里面完成以上操作即可

最后说下我的具体步骤,仅供参考:

  1. 因为/usr/local/bin优先级高于/usr/bin,所以我在/usr/local/bin中写了个同名wget脚本,内容如下,主要作用就是将调用wget的参数做替换,然后再传给真正的wget:
#!/bin/bash
opts=$@
opts=`echo $opts | sed -e 's;raw.githubusercontent.com;raw.staticdn.net;g' -e 's;https://raw.github.com/;https://raw.staticdn.net/;g' -e 's;https://github.com/;https://github.com.cnpmjs.org/;g' -e 's;https://;http://;g' `
/usr/bin/wget ${opts}
  1. 这个wget脚本我实际存储在/mnt/user/system/bin/wget,在/boot/config/go中链接到/usr/local/bin中,命令如下:
    find /mnt/user/system/bin -type f ! -name ".*~" -exec ln -sf {} /usr/local/bin/ \;

 

然后你就发现系统中的所有下载好用了,尤其更新系统安装插件。

同样思路可以做很多事。

  • 4 weeks later...

可以给萌新出个详细的操作方法吗,不能顺利的从github上下载软件太让新人痛苦了

Edited by Xie1000

现在能做最好的方法是梯子,墙把外面隔绝了,以上的方法并不能根本解决问题,只能是偶尔透过缝看月光而已。

还有一种方法在自定义脚本中每次开机执行

wget -qO - https://raw.hellogithub.com/hosts | cat - >> /etc/hosts

会将hosts替换为以下

# Generated
127.0.0.1       
54.149.176.35   keys.lime-technology.com
# GitHub520 Host Start
140.82.113.25                 alive.github.com
140.82.114.26                 live.github.com
185.199.108.154               github.githubassets.com
140.82.112.22                 central.github.com
185.199.108.133               desktop.githubusercontent.com
185.199.108.153               assets-cdn.github.com
185.199.108.133               camo.githubusercontent.com
185.199.108.133               github.map.fastly.net
199.232.69.194                github.global.ssl.fastly.net
140.82.113.4                  gist.github.com
185.199.108.153               github.io
140.82.113.4                  github.com
192.0.66.2                    github.blog
140.82.112.5                  api.github.com
185.199.108.133               raw.githubusercontent.com
185.199.108.133               user-images.githubusercontent.com
185.199.108.133               favicons.githubusercontent.com
185.199.108.133               avatars5.githubusercontent.com
185.199.108.133               avatars4.githubusercontent.com
185.199.108.133               avatars3.githubusercontent.com
185.199.108.133               avatars2.githubusercontent.com
185.199.108.133               avatars1.githubusercontent.com
185.199.108.133               avatars0.githubusercontent.com
185.199.108.133               avatars.githubusercontent.com
140.82.114.9                  codeload.github.com
52.217.70.196                 github-cloud.s3.amazonaws.com
52.216.139.27                 github-com.s3.amazonaws.com
54.231.201.121                github-production-release-asset-2e65be.s3.amazonaws.com
52.217.160.249                github-production-user-asset-6210df.s3.amazonaws.com
52.217.160.249                github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.108.153               githubstatus.com
64.71.144.202                 github.community
23.100.27.125                 github.dev
185.199.108.133               media.githubusercontent.com
185.199.108.133               cloud.githubusercontent.com
185.199.108.133               objects.githubusercontent.com


# Update time: 2022-02-09T20:06:23+08:00
# Update url: https://raw.hellogithub.com/hosts
# Star me: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End

这样也能正常访问github相关网站

  • 4 months later...

mark

  • 1 month later...

😀好,mark

你这思路还可以向/dev/net中添加其他设备驱动 666,能给解释下那条go中的命令吗,我看看有没有其他发挥余地😂

  • 2 weeks later...
  • Author

其实主要思路是/usr/local/bin优先级大于/usr/bin/,自己可以自定义一些同名命令放在/usr/loca/bin/下面,这样系统调研就都会调用你的命令。
/usr/local/bin/下面命令可以是对参数解析更改后传给/usr/bin下的原始命令

  • Author
On 7/21/2022 at 11:23 PM, wongdi said:

你这思路还可以向/dev/net中添加其他设备驱动 666,能给解释下那条go中的命令吗,我看看有没有其他发挥余地😂

 

go那条命令就是把自定义的命令链接到/usr/local/bin下面

大佬,我用了这个方法,然后重启了unraid,发现用which wget时,显示的仍然是/usr/bin/下的wget,这可能是什么原因?难道是因为我使用了oh-my-zsh的原因吗?我的go完整内容为:

root@Tower:~# cat /boot/config/go
#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &

/bin/sh /boot/config/custom-init.sh

#docker
# prepare folder
mkdir -p /etc/docker

# update mirror
tee /etc/docker/daemon.json << EOF
{
  "registry-mirrors": [
    "https://*********.mirror.aliyuncs.com"
  ]
}
EOF

# https://obsolete.blog/2021/07/10/persistent-zsh-oh-my-zsh-on-unraid/
# give me oh-my-zsh
tar xjf /boot/root/zsh.tar.bz2 -C /root/
ln -s /root/.bash_profile /root/.bashrc

# and update it!
cp /boot/root/omz-update.sh /root/ && chmod +x /root/omz-update.sh && /root/omz-update.sh

# begin https://forums.unraid.net/topic/124014-i-need-config-a-proxy/?do=findComment&comment=1130948
http_proxy=http://192.168.50.107:7893
https_proxy=http://192.168.50.107:7893
echo "export http_proxy=\"http://192.168.50.107:7893\"" >> /root/.zshrc
echo "export https_proxy=\"http://192.168.50.107:7893\"" >> /root/.zshrc
# end


# github access issue solove under gfw https://forums.unraid.net/topic/118444-%E4%BB%8E%E6%A0%B9%E6%9C%AC%E4%B8%8A%E8%A7%A3%E5%86%B3unraid%E4%BB%8Egithub%E4%B9%8B%E7%B1%BB%E7%BD%91%E7%AB%99%E4%B8%8B%E8%BD%BD%E5%8C%85%E7%BB%8F%E5%B8%B8%E5%A4%B1%E8%B4%A5%E9%97%AE%E9%A2%98/
find /mnt/user/system/bin -type f ! -name ".*~" -exec ln -sf {} /usr/local/bin/ \;

而且我发现/usr/local/bin下也没有建立软连接啊:

$ ll /usr/local/bin
total 16M
-rwxr-xr-x 1 root root 2.9M Aug  3 07:14 docker-compose
-rwxr-xr-x 1 root root 1.8M Mar  1  2015 plink
-rwxr-xr-x 1 root root 1.8M Mar  1  2015 pscp
-rwxr-xr-x 1 root root 1.8M Mar  1  2015 psftp
-rwxr-xr-x 1 root root 1.7M Mar  1  2015 pterm
-rwxr-xr-x 1 root root 2.9M Mar  1  2015 putty
-rwxr-xr-x 1 root root 738K Mar  1  2015 puttygen
-rwxr-xr-x 1 root root 1.9M Mar  1  2015 puttytel
-rwxr-xr-x 1 root root  452 Aug  8 23:05 smartlocate
drwxr-xr-x 3 root root  180 Aug  8 23:06 unraid-api

# root @ Tower in ~ [23:06:53]
$ ll /mnt/user/system/bin
total 4.0K
-rw-rw-rw- 1 root root 264 Jul 23 14:20 wget

 

Edited by tingyu

  • 1 month later...
On 2/9/2022 at 10:31 PM, foxjojo said:

还有一种方法在自定义脚本中每次开机执行

wget -qO - https://raw.hellogithub.com/hosts | cat - >> /etc/hosts

会将hosts替换为以下

# Generated
127.0.0.1       
54.149.176.35   keys.lime-technology.com
# GitHub520 Host Start
140.82.113.25                 alive.github.com
140.82.114.26                 live.github.com
185.199.108.154               github.githubassets.com
140.82.112.22                 central.github.com
185.199.108.133               desktop.githubusercontent.com
185.199.108.153               assets-cdn.github.com
185.199.108.133               camo.githubusercontent.com
185.199.108.133               github.map.fastly.net
199.232.69.194                github.global.ssl.fastly.net
140.82.113.4                  gist.github.com
185.199.108.153               github.io
140.82.113.4                  github.com
192.0.66.2                    github.blog
140.82.112.5                  api.github.com
185.199.108.133               raw.githubusercontent.com
185.199.108.133               user-images.githubusercontent.com
185.199.108.133               favicons.githubusercontent.com
185.199.108.133               avatars5.githubusercontent.com
185.199.108.133               avatars4.githubusercontent.com
185.199.108.133               avatars3.githubusercontent.com
185.199.108.133               avatars2.githubusercontent.com
185.199.108.133               avatars1.githubusercontent.com
185.199.108.133               avatars0.githubusercontent.com
185.199.108.133               avatars.githubusercontent.com
140.82.114.9                  codeload.github.com
52.217.70.196                 github-cloud.s3.amazonaws.com
52.216.139.27                 github-com.s3.amazonaws.com
54.231.201.121                github-production-release-asset-2e65be.s3.amazonaws.com
52.217.160.249                github-production-user-asset-6210df.s3.amazonaws.com
52.217.160.249                github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.108.153               githubstatus.com
64.71.144.202                 github.community
23.100.27.125                 github.dev
185.199.108.133               media.githubusercontent.com
185.199.108.133               cloud.githubusercontent.com
185.199.108.133               objects.githubusercontent.com


# Update time: 2022-02-09T20:06:23+08:00
# Update url: https://raw.hellogithub.com/hosts
# Star me: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End

这样也能正常访问github相关网站

厉害呀,只需要做这个dns设置就可以了,比别的方案包括楼主1楼的更改更方便,对系统的修改更小。特地申请帐号回复

  • Author

你单运行下这条命令看看

mark

  • 1 month later...

mark~

思路不错,感谢楼主的分享

 

直接把脚本写到 local/bin 目录相对更简单些

 

tee /usr/local/bin/wget <<-'EOF'
#!/bin/bash
opts=$@
opts=`echo $opts | sed -e 's;raw.githubusercontent.com;raw.staticdn.net;g' -e 's;https://raw.github.com/;https://raw.staticdn.net/;g' -e 's;https://github.com/;https://github.com.cnpmjs.org/;g' -e 's;https://;http://;g' `
/usr/bin/wget ${opts}
EOF

chmod +x /usr/local/bin/wget

 

mark, 最近也是被这个弄得很烦

  • 2 months later...

mark

  • 2 weeks later...

楼主这个思路可以。试了下的确快多了😄

  • 2 months later...
On 2/9/2022 at 10:31 PM, foxjojo said:

还有一种方法在自定义脚本中每次开机执行

wget -qO - https://raw.hellogithub.com/hosts | cat - >> /etc/hosts

会将hosts替换为以下

# Generated
127.0.0.1       
54.149.176.35   keys.lime-technology.com
# GitHub520 Host Start
140.82.113.25                 alive.github.com
140.82.114.26                 live.github.com
185.199.108.154               github.githubassets.com
140.82.112.22                 central.github.com
185.199.108.133               desktop.githubusercontent.com
185.199.108.153               assets-cdn.github.com
185.199.108.133               camo.githubusercontent.com
185.199.108.133               github.map.fastly.net
199.232.69.194                github.global.ssl.fastly.net
140.82.113.4                  gist.github.com
185.199.108.153               github.io
140.82.113.4                  github.com
192.0.66.2                    github.blog
140.82.112.5                  api.github.com
185.199.108.133               raw.githubusercontent.com
185.199.108.133               user-images.githubusercontent.com
185.199.108.133               favicons.githubusercontent.com
185.199.108.133               avatars5.githubusercontent.com
185.199.108.133               avatars4.githubusercontent.com
185.199.108.133               avatars3.githubusercontent.com
185.199.108.133               avatars2.githubusercontent.com
185.199.108.133               avatars1.githubusercontent.com
185.199.108.133               avatars0.githubusercontent.com
185.199.108.133               avatars.githubusercontent.com
140.82.114.9                  codeload.github.com
52.217.70.196                 github-cloud.s3.amazonaws.com
52.216.139.27                 github-com.s3.amazonaws.com
54.231.201.121                github-production-release-asset-2e65be.s3.amazonaws.com
52.217.160.249                github-production-user-asset-6210df.s3.amazonaws.com
52.217.160.249                github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.108.153               githubstatus.com
64.71.144.202                 github.community
23.100.27.125                 github.dev
185.199.108.133               media.githubusercontent.com
185.199.108.133               cloud.githubusercontent.com
185.199.108.133               objects.githubusercontent.com


# Update time: 2022-02-09T20:06:23+08:00
# Update url: https://raw.hellogithub.com/hosts
# Star me: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End

这样也能正常访问github相关网站

我直接在mikrotik路由器里更改DNS了,感谢大佬

上一年舉家搬回國內家中長居,經常因為GFW搞到無法安裝更新,專門找出多年前的Phicomm N1做了ByPass Gateway,只供Unraid使用,一了百了……

然後將需要爬牆的設備全部改gateway,不需要的設備正常上網

  • 4 months later...

  • 5 weeks later...
On 1/11/2022 at 6:38 PM, sunzhigang said:

首先大概描述下问题所在:

  1. github等网站经常被墙导致无法访问
  2. 就算能连上也经常无法下载或者速度特别慢

然后说下大概解决思路:

  1. 使用国内github镜像网站替换掉原始地址
  2. 发现很多网站https不能下载,http反而速度还可以,那就用把下载地址的https替换为http。
  3. unraid下载大多数时候使用的是wget命令,所以在wget里面完成以上操作即可

最后说下我的具体步骤,仅供参考:

  1. 因为/usr/local/bin优先级高于/usr/bin,所以我在/usr/local/bin中写了个同名wget脚本,内容如下,主要作用就是将调用wget的参数做替换,然后再传给真正的wget:
#!/bin/bash
opts=$@
opts=`echo $opts | sed -e 's;raw.githubusercontent.com;raw.staticdn.net;g' -e 's;https://raw.github.com/;https://raw.staticdn.net/;g' -e 's;https://github.com/;https://github.com.cnpmjs.org/;g' -e 's;https://;http://;g' `
/usr/bin/wget ${opts}
  1. 这个wget脚本我实际存储在/mnt/user/system/bin/wget,在/boot/config/go中链接到/usr/local/bin中,命令如下:
    find /mnt/user/system/bin -type f ! -name ".*~" -exec ln -sf {} /usr/local/bin/ \;

 

然后你就发现系统中的所有下载好用了,尤其更新系统安装插件。

同样思路可以做很多事。

牛的,解决了商店打不开的问题。没想到后台其实是用的wget

如何创建同名wget脚本? 直接vi wget 吗? 为什么/usr/bin目录下带wget脚本后缀带个“*”:wget*

  • 6 months later...

unraid应用市场不能下载和安装应用程序确实难受,从网上搜索到楼上大佬们的贴子,这下有救了。

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.