11人参与 • 2025-03-04 • Linux
众所周知,linux可以通过apt命令安装软件,那么apt又是从哪里获取软件包呢并安装呢?
这里就绕不开一个文件source.list,该文件定义了软件源相关的信息。
下面以实际例子,详细的介绍下这个文件。
定义软件源的信息
/etc/apt/source.list
文件的内容如下,以本机为参考,本机环境是x86_64+银河麒麟系统,试图 如下所示:
通过上图可以看出这个可以分为3个部分:
图示如下:
进入10.1目录后可以看到如下目录:
上图中的可以看到main restricted universe等目录。这些目录就有不同的含义。
含义如下所示:
main
:官方支持的自由软件。restricted
:官方支持的非完全自由的软件。universe
:社区维护的自由软件。multiverse
:非自由软件。继续进入下层目录,例如点击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
至此,应该了解了这个文件的作用了吧,哈哈!
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
您想发表意见!!点此发布评论
版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。
发表评论