国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

解決ubuntu新虛擬機下apt update報錯和git clone失敗的問題

這篇具有很好參考價值的文章主要介紹了解決ubuntu新虛擬機下apt update報錯和git clone失敗的問題。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

1.apt update

新的虛擬機,安裝git發(fā)現(xiàn)apt不能正常使用,報錯如下

Err:1 http://linux.mellanox.com/public/repo/mlnx_ofed/5.1-2.5.8.0/ubuntu18.04/amd64 ./ InRelease
  Temporary failure resolving 'linux.mellanox.com'
Err:2 https://mirrors.aliyun.com/ubuntu focal InRelease
  Temporary failure resolving 'mirrors.aliyun.com'
Err:3 https://mirrors.aliyun.com/ubuntu focal-security InRelease
  Temporary failure resolving 'mirrors.aliyun.com'
Err:4 https://mirrors.aliyun.com/ubuntu focal-updates InRelease
  Temporary failure resolving 'mirrors.aliyun.com'
Err:5 https://mirrors.aliyun.com/ubuntu focal-backports InRelease
  Temporary failure resolving 'mirrors.aliyun.com'
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: Failed to fetch https://mirrors.aliyun.com/ubuntu/dists/focal/InRelease  Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch https://mirrors.aliyun.com/ubuntu/dists/focal-security/InRelease  Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch https://mirrors.aliyun.com/ubuntu/dists/focal-updates/InRelease  Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch https://mirrors.aliyun.com/ubuntu/dists/focal-backports/InRelease  Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch http://linux.mellanox.com/public/repo/mlnx_ofed/5.1-2.5.8.0/ubuntu18.04/amd64/./InRelease  Temporary failure resolving 'linux.mellanox.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

第一反應是考慮到apt源配置可能有問題,用vi /etc/apt/source.list打開源發(fā)現(xiàn)沒有問題,用ping測試網(wǎng)絡,ping百度報錯unkown host,ping 8.8.8.8可以通,應該是域名解析錯誤,vi /etc/resolv.conf更改nameserver,輸入兩個8.8.8.8和8.8.4.4,然后apt update可以成功了。

2.git clone 失敗

git clone https://github.com/NVIDIA/nccl.git
Cloning into 'nccl'...
fatal: unable to access 'https://github.com/NVIDIA/nccl.git/': Failed to connect to github.com port 443: No route to host

原因:服務器沒掛梯子,可能的解決辦法:文章來源地址http://www.zghlxwxcb.cn/news/detail-769817.html

更改DNS

vi /etc/resolv.conf
#輸入以下內(nèi)容 :wq退出保存
nameserver 114.114.114.114

用其他機器上傳到國內(nèi)倉庫

#在其他機器上下載并上傳到國內(nèi)倉庫
git clone https://github.com/NVIDIA/nccl-tests.git
cd nccl-tests
git remote set-url origin https://gitee.com/username/nccl-tests.git
git add .
git commit -m "initial commit"
git push -u origin master

到了這里,關于解決ubuntu新虛擬機下apt update報錯和git clone失敗的問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉載,請注明出處: 如若內(nèi)容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包