1 sudo gedit /etc/hosts
1)打开hosts文件进行修改(其中xxx.xxx.xxx.xxx为本机IP地址):
127.0.0.1 localhost
127.0.1.1 galileo-HP-Pavilion-Notebook
xxx.xxx.xxx.xxx github.com git
13.250.177.223 github.com
2)然后在后面继续添加:
# GitHub Start
192.30.253.112 github.com
192.30.253.119 gist.github.com
151.101.100.133 assets-cdn.github.com
151.101.100.133 raw.githubusercontent.com
151.101.100.133 gist.githubusercontent.com
151.101.100.133 cloud.githubusercontent.com
151.101.100.133 camo.githubusercontent.com
151.101.100.133 avatars0.githubusercontent.com
151.101.100.133 avatars1.githubusercontent.com
151.101.100.133 avatars2.githubusercontent.com
151.101.100.133 avatars3.githubusercontent.com
151.101.100.133 avatars4.githubusercontent.com
151.101.100.133 avatars5.githubusercontent.com
151.101.100.133 avatars6.githubusercontent.com
151.101.100.133 avatars7.githubusercontent.com
151.101.100.133 avatars8.githubusercontent.com
# GitHub End
3)最后运行:
sudo /etc/init.d/networking restart
此时,github可以正常访问,但图片资源丢失!
2 图片资源丢失解决:
1)直接F12,点击网络,查看github页面图片丢失的地址(一般为gitbubbusercontent.com)
2)然后查看该地址ip
3)sudo gedit /etc/hosts 打开hosts,在最后添加ip以及相应地址
添加的地址如下:
199.232.68.133 raw.githubusercontent.com
199.232.68.133 camo.githubusercontent.com
199.232.68.133 gist.githubusercontent.com
199.232.68.133 cloud.githubusercontent.com
199.232.68.133 assets-cdn.githubusercontent.com
199.232.68.133 user-images.githubusercontent.com
199.232.68.133 avatars0.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com
199.232.68.133 avatars2.githubusercontent.com
199.232.68.133 avatars3.githubusercontent.com
199.232.68.133 avatars4.githubusercontent.com
199.232.68.133 avatars5.githubusercontent.com
199.232.68.133 avatars6.githubusercontent.com
199.232.68.133 avatars7.githubusercontent.com
199.232.68.133 avatars8.githubusercontent.com
4)最后运行:
sudo /etc/init.d/networking restart
最后,关于github库下载慢的问题,可以参考以下视频。
https://www.bilibili.com/video/BV13Z4y1p75s?t=219
解决ubuntu下,github网页无法加载、加载慢、图片无法加载等问题
最新推荐文章于 2024-06-02 19:19:34 发布