VM on win7 运行kali 终端能git clone 却不能apt update

Kvm、VMware、Virtualbox、Xen、Qemu 等
回复
hacker85
帖子: 567
注册时间: 2010-02-25 11:19
送出感谢: 1 次
接收感谢: 0

VM on win7 运行kali 终端能git clone 却不能apt update

#1

帖子 hacker85 » 2019-07-16 23:55

1、我的VM是15版本 运行在win7上 虚拟了一个kali linux系统 一切运行没有问题

2、当我在VM虚拟起来的kali上设置好了网络代理后 kali的浏览器可以正常上网 终端在git clone代码的时候 也正常

3、但当我在终端里用apt-get update 命令的时候 却接连提示could not connect

代码: 全选

Err:1 http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling InRelease          
  Could not connect to mirrors.tuna.tsinghua.edu.cn:80 (101.6.8.193). - connect (111: Connection refused)
Err:2 http://mirrors.zju.edu.cn/kali kali-rolling InRelease                    
  Could not connect to mirrors.zju.edu.cn:80 (210.32.158.231). - connect (111: Connection refused)
Err:3 http://http.kali.org/kali kali-rolling InRelease                         
  Could not connect to http.kali.org:80 (192.99.200.113). - connect (111: Connection refused)
Err:4 http://mirrors.ustc.edu.cn/kali kali-rolling InRelease                   
  Could not connect to mirrors.ustc.edu.cn:80 (218.104.71.170). - connect (111: Connection refused) Could not connect to mirrors.ustc.edu.cn:80 (202.141.176.110). - connect (111: Connection refused)
Reading package lists... Done                           
Building dependency tree       
Reading state information... Done
80 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease  Could not connect to http.kali.org:80 (192.99.200.113). - connect (111: Connection refused)
W: Failed to fetch http://mirrors.ustc.edu.cn/kali/dists/kali-rolling/InRelease  Could not connect to mirrors.ustc.edu.cn:80 (218.104.71.170). - connect (111: Connection refused) Could not connect to mirrors.ustc.edu.cn:80 (202.141.176.110). - connect (111: Connection refused)
W: Failed to fetch http://mirrors.zju.edu.cn/kali/dists/kali-rolling/InRelease  Could not connect to mirrors.zju.edu.cn:80 (210.32.158.231). - connect (111: Connection refused)
W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/kali/dists/kali-rolling/InRelease  Could not connect to mirrors.tuna.tsinghua.edu.cn:80 (101.6.8.193). - connect (111: Connection refused)
W: Some index files failed to download. They have been ignored, or old ones used instead.
这是为什么 ???????

注:我在终端里也配置了环境变量 export https_proxy export http_proxy 等等
头像
独行猫儿
帖子: 144
注册时间: 2009-02-25 18:07
送出感谢: 1 次
接收感谢: 4 次

Re: VM on win7 运行kali 终端能git clone 却不能apt update

#2

帖子 独行猫儿 » 2019-07-17 1:19

我猜你的网络不配置代理是不能上网的。
而 sudo 的网络连接不走当前用户的环境变量,即你配的 https_proxy 和 http_proxy 对于 apt 来说都是不认的。
官方文档:https://help.ubuntu.com/community/AptGe ... http-proxy
这些用户感谢了作者 独行猫儿 于这个帖子:
hacker85 (2019-07-17 8:08)
评价: 3.7%
<!--这是一段注释。注释不会在浏览器中显示。-->
回复

回到 “虚拟机和虚拟化”