source.list

来源:互联网 发布:a股数据接口 编辑:程序博客网 时间:2024/05/17 01:31
 

由修改sources.list来决定软件来源的版本


安装软件的信息都记载在[/etc/apt/sources.list]这个文档中。

sources.list 文档中设定格式如下:
deb uri distribution [component1] [componenent2] [...]


各个选项说明:

============================================================
deb
   
两种写法,分别为 『 deb 』 和 『 deb-src 』,前者表示所指向的存放 binary 格式(编译好的执行文档套件) 的服务器位置,后者为 sources 格式(包含原始代码的软件套件)的服务器的位置。
   
只想安装软件而不想再编译她就使用 『 deb 』 , 假如想取得软件的源代码 ( sources code ) ,就使用『 deb-src 』 , 也能够两行都写:
   
deb http://http.us.debian.org/debian stable main contrib non-free
   
deb-src http://http.us.debian.org/debian stable main contrib non-free
   
============================================================
uri ( Universal Resource Identifier )
   
uri
指的是软件来源的位置,能够使系统内的某个位置 ( file ) 、也能够是光驱 ( cdrom ) 、能够是网络 ( http 、 ftp
)……等,当用 apt-get 命令时,就会到这些位置去找软件库。一共有 file 、 cdrom 、 http 、 ftp 、copy
、rsh 、ssh 等几个参数,比较常用的参数如下:
  
============================================================   
file
       
能够是您系统上的某个目录,如下:
       
deb file:/home/moto/debian stable main contrib non-free
       
也能够是 mount 到自己系统远端的 NFS Server,如下:
       
deb file:/mnt/nfs-server stable main contrib non-free

============================================================       
cdrom
       
光驱牒片上的位置,如下:
       
deb cdrom:/dists stable main contrib non-free

============================================================
http
       
通过 http 的协议传送,如下:
       
deb http://http.us.debian.org/debian stable main contrib non-free
        
============================================================
ftp
通过 ftp 的协议传送,如下:

deb ftp://ftp.us.debian.org/debian stable main contrib non-free

============================================================
============================================================
关于 『 sources.list 』 一些注意事项
   
尽管由 sources.list 能让我们同时取得不同版本的软件,假如您的 sources.list 总同时包含了 『stable 』、『 testing 』、『 unstable 』 三种版本来源时,就等于设定为 『 unstable
』 了,因为软件版本的新旧是 『 unstable 』 新于 『 testing 』 新于 『 stable 』。使用 『 testing 』版本的话,不要同时把 『 unstable 』 的服务器加到 『 sources.list 』,因为一旦更新完毕,您的软件就成了 『 unstable 』 版本了。

原创粉丝点击