无法在 Debian 6 中安装软件

无法在 Debian 6 中安装软件

我在虚拟机上安装Debian 6 Squeez,但无法使用aptitude或安装软件apt-get。这是我的sources.list文件:

root@debian:/etc/apt# cat sources.list
# 

# deb cdrom:[Debian GNU/Linux 6.0.5 _Squeeze_ - Official i386 DVD Binary-1 20120512-13:45]/ squeeze contrib main

deb cdrom:[Debian GNU/Linux 6.0.5 _Squeeze_ - Official i386 DVD Binary-1 20120512-13:45]/ squeeze contrib main

deb http://security.debian.org/ squeeze/updates main contrib
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
root@debian:/etc/apt# 

我尝试评论这些cdrom行,我还尝试添加我在网上找到的一些来源,但它们都不起作用。谁能告诉我为什么默认sources.list文件没有适当的配置,以便我可以轻松地aptitude install lftp进行举例?我可以做什么来从他们的存储库安装软件?

答案1

正如我所看到的,您没有主要(非更新、非安全)存储库(我想知道为什么)。这就是你的样子sources.list

deb http://archive.debian.org/debian oldstable main contrib
deb http://ftp.debian.org/debian/ squeeze-updates main contrib
deb http://security.debian.org/ squeeze/updates main contrib

之后,您应该运行:

sudo apt-get update
sudo apt-get upgrade

lftp现在您只需使用以下命令即可安装该软件包:

sudo apt-get install lftp

答案2

注释掉每个“deb cdrom:”行,然后添加该行

deb http://security.debian.org/ squeeze main contrib

到你的sources.list,然后

$ sudo aptitude update
$ sudo aptitude install [package name]

如果您尝试从测试/实验安装包,请添加

deb http://ftp.debian.org/debian experimental main

到你的sources.list,然后使用获取一个包

$ sudo aptitude update
$ sudo aptitude -t experimental install [package name]

相关内容