apt-get如何使用代理?

为当前最终发行版之前的所有版本提供支持
回复
lyychee
帖子: 36
注册时间: 2005-06-06 19:44
来自: 中国嘉善
送出感谢: 0
接收感谢: 0
联系:

apt-get如何使用代理?

#1

帖子 lyychee » 2005-12-16 1:43

我是通过代理方式上网的(非网关型)
但是apt-get默认是不支持系统代理的。
我想问一下怎么通过代理来进行apt-get install?
记得以前用debain的时候,可以通过在/etc/apt/apt.conf里增加代理设置:
Acquire::http::Proxy "http://proxy-server:port"
来实现,
那么请问,在Ubuntu中要如何实现,
另外,能否像redhat安装rpm一样,把所有deb都wget下来。然后再从本地安装,对于网络状况不好的用户有很大的帮助,
请高手指教。
:)
头像
longmjshen
帖子: 94
注册时间: 2005-10-18 13:55
送出感谢: 0
接收感谢: 0

#2

帖子 longmjshen » 2005-12-16 9:22

在/etc/apt下创建一文件apt.conf
在里面输入
Acquire::http::Proxy "http://usrer:password@proxyip:port";
这样就可以进行apt更新了
Love6v
帖子: 3
注册时间: 2005-12-16 12:22
送出感谢: 0
接收感谢: 0

#3

帖子 Love6v » 2005-12-16 12:30

终端运行export http_proxy="http://用户名:密码@代理IP:代理端口"也可
lyychee
帖子: 36
注册时间: 2005-06-06 19:44
来自: 中国嘉善
送出感谢: 0
接收感谢: 0
联系:

#4

帖子 lyychee » 2005-12-16 12:31

谢谢。
:)
glorry
帖子: 72
注册时间: 2006-02-21 15:25
送出感谢: 0
接收感谢: 0

#5

帖子 glorry » 2006-03-13 14:37

Network Proxy没有作用!web brower,APT,Gaim IM都要自己设!!

System--Preferences--Network Proxy设置成Automatic proxy configuration就是不行!
而Firfox web brower要自己的proxy设置才可以。
Gain Internet Messenger也要设proxy才行。

问题在于通过proxy的APT怎么都不行,我用的porxy是要用用户名密码鉴权的,而用户名是域用户,比如:用户user123,域是domain123,在windows里要用用户为“domain123\user123"
现在用了n种办法:
1,System--Preferences--Network Proxy设置成Automatic proxy configuration就是不行!
2,按http://wiki.ubuntu.org.cn/index/system/ConfigAptProxy修改文件不行!
3,新增/etc/apt/apt.conf为
Acquire::http::Proxy "http://user123:password@111.222.xxxx.xxx:8080";
or
Acquire::http::Proxy "http://domain123\user123:password@111.222.xxxx.xxx:8080";
or
Acquire::http::Proxy "http://user123:password@proxyabc.xxx.com.cn:8080";
or
"http://user123:password@proxyabc.xxx.com.cn";

