怎样通过代理使用apt(我用虚拟机安装的Linux)?

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
greatsnows
帖子: 43
注册时间: 2005-11-24 1:26

怎样通过代理使用apt(我用虚拟机安装的Linux)?

#1

帖子 greatsnows » 2006-11-17 9:08

我公司上网需要通过一台服务器代理上网,并且需要用户名和密码。
我在网上搜索了很多方法,都不行。
请大家帮忙!
(版本6.06,我使用vmware安装的ubuntu)
poiuy321
帖子: 52
注册时间: 2006-10-17 20:29

#2

帖子 poiuy321 » 2006-11-17 9:51

"系统"---"首选项"---"网络代理"

没试过,不懂可以不可以...
greatsnows
帖子: 43
注册时间: 2005-11-24 1:26

不行啊,我找了好久的解决办法都没有找到。。。

#3

帖子 greatsnows » 2006-11-17 9:55

各位再帮着想象办法
xinjiemail11
帖子: 94
注册时间: 2006-10-15 18:53

#4

帖子 xinjiemail11 » 2006-11-17 12:52

那你的主机可以上网吧?
比如说你的系统的XP?
如果你的XP可以上网,那你开通VM的NAT,应该就可以上网哇。
通过你的XP实现IP转发。
greatsnows
帖子: 43
注册时间: 2005-11-24 1:26

#5

帖子 greatsnows » 2006-11-18 22:31

情况是这样的,我上网要通过我们公司自己的代理(IP:142.100.xx.xxx)。我想它可能封闭了一些端口吧。
在NAT模式下,怎么用apt啊?

各位帮忙啦
cubuntu
帖子: 8
注册时间: 2006-11-18 23:51

#6

帖子 cubuntu » 2006-11-19 0:11

只要你的主机(你的应该是XP吧? )可以上网...那么按照下面的步骤

连接原理: 虚拟机网络<--->主机中的vmware虚拟网卡(共两个)<--->主机的本地网络共享<--->路由器代理<--->互联网

1...首先确认你的XP是否按装了vmware的虚拟网卡了没有?共两个,一个是VMware Network Adapter VMnet1,和VMware Network Adapter VMnet8.如果没有,重装vmware。

2...在vmware设置 网卡为 host-only(对应VMware Network Adapter VMnet1)

3...在XP的网络连接中设置 internet连接共享,选择VMware Network Adapter VMnet1。

4....检查主机的虚拟网卡【VMware Network Adapter VMnet1】的IP地址,我的是192.168.0.1。

5...在虚拟机中,也就是ubuntu中,在【系统】--->【系统管理】--->【联网】,设置网卡属性,IP地址必须与VMware Network Adapter VMnet1的IP地址段相对应,我的配置是:192.168.0.6,255.255.255.0,192.168.0.1(这个网关地址就是主机VMware Network Adapter VMnet1的IP地址)

6...在虚拟机中,也就是ubuntu中,在【系统】--->【系统管理】--->【联网】,设置DNS属性,我的是192.168.0.1.


经过这样设置可以在vmware的虚拟机上网了。速度相对主机会有点慢,毕竟经过了这么多层的中继。
greatsnows
帖子: 43
注册时间: 2005-11-24 1:26

谢谢,我明天上班试试看。

#7

帖子 greatsnows » 2006-11-19 8:24

:)
头像
sinoyster
帖子: 958
注册时间: 2005-10-16 13:24
来自: 四川成都
联系:

#8

帖子 sinoyster » 2006-11-19 9:54

console 下设置http_proxy和ftp_proxy
如果用synapgic的话要编辑/etc/apt/apt.conf,添加
Acquire::http::Proxy "http://user:password@proxy:port";
Acquire::ftp::Proxy "http://user:password@proxy:port";
Thank you Ubuntu Team!!!!
I still can't belive this is free...
greatsnows
帖子: 43
注册时间: 2005-11-24 1:26

SOSOS

#9

帖子 greatsnows » 2006-11-19 14:23

I can't insert chinese......

When I followed upsteys, and do "sudo apt-get update ", appre below.

忽略 http://ubuntu.cn99.com dapper Release.gpg
忽略 http://ubuntu.cn99.com dapper-updates Release.gpg
忽略 http://ubuntu.cn99.com dapper-security Release.gpg
忽略 http://ubuntu.cn99.com dapper-backports Release.gpg
忽略 http://ubuntu.cn99.com dapper Release.gpg
忽略 http://ubuntu.cn99.com dapper Release
忽略 http://ubuntu.cn99.com dapper-updates Release
忽略 http://ubuntu.cn99.com dapper-security Release
忽略 http://ubuntu.cn99.com dapper-backports Release
忽略 http://ubuntu.cn99.com dapper Release
忽略 http://ubuntu.cn99.com dapper/main Packages
忽略 http://ubuntu.cn99.com dapper/restricted Packages
忽略 http://ubuntu.cn99.com dapper/universe Packages
忽略 http://ubuntu.cn99.com dapper/multiverse Packages
忽略 http://ubuntu.cn99.com dapper-updates/main Packages
忽略 http://ubuntu.cn99.com dapper-updates/restricted Packages
忽略 http://ubuntu.cn99.com dapper-updates/universe Packages
忽略 http://ubuntu.cn99.com dapper-updates/multiverse Packages
忽略 http://ubuntu.cn99.com dapper-security/main Packages
忽略 http://ubuntu.cn99.com dapper-security/restricted Packages
忽略 http://ubuntu.cn99.com dapper-security/universe Packages
忽略 http://ubuntu.cn99.com dapper-security/multiverse Packages
忽略 http://ubuntu.cn99.com dapper-backports/main Packages
忽略 http://ubuntu.cn99.com dapper-backports/restricted Packages
忽略 http://ubuntu.cn99.com dapper-backports/universe Packages
忽略 http://ubuntu.cn99.com dapper-backports/multiverse Packages
忽略 http://ubuntu.cn99.com dapper/main Packages
忽略 http://ubuntu.cn99.com dapper/restricted Packages
忽略 http://ubuntu.cn99.com dapper/universe Packages
忽略 http://ubuntu.cn99.com dapper/multiverse Packages
错误 http://ubuntu.cn99.com dapper/main Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper/restricted Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper/universe Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper/multiverse Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper-updates/main Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper-updates/restricted Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper-updates/universe Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper-updates/multiverse Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper-security/main Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper-security/restricted Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper-security/universe Packages
从服务器读取数据出错 - read (104 Connection reset by peer)
错误 http://ubuntu.cn99.com dapper-security/multiverse Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper-backports/main Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper-backports/restricted Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper-backports/universe Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper-backports/multiverse Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper/main Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper/restricted Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper/universe Packages
407 Proxy authorization required
错误 http://ubuntu.cn99.com dapper/multiverse Packages
407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... ackages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... i386/Packa ges.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... 86/Package s.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... i386/Packa ges.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... y-i386/Pac kages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... /binary-i3 86/Packages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... inary-i386 /Packages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... /binary-i3 86/Packages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... ry-i386/Pa ckages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... d/binary-i 386/Packages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... binary-i38 6/Packages.gz 从服务器读取数据出错 - read (104 Connection reset by peer)
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... e/binary-i 386/Packages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... ary-i386/P ackages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... ed/binary- i386/Packages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... /binary-i3 86/Packages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu/dists/dap ... se/binary- i386/Packages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu-cn/dists/ ... 6/Packages .gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu-cn/dists/ ... ry-i386/Pa ckages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu-cn/dists/ ... -i386/Pack ages.gz 407 Proxy authorization required
无法下载 http://ubuntu.cn99.com/ubuntu-cn/dists/ ... ry-i386/Pa ckages.gz 407 Proxy authorization required
正在读取软件包列表... 完成
E: 有一些索引文件不能下载,它们可能被忽略了,也可能转而使用了旧的索引文件。

Why??? Pls help me.
greatsnows
帖子: 43
注册时间: 2005-11-24 1:26

#10

帖子 greatsnows » 2006-11-20 22:12

最后顶一下,我们公司好像用的是sun的服务器。
我同样装的server版可以apt-get update,但是抄server的/etc/apt/apt.conf还是没用。郁闷之极啊
greatsnows
帖子: 43
注册时间: 2005-11-24 1:26

哈哈,解决了~~~~~~~~~~~

#11

帖子 greatsnows » 2007-02-05 10:49

感谢sinoyster(8楼)
我给他的回复注释一下:

“console 下设置http_proxy和ftp_proxy
如果用synapgic的话要编辑/etc/apt/apt.conf,添加
Acquire::http::Proxy "http://user:password@proxy:port";
Acquire::ftp::Proxy "http://user:password@proxy:port";”

user:代理用的用户名
password:代理用的密码
proxy:代理的网址
port:代理的端口

谢谢!!!
回复