繁体   English   中英

无法获取任何东西 - 适用于 Windows 10 的 WSL,尝试为 cLion 安装环境

[英]Can't fetch anything- WSL for windows 10,Trying to install environment for cLion

我为 Windows 10 下载了 WSL ubuntu 18.04,并以管理员身份运行它。 我正在尝试使用本教程安装环境以使用 cLion

我想检查我的 ssh 连接,所以我写道:

ssh user@localhost -p 22

但得到以下错误:

ssh: connect to host localhost port 22: Connection refused

我在尝试解决这个问题时遇到了很多错误,其中大多数是“无法获取”和“连接被拒绝”。

我在 StackOverflow 的某个地方读到卸载 ssh 然后重新安装它。

但是,当我尝试使用以下命令重新安装时,卸载进行得很顺利:

sudo apt-get install openssh-server

并得到以下错误:

Err:1 http://security.ubuntu.com/ubuntu xenial-security/main amd64 openssh-client amd64 1:7.2p2-4ubuntu2.4
  Connection failed [IP: 91.189.88.149 80]
Err:1 http://security.ubuntu.com/ubuntu xenial-security/main amd64 openssh-client amd64 1:7.2p2-4ubuntu2.4
  Connection failed [IP: 91.189.88.149 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openssh/openssh-client_7.2p2-4ubuntu2.4_amd64.deb  Connection failed [IP: 91.189.88.149 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

所以我什至无法重新安装 ssh。

在这里希望得到一些帮助。

谢谢!

连接目标机器的防火墙或者你的防火墙被激活并阻止连接,首先检查防火墙状态,如果它被激活,将其关闭,然后再试一次,通过禁用防火墙建立的连接,尝试将规则添加到您的ip表中获得许可然后反应防火墙。

我在我们公司的网络中遇到了同样的问题。 我无法连接到外部世界,例如使用sudo apt-get update

我需要在 /etc/apt/apt.conf 中添加我们公司的代理并添加以下行:

Acquire::http::Proxy "http://[proxy-ip]:[port]";

对我来说,apt.conf 文件根本没有退出,所以我只是创建了它。

之后,我能够连接到外部世界并且openssh-server的安装顺利。

我知道这已经过时了,但是对于仍然遇到此问题的人,只需转到 /etc/resolv.conf 并注释掉 search lan 行。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM