转载来源:https://wiki.debian.org/SourcesList#Repository_URL
Debian操作系统的源配置信息详解--Source.list配置文件详解
Debian操作系统的配置文件 /etc/apt/sources.list
作为其操作的一部分,Apt使用一个文件列出可以从中获取包的“源”。该文件是/etc/apt/sources.list。
此文件中的条目通常遵循以下格式(以下条目是虚构的,不应使用):
deb http://site.example.com/debian distribution component1 component2 component3
deb-src http://site.example.com/debian distribution component1 component2 component3
存档类型
每行的第一个单词deb或deb-src表示存档的类型。Deb表示存档包含二进制包(deb),我们通常使用的预编译包。Deb-src表示源包,它是原始程序源加上Debian控制文件(.dsc)和diff.gz,包含打包程序所需的更改。
存储库URL
该行的下一个条目是您要从中下载软件包的存储库的URL 。Debian存储库镜像的主要列表位于此处。
分配
'distribution'可以分别是发布代码名称/别名(jessie,stretch,buster,sid)或发布类(oldstable,stable,testing,unstable)。如果您要跟踪版本类,则使用类名,如果要跟踪Debian版本,请使用代码名称。
例如,如果你有一个运行Debian 9.6“拉伸”的系统并且不想在Debian破坏者发布时升级,那么使用'stretch'而不是'stable'来进行分发。如果您总是想帮助测试测试版本,请使用“测试”。如果你正在跟踪破坏者,并希望从测试到使用寿命结束,请使用“破坏者”。
参数
main 表示由符合DFSG标准的软件包组成,它们不依赖于该区域外的软件来运行。这些是被认为是Debian发行版的一部分的唯一包。
contrib 表示软件包包含符合DFSG标准的软件,但依赖项不在main中(可能是非免费的Debian打包)。
non-free 表示包含不符合DFSG的软件。
示例sources.list
下面是Debian 9 / Stretch 的sources.list示例。
deb http://deb.debian.org/debian stretch main
deb-src http://deb.debian.org/debian stretch main
deb http://deb.debian.org/debian-security/ stretch/updates main
deb-src http://deb.debian.org/debian-security/ stretch/updates main
deb http://deb.debian.org/debian stretch-updates main
deb-src http://deb.debian.org/debian stretch-updates main
如果你还想要contrib和非free组件,请在main之后添加contrib non-free:
deb http://deb.debian.org/debian stretch main contrib non-free
deb-src http://deb.debian.org/debian stretch main contrib non-free
deb http://deb.debian.org/debian-security/ stretch/updates main contrib non-free
deb-src http://deb.debian.org/debian-security/ stretch/updates main contrib non-free
deb http://deb.debian.org/debian stretch-updates main contrib non-free
deb-src http://deb.debian.org/debian stretch-updates main contrib non-free
PS:笔者亲测推荐这个配置,因为很多时候,必须要contrib 和 non-free的依赖,不然很多包根本安装不上,这个也是标准配置,您改成这样应该就差不多了,当然有些读者可能更倾向于国内的源,但是Debian的官方源的速度其实还是不错的,推荐官方的标准配置,这样最稳定,也最可靠,记住配置源后,请执行:sudo apt-get update 更新源信息
若配置apt-transport-https包安装,则可以通过https://开头的使用https协议的URL......在上述所有线路使用过加密的HTTPS连接的存储库。
您可以使用GNOME工具编辑sources.list文件。通过菜单→系统→管理→软件源访问它。
gksu --desktop /usr/share/applications/software-properties.desktop /usr/bin/software-properties-gtk
使用Tor和Apt
Apt可以通过Tor检索和下载更新。为此,您需要安装tor和apt-transport-tor软件包。然后,您可以使用Debian提供的官方洋葱服务。这是使用Debian 9 / Stretch的onion服务的示例sources.list:
deb tor+http://vwakviie2ienjx6t.onion/debian stretch main
deb-src tor+http://vwakviie2ienjx6t.onion/debian stretch main
deb tor+http://sgvtcaew4bxjd7ln.onion/debian-security stretch/updates main
deb-src tor+http://sgvtcaew4bxjd7ln.onion/debian-security stretch/updates main
deb tor+http://vwakviie2ienjx6t.onion/debian stretch-updates main
deb-src tor+http://vwakviie2ienjx6t.onion/debian stretch-updates main
光盘
如果您更愿意使用CD-ROM安装软件包或使用APT自动更新系统,可以将其放在/etc/apt/sources.list中。为此,您可以使用apt-cdrom程序,如下所示:
#apt-cdrom add
在驱动器中使用Debian CD-ROM。
您可以使用-d作为CD-ROM安装点的目录或添加非CD安装点(即USB keydrive)。
名称解析
有时,名称解析可能会中断。例如,下面是来自QEMU Chroot中运行的S / 390x端口:
# apt-get update
0% [Working]Unsupported socketcall: 20
Unsupported socketcall: 20
Unsupported socketcall: 20
Unsupported socketcall: 20
Unsupported socketcall: 20
Unsupported socketcall: 20
Unsupported socketcall: 20
Unsupported socketcall: 20
Err:1 http://ftp.us.debian.org/debian testing InRelease
Temporary failure resolving 'ftp.us.debian.org'
Reading package lists... Done
W: Failed to fetch http://ftp.us.debian.org/debian/dists/testing/InRelease Temporary failure resolving 'ftp.us.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
您可以通过从另一台计算机获取IP地址,然后使用IP地址而不是URI来临时解决它:
echo "deb http://128.30.2.26/debian testing main" > /etc/apt/sources.list
apt-get update
Get:1 http://128.30.2.26/debian testing InRelease [232 kB]
Get:2 http://128.30.2.26/debian testing/main s390x Packages [7583 kB]
Get:3 http://128.30.2.26/debian testing/main Translation-en [5134 kB]
Fetched 13.0 MB in 32s (403 kB/s)
Reading package lists... Done
调试符号包
要调试崩溃,您通常需要相关的调试符号文件。对于大多数Debian软件包,这些软件包都在dbgsym软件包中。这些可以从单独的存档中获得。
以下是Debian 9 / Stretch dbgsym包的sources.list的示例条目:
deb http://deb.debian.org/debian-debug/ stretch-debug main
如果您正在运行测试,则相同。
deb http://deb.debian.org/debian-debug/ testing-debug main
如果您使用的是不稳定的分布,还有一个例子。
deb http://deb.debian.org/debian-debug/ unstable-debug main
更多信息
-
获取额外软件的非官方存储库列表(Skype,Opera,Google)
-
RepositoryInstructions - 解释如何设置安全的第三方存储库并告诉用户如何配置它
来源:CSDN
作者:YumWisdom
链接:https://blog.csdn.net/Aria_Miazzy/article/details/84844803