总是提示:~# sudo apt-get install linux-686
Reading package lists... Done
Building dependency tree... Done
W: Couldn't stat source package list http://debian.cn99.com stable/main Packages (/var/lib/apt/lists/debian.cn99.com_debian_dists_stable_main_binary-i386_Packag es) - stat (2 No such file or directory)
W: Couldn't stat source package list http://debian.cn99.com stable/non-free Pack ages (/var/lib/apt/lists/debian.cn99.com_debian_dists_stable_non-free_binary-i38 6_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://debian.cn99.com stable/contrib Packa ges (/var/lib/apt/lists/debian.cn99.com_debian_dists_stable_contrib_binary-i386_ Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://debian.cn99.com stable/non-US/main P ackages (/var/lib/apt/lists/debian.cn99.com_debian-non-US_dists_stable_non-US_ma in_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://debian.cn99.com stable/non-US/contri b Packages (/var/lib/apt/lists/debian.cn99.com_debian-non-US_dists_stable_non-US _contrib_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://debian.cn99.com stable/non-US/non-fr ee Packages (/var/lib/apt/lists/debian.cn99.com_debian-non-US_dists_stable_non-U S_non-free_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://debian.cn99.com proposed-updates/mai n Packages (/var/lib/apt/lists/debian.cn99.com_debian_dists_proposed-updates_mai n_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://debian.cn99.com proposed-updates/con trib Packages (/var/lib/apt/lists/debian.cn99.com_debian_dists_proposed-updates_ contrib_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://debian.cn99.com proposed-updates/non -free Packages (/var/lib/apt/lists/debian.cn99.com_debian_dists_proposed-updates _non-free_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://debian.cn99.com proposed-updates/non -US/main Packages (/var/lib/apt/lists/debian.cn99.com_debian-non-US_dists_propos ed-updates_non-US_main_binary-i386_Packages) - stat (2 No such file or directory )
W: Couldn't stat source package list http://debian.cn99.com proposed-updates/non -US/contrib Packages (/var/lib/apt/lists/debian.cn99.com_debian-non-US_dists_pro posed-updates_non-US_contrib_binary-i386_Packages) - stat (2 No such file or dir ectory)
W: Couldn't stat source package list http://debian.cn99.com proposed-updates/non -US/non-free Packages (/var/lib/apt/lists/debian.cn99.com_debian-non-US_dists_pr oposed-updates_non-US_non-free_binary-i386_Packages) - stat (2 No such file or d irectory)
W: Couldn't stat source package list http://debian.cn99.com woody/updates/main P ackages (/var/lib/apt/lists/debian.cn99.com_debian-security_dists_woody_updates_ main_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://debian.cn99.com woody/updates/contri b Packages (/var/lib/apt/lists/debian.cn99.com_debian-security_dists_woody_updat es_contrib_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://debian.cn99.com woody/updates/non-fr ee Packages (/var/lib/apt/lists/debian.cn99.com_debian-security_dists_woody_upda tes_non-free_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy/main Pac kages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dists_breezy_main_ binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy/restrict ed Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dists_breezy _restricted_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy/universe Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dists_breezy_u niverse_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy/multiver se Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dists_breezy _multiverse_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-security /main Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dists_bre ezy-security_main_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-security /restricted Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dis ts_breezy-security_restricted_binary-i386_Packages) - stat (2 No such file or di rectory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-security /universe Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dists _breezy-security_universe_binary-i386_Packages) - stat (2 No such file or direct ory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-security /multiverse Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dis ts_breezy-security_multiverse_binary-i386_Packages) - stat (2 No such file or di rectory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-updates/ main Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dists_bree zy-updates_main_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-updates/ restricted Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dist s_breezy-updates_restricted_binary-i386_Packages) - stat (2 No such file or dire ctory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-updates/ universe Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dists_ breezy-updates_universe_binary-i386_Packages) - stat (2 No such file or director y)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-updates/ multiverse Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dist s_breezy-updates_multiverse_binary-i386_Packages) - stat (2 No such file or dire ctory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-backport s/main Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dists_br eezy-backports_main_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-backport s/restricted Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_di sts_breezy-backports_restricted_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-backport s/universe Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_dist s_breezy-backports_universe_binary-i386_Packages) - stat (2 No such file or dire ctory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-backport s/multiverse Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_archive_di sts_breezy-backports_multiverse_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy/main Pac kages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_ubuntu-cn_dists_breezy_mai n_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy/restrict ed Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_ubuntu-cn_dists_bree zy_restricted_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy/universe Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_ubuntu-cn_dists_breezy _universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy/multiver se Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_ubuntu-cn_dists_bree zy_multiverse_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-extras/m ain Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_backports_dists_bre ezy-extras_main_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-extras/r estricted Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_backports_dis ts_breezy-extras_restricted_binary-i386_Packages) - stat (2 No such file or dire ctory)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-extras/u niverse Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_backports_dists _breezy-extras_universe_binary-i386_Packages) - stat (2 No such file or director y)
W: Couldn't stat source package list http://mirror.lupaworld.com breezy-extras/m ultiverse Packages (/var/lib/apt/lists/mirror.lupaworld.com_ubuntu_backports_dis ts_breezy-extras_multiverse_binary-i386_Packages) - stat (2 No such file or dire ctory)
W: You may want to run apt-get update to correct these problems
E: Couldn't find package linux-686
tomphp
帖子: 25
注册时间: 2006-12-05 15:56
送出感谢: 0
接收感谢: 0

#6

帖子 tomphp » 2006-12-19 10:39

太感谢了 终于可以用代理下载了 :lol: :lol: :lol:
gaozw
帖子: 68
注册时间: 2007-01-02 1:47
来自: 杭州
送出感谢: 0
接收感谢: 0
联系:

#7

帖子 gaozw » 2007-01-03 12:33

多谢指点,我也遇到这样的问题了
现在已经解决了
GNOME很漂亮,但KDE很舒适。
Lenovo Sunrise 120 with Kubuntu 7.10
bear85
帖子: 1
注册时间: 2008-04-04 1:25
送出感谢: 0
接收感谢: 0

#8

帖子 bear85 » 2008-04-04 2:58

我想问问如何才能取消代理呢???
doyanger
帖子: 85
注册时间: 2008-04-14 14:00
送出感谢: 0
接收感谢: 0

#9

帖子 doyanger » 2008-05-03 9:29

Love6v 写了:终端运行export http_proxy="http://用户名:密码@代理IP:代理端口"也可
直接上网了,又该如何取消呢?
头像
openware
帖子: 173
注册时间: 2009-02-22 14:15
送出感谢: 0
接收感谢: 0
联系:

Re: apt-get如何使用代理?

#10

帖子 openware » 2009-03-20 23:27

我也遇到了,如何取消的问题.
Desire Freedom, Love Beauty, Keep Hacking。
回复

回到 “老旧版本支持”