日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

【错误记录】Ubuntu 修改 hosts 文件 ( 使用 gedit /etc/hosts 命令打开并修改 hosts 文件 )

發(fā)布時(shí)間:2025/6/17 55 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【错误记录】Ubuntu 修改 hosts 文件 ( 使用 gedit /etc/hosts 命令打开并修改 hosts 文件 ) 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

文章目錄

  • 一、報(bào)錯(cuò)信息
  • 二、解決方案





一、報(bào)錯(cuò)信息



參考 【錯(cuò)誤記錄】git clone 報(bào)錯(cuò) ( fatal: unable to access ‘https…‘:gnutls_handshake() failed: Error in the pu ) 博客 ;

之前是通過(guò)切換網(wǎng)絡(luò)的方式 , 解決了問(wèn)題 , 這種方式隨機(jī)性太大 , 繼續(xù)分析該問(wèn)題 ;

檢查是否能 ping 通 GitHub , 執(zhí)行

ping github.com

命令 , 執(zhí)行結(jié)果如下 , 丟包率 100% , 無(wú)法 ping 通 ;





二、解決方案



參考 Windows 中的解決方案 【錯(cuò)誤記錄】GitHub 網(wǎng)站和倉(cāng)庫(kù)無(wú)法訪問(wèn) ( 域名重定向 | 檢查 C:\Windows\System32\drivers\etc\hosts 配置文件中的 GitHub 地址域名配置 ) , 修改 Ubuntu 系統(tǒng)的 /etc/hosts 文件 ;

設(shè)置 GitHub 域名 :

140.82.114.4 github.com 151.101.77.194 github.global.ssl.fastly.net

執(zhí)行

gedit /etc/hosts

命令 , 打開(kāi) /etc/hosts 文件 , 將 GitHub 域名添加到文件中 , 完整文件內(nèi)容為 :

127.0.0.1 localhost 127.0.1.1 octopus 140.82.114.4 github.com 151.101.77.194 github.global.ssl.fastly.net# The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters


保存并關(guān)閉 gedit 編輯器 ; ( 此處也可以使用 vim , vi 等文本編輯器 )

再次執(zhí)行

ping github.com

命令 , 最終 ping 通 GitHub :

root@octopus:~/ijkplayer# ping github.com PING github.com (140.82.114.4) 56(84) bytes of data. 64 bytes from github.com (140.82.114.4): icmp_seq=1 ttl=49 time=279 ms 64 bytes from github.com (140.82.114.4): icmp_seq=2 ttl=49 time=303 ms 64 bytes from github.com (140.82.114.4): icmp_seq=3 ttl=49 time=278 ms ^C --- github.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2004ms rtt min/avg/max/mdev = 278.916/287.292/303.563/11.515 ms root@octopus:~/ijkplayer#

《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專(zhuān)家共同創(chuàng)作,文字、視頻、音頻交互閱讀

總結(jié)

以上是生活随笔為你收集整理的【错误记录】Ubuntu 修改 hosts 文件 ( 使用 gedit /etc/hosts 命令打开并修改 hosts 文件 )的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。