apt-get 有一个源配置文件source.list,里面可配置镜像链接。(/etc/apt/source.list) apt-get install执行时会先检查本地有无该文件,apt-get下载的文件默认在(/var/cache/apt/archives)。 若有责直接进行安装;若没有该文件则取配置的镜像链接中去下载镜像文件,进行安装。
apt-get install vim 时出现错误,则缺少镜像链接。
在 /etc/apt/source.list 中添加以下内容:
#
# deb cdrom:[Debian GNU/Linux 6.0.7 _Squeeze_ - Official amd64 DVD Binary-1 20130223-14:06]/ squeeze contrib main
#deb cdrom:[Debian GNU/Linux 6.0.7 _Squeeze_ - Official amd64 DVD Binary-1 20130223-14:06]/ squeeze contrib main
# Line commented out by installer because it failed to verify:
#deb http://security.debian.org/ squeeze/updates main contrib
# Line commented out by installer because it failed to verify:
#deb-src http://security.debian.org/ squeeze/updates main contrib
# squeeze-updates, previously known as 'volatile'
# A network mirror was not selected during install. The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#
# deb http://ftp.debian.org/debian/ squeeze-updates main contrib
# deb-src http://ftp.debian.org/debian/ squeeze-updates main contrib
deb http://mirrors.163.com/debian/ squeeze main contrib non-free
deb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main
# added by zhjx
deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free
之后更新,apt-get update
这样就可以安装了。