521xueweihan / GitHub520

:kissing_heart: 让你“爱”上 GitHub,解决访问时图裂、加载慢的问题。(无需安装)
21.33k stars 2.15k forks source link

-bash: /etc/hosts: Permission denied #191

Closed Zhonglu closed 1 year ago

Zhonglu commented 1 year ago

你好,

在WSL ubuntu20.04 中使用如下命令: sudo sed -i "/# GitHub520 Host Start/Q" /etc/hosts && curl https://raw.hellogithub.com/hosts >> /etc/hosts

提示错误: -bash: /etc/hosts: Permission denied

祝 好

cxwx commented 1 year ago

Permission denied

sudo  sed -i .....
Zhonglu commented 1 year ago

sudo 之后仍然 permission denied,以上是sudo后的结果

LQYHYQ commented 1 year ago

sudo -i,切换到root用户下,再执行命令sed -i "/# GitHub520 Host Start/Q" /etc/hosts && curl https://raw.hellogithub.com/hosts >> /etc/hosts就可以了

Zhonglu commented 1 year ago

可以了 多谢!

taotieren commented 10 months ago

可以使用 systemd 方式来管理:https://github.com/521xueweihan/GitHub520/pull/212