[英]Cannot clone git repo un EC2 iNSTANCE
I used the following command and tried to clone a repo but unfortunately the following error pops up.我使用了以下命令并尝试克隆一个 repo,但不幸的是弹出了以下错误。 I cannot go further
我不能走得更远
ubuntu@ip-add-rr-ee-ss:~$ git clone https://github.com/repo/file.git
Cloning into 'file'... fatal: unable to access 'https://github.com/repo/file.git/': Could not resolve host: github.com
Could not resolve host
无法解析主机
This must be due to DNS issue on your EC2 instance (I can see that you're using Ubuntu here)这一定是由于您的 EC2 实例上的 DNS 问题(我可以看到您在这里使用的是 Ubuntu)
curl
to test the connection to that URL firstcurl
来测试与该 URL 的连接cat /etc/resolv.conf
cat /etc/resolv.conf
vi /etc/resolv.conf
vi /etc/resolv.conf
[Esc]
and type :wq
[Esc]
并键入:wq
保存文件 I fixed the problem once I added the following to my outbound connection for my group security setting:一旦我将以下内容添加到我的组安全设置的出站连接中,我就解决了这个问题:
Type: All traffic
Protocol: All
ip: 0.0.0.0/0
This also fixed my sudo yum install issues too.这也解决了我的 sudo yum 安装问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.