Linux

关注公众号 jb51net

关闭
首页 > 网站技巧 > 服务器 > Linux > linux source.list的使用

linux之source.list的使用解析

投稿:jingxian

/etc/apt/source.list文件定义了软件源的相关信息,包括档案类型、仓库地址和版本代号,仓库地址指向了软件包的索引文件和具体存放路径,修改该文件后需要更新软件包列表,才能安装新的软件

linux source.list的使用

众所周知,linux可以通过apt命令安装软件,那么apt又是从哪里获取软件包呢并安装呢?

这里就绕不开一个文件source.list,该文件定义了软件源相关的信息。

下面以实际例子,详细的介绍下这个文件。

文件作用

定义软件源的信息

文件所在路径

/etc/apt/source.list

文件解析

文件的内容如下,以本机为参考,本机环境是x86_64+银河麒麟系统,试图 如下所示:

通过上图可以看出这个可以分为3个部分:

图示如下:

进入10.1目录后可以看到如下目录:

上图中的可以看到main restricted universe等目录。这些目录就有不同的含义。

含义如下所示:

继续进入下层目录,例如点击main目录,图示如下所示:

可以看到该目录下包含了不同平台的索引文件文件夹,例如amd64 arm64 loongarch64(龙心平台),mips平台等。

那索引文件呢呢?图示如下:

Packages.gz是一个压缩包文件,将文件解压后是一个纯文本文件,文件里面将该平台中所有支持的软件包信息列出来,打开解压后的文件,文件内容类似如下:

Package: libxcb-image0-dev
Architecture: arm64
Version: 0.4.0-1build1
Multi-Arch: same
Priority: extra
Section: libdevel
Source: xcb-util-image
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Kylin Developers <devel-discuss@kylinos.cn>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 74
Depends: libxcb-image0 (>= 0.4.0-1build1), libxcb1-dev, libxcb-shm0-dev---依赖项
Filename: pool/main/x/xcb-util-image/libxcb-image0-dev_0.4.0-1build1_arm64.deb--文件路径
Size: 15916
MD5sum: 0ebc6ff841d52c2e6a5da11fb047cb1d
SHA1: 65284ef5d55de682a72a258c49295669496ecc01
SHA256: 51e2b623826b289a9b57c5fccfcfd43a47a8563b100a16ae0de57f196542199c
SHA512: 2437b6d23beaaec3fc9fc30390cf1d616757d971c130852a3f77ba02edc1eb8e7c34b09f1be795177d0ae01554ef431b24c899b31ba9bbb911b626dcc25c644f
Homepage: http://xcb.freedesktop.org
Description: utility libraries for X C Binding -- image, development files
This package contains the header and library files needed to build software
using libxcb-image, providing port of Xlib's XImage and XShmImage functions.
.
The xcb-util module provides a number of libraries which sit on top of
libxcb, the core X protocol library, and some of the extension
libraries. These experimental libraries provide convenience functions
and interfaces which make the raw X protocol more usable. Some of the
libraries also provide client-side code which is not strictly part of
the X protocol but which have traditionally been provided by Xlib.
Second-Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
X-Raw-MD5sum: 54b05e232bed763c18979eab8f3c40be
cert_subject_cn: 麒麟软件有限公司
cert_subject_o: 麒麟软件有限公司
cert_subject_ou: DS120G321040301

修改该文件如何生效

sudo apt-get update

至此,应该了解了这个文件的作用了吧,哈哈!

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。

您可能感兴趣的文章:
阅读全文