请问使用apt-get的时候可以使用代理么?

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

请问使用apt-get的时候可以使用代理么?

#1

帖子 smartcar » 2007-01-16 12:02

我发现我使用一些源速度很是问题,我有一个比较好的代理,请问大家有没有遇到类似问题,谢谢了!
头像
dogfox
论坛版主
帖子: 5311
注册时间: 2006-09-02 14:18
来自: 汉桑城
联系:

#2

帖子 dogfox » 2007-01-16 12:07

修改apt.confg文件
加入代理地址即可
全世界linux爱好者联合起来 !
smartcar
帖子: 131
注册时间: 2006-04-07 14:14
来自: 北京
联系:

非常感谢您的回复

#3

帖子 smartcar » 2007-01-16 13:45

不过我看了手册man apt.conf
发现目前文档里面只有http代理,ftp代理,是不是目前只能支持这些代理 :?: 而比如socks等还不支持 :?:
gman3025
帖子: 151
注册时间: 2007-01-13 18:55

#4

帖子 gman3025 » 2007-01-18 9:55

嗯,应该可以的,不过我没试过,HTTP代理已经很快了
smartcar
帖子: 131
注册时间: 2006-04-07 14:14
来自: 北京
联系:

#5

帖子 smartcar » 2007-01-18 18:29

好的,谢谢,我试试,如果有结果了,我会贴上来
gman3025 写了:嗯,应该可以的,不过我没试过,HTTP代理已经很快了
smartcar
帖子: 131
注册时间: 2006-04-07 14:14
来自: 北京
联系:

#6

帖子 smartcar » 2007-01-30 14:04

根据我阅读文档的了解,目前apt-get应该还不支持socks代理,不过我用proxychains解决了这个问题
具体的做饭是:
安装proxychains
sudo apt-get install proxychains
配置proxychains


# proxychains.conf VER 2.0
#
# HTTP, SOCKS4, SOCKS5 tunneling proxifier.
#

# The option below identifies how the ProxyList is treated.
# only one option should be uncommented at time,
# otherwise the last appearing option will be accepted
#
# Dynamic - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
# (dead proxies are skipped)
# otherwise EINTR is returned to the app
#
# Strict - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# all proxies must be online to play in chain
# otherwise EINTR is returned to the app
#
# Random - Each connection will be done via random proxy
# (or proxy chain, see chain_len) from the list
# this option is good for scans

#dynamic_chain
#strict_chain
random_chain

# Make sense only if random_chain
chain_len = 1

# Quiet mode (no output)
quiet_mode

# Write stats about good proxies to proxychains.stats
#write_stats

#Some timeouts in milliseconds
#
tcp_read_time_out 15000
tcp_connect_time_out 10000

[ProxyList]
# ProxyList format
# type host port [user pass]
# (values separated by 'tab' or 'blank')
#
#
# Examples:
#
# socks5 192.168.67.78 1080 lamer secret
# http 192.168.89.3 8080 justu hidden
# socks4 192.168.1.49 1080
# http 192.168.39.93 8080
#
#
# proxy types: http, socks4, socks5
# ( auth types supported: "basic"-http "user/pass"-socks )
#
#socks5 192.168.1.4 1080
#socks4 10.5.81.143 1080
#http 192.168.203.18 8080
socks5 some_ip 1080


然后在需要使用代理的时候
sudo proxychains apt-get install doxygen doxygen-doc doxygen-gui graphviz

gman3025 写了:嗯,应该可以的,不过我没试过,HTTP代理已经很快了
回复