APT工具

APT库源配置文件

列出所有的库 文件的位置: /etc/apt/sources.list

系统初安装之后应该用apt update更新本地软件安装包数据库

文件通常具有如下格式:

deb http://site.example.com/debian distribution component1 component2 component3
deb-src http://site.example.com/debian distribution component1 component2 component3

Archive类型

  1. deb :包含二进制安装包,这些安装包是经常用到经过编译的包(预编译),类似于windows中的.exe文件
  2. Deb-src 包含源码包,包含Debian控制文件(.dsc),记录打包程序时需要的操作的文件(diff.gz)

Component

从依赖的角度看:

  • main 包含遵守DFSG(Debian Free Software
    Guidelines)规范的包,无外界依赖,只有这类包Debian发行版系统才会默认捆绑下载
  • contrib: 包含遵守DFSG规范的包,包含除了main类包之外的依赖,可能对于Debian不是免费的
  • non-free 包含不遵守DFSG规范的包

另外还有另一种角度,那就是免不免费

  • Main - Officially supported software.官方正版软件
  • Restricted 并非在完全免费的证书下
  • Universe 社区版软件
  • Multiverse 非免费软件

Distribution

  • 这个值或者是Debian的研发代号,就像eclipse版本有什么火星,木星之类的一样。 研发代号有:jessie, stretch, buster, sid
    使用名字的原因是开发人员在开发的时候并不知道这一版本什么时候出来,所以用名字通常比较直白一点,发布以年:月份来标识,每年有个大的代号,隔月有个小代号:
    在这里插入图片描述
  • 或者是OS发布类型 发布类型有测试版,稳定版,过时的但稳定的版本等oldstable, stable, testing, unstable

URL不看也知道是下载的链接,另外你还可以配置连接成https类型,不过这个可能过于详细,就没看,详情见:

APT sources.list

我的Ubuntu版本是16.04也就是2016年4月份的,sources.list文件大致是这样的:

# deb cdrom:[Ubuntu-Server 16.04.5 LTS _Xenial Xerus_ - Release amd64 (20180731)]/ xenial main restricted

deb cdrom:[Ubuntu-Server 16.04.5 LTS _Xenial Xerus_ - Release amd64 (20180731)]/ xenial main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe

APT软件安装包

APT软件安装包都在 /var/cache/apt/archives/
这里面是APT工具存放软件安装包的地方,扩展名都是.deb包,为debian缩写,因为Ubuntu是基于Debian的发行版Linux系统。

Utils

  1. apt-get clean
    这个命令会清楚所有的在/var/cache/apt/archives下的软件安装包。清掉这些安装包不会影响现有的软件。一般这条命令是为了节省存储空间
    只剩下lock空的,和partial目录空的。

猜你喜欢

转载自blog.csdn.net/qq_33745102/article/details/85120964
apt