deb-aptly工具使用

# 查看源码包名
aptly repo search -format="包名:{{.Package}} | 架构:{{.Architecture}} | 版本:{{.Version}} | 源码包名:{{.Source}} " test 'Name (~ ^.*)'


13# aptly 基本使用

# 查看 aptly 当前本地的配置
aptly config show

# 清除 aptly 清除db
# 数据库清理删除有关未引用包的信息并删除,包池中不再被包使用的文件
aptly db cleanup

# 恢复 aptly 数据库
# 数据库恢复在崩溃后尽力恢复数据库。建议在运行recover之前备份数据库
aptly db recover

# 命令图显示镜像、本地存储库和,使用graphviz包呈现快照和发布的存储库,以图形表示图像。
aptly graph

# 根据远程镜像地址创建仓库
aptly mirror create wheezy-main http://mirror.yandex.ru/debian/ wheezy main
# 同步仓库信息
aptly mirror update wheezy-main
# 创建快照信息
aptly snapshot create wheezy-main-2014-08-16 from mirror wheezy-main
# 上传快照
aptly publish snapshot wheezy-main-2014-08-16

# 查看镜像列表
aptly mirror list
# 每行显示名称
aptly mirror list -raw
# 显示仓库对应所有的包与版本信息
aptly mirror show -with-packages test

# 镜像修改架构
aptly mirror edit --architectures=i386,amd64,arm64,mips64el test

# 搜索根据名称, 过滤架构, 过滤关键字
aptly mirror search test 'Name (% systemd*), $Architecture (i386), !Name (% *tests*)'
aptly mirror search test 'Name (% lib*), $Architecture (i386), Version (>=3)'

# 命令更改镜像的名称。镜像名称应唯一
aptly mirror rename <old-name> <new-name>

# Drop删除有关远程存储库镜像的信息。软件包数据不会被删除(其他镜像或快照仍可以使用)。如果将镜像用作创建快照的源,则适当地拒绝删除该镜像,请使用标志-force进行覆盖。
aptly mirror drop <name>

# 创建本地仓库
aptly repo create <name>
aptly mirror create -dep-follow-source test-1031 http://pools.uniontech.com/desktop-professional test/1031 main contrib non-free
aptly mirror create -dep-follow-source test-1041 http://aptly.uniontech.com/pkg/test-1041 unstable main
aptly mirror create -ignore-signatures -architectures=i386,amd64,arm64,sw_64,mips64el,loongarch,loongarch64 -with-sources drive-service http://drive-packages.uniontech.com/drive test non-free


# 删除本地仓库
aptly repo drop local-repo

# 查看仓库中的信息
aptly repo list
aptly repo list -raw

# 查看对应的名称的信息
aptly repo show <name>
aptly repo show -with-packages <name>

# 像仓库推入包
aptly repo add test-repo apt_1.4.8+deepin_amd64.deb
# 从仓库删除制定包
aptly repo remove test-repo apt

# 从指定mirror导入到仓库中
aptly repo import test test-repo udev_241.3-1+deepin_i386
aptly repo import test test-repo udev_241.3-1+deepin_mips64el

# 从删除指定的包名(全名则可删除指定包) 
aptly repo remove test-repo2 udev_241.3-1+deepin_mips64el

# 从一个仓库直接复制指定包到另一个仓库, 增加 -with-deps 可自动解决依赖
aptly repo copy test-repo test-repo2 udev
aptly repo copy test-repo test-repo2 udev_241.3-1+deepin_mips64el
# 同上
aptly repo move test-repo2 test-repo udev
aptly repo move test-repo test-repo2 udev_241.3-1+deepin_mips64el

# 根据指定版本过滤搜索
aptly repo search test-repo 'Version (>=2)'
# 修改对应仓库的组件信息与分发信息
aptly repo edit -comment="Nightly builds" -distribution=wheezy testing
# 重命名
aptly repo rename <old-name> <new-name>
# 删除仓库
aptly repo drop <name>
# 修改仓库的分配
aptly repo edit -distribution="test" test-repo2


# 查看快照列表
aptly snapshot list
# 每行显示名称
aptly snapshot list -raw
# 显示快照对应所有的包与版本信息
aptly snapshot show -with-packages test-2020-07-14

# 从本地仓库创建快照
aptly snapshot create snap-stable from repo stable

# 验证快照中软件包之间的依赖关系
aptly snapshot verify test-2020-07-15

# 从快照中提取 新包(及其依赖项)到快照。如果快照已包含要拉出的软件包,则pull命令还可以升级软件包版本 。作为此过程的结果,将创建新的快照。
aptly snapshot pull test-2020-07-15 test-2020-07-14 test libgtk-3-common_3.24.5.7-1+deepin_all

# 通过过滤快照的条件生成新的快照
aptly snapshot filter test-2020-07-14 new_snapshot 'Version (>=3)'

# 显示两个快照之间的程序包差异。快照是软件包的列表,因此快照之间的区别是软件包列表之间的区别。一个快照中的软件包可能完全丢失,或者两个快照中都有不同版本的软件包。
aptly snapshot diff <name-a> <name-b>
# -only-matching 仅显示软件包版本的差异(不显示缺少的软件包)
aptly snapshot diff -only-matching new_snapshot test-2020-07-14

# 使用 merge 可以合并多个快照
aptly snapshot merge merge-snapshot test test-2020-07-14 test-2020-07-15

# 快照搜索匹配
aptly snapshot search merge-snapshot 'Name (~ ^libgtk*)'

# 命令更改快照的名称。快照名称应唯一
aptly snapshot rename <old-name> <new-name>

# Drop删除有关快照的信息。如果快照已发布,则不能删除(首先删除快照的发布)。
aptly snapshot drop <name>

 

# 包搜索工具,根据名称和格式搜索展示
aptly package search -format="{{.Package}} (version {{.Version}})" 'Name (~ ^lib.*)'

# 通过包管理搜索版本之间的包信息
aptly package search 'Version (>=1.2.3-2), Version (<2)'

# 通过包管理查看指定包的详细信息包括映射镜像和仓库
aptly package show -with-files -with-references exfat-fuse-dbgsym
# 查看指定包信息
aptly package show -with-files -with-references exfat-fuse-dbgsym_1.3.0.3-1+deepin_i386


# 查看发布的信息
aptly publish list

# 发布仓库的信息,可以根据 -distribution 的不同名称去区分,发布是热更新无需重启服务
aptly publish repo <repo-name>

# 删除发布的信息
aptly publish drop unstable filesystem:test:demo


# 发布到Minio上
aptly publish repo -architectures="amd64" -skip-signing repo-test s3:test:aptly/

posted @ 2023-01-10 10:10  Cookie-Fei  阅读(377)  评论(0编辑  收藏  举报