I have following directory structure for apt
/locate/repo/x86_64/dists
/locate/repo/x86_64/pool
/locate/repo/x86_64/indices
/locate/repo/x86_64/images
In pool there two directories which are debian-installer (contains udeb files), main (contains deb files). I want to remove a few deb files in main and use apt for installation. How can I do it?
答案 0 :(得分:1)
为了使.deb
个文件可以apt
转发,您需要在Packages
中至少提供/locate/repo/x86_64/dists
个文件。此文件列出了所有包(对于给定的套件),并包含所有元数据(描述,依赖关系......)
您的具体操作取决于您的设置,因为numerous options to manage an apt-repository。
一个简单的选择是使用apt-ftparchive
(可以在apt-utils
包中找到):
$ cd /locate/repo/x86_64
$ mkdir -p dists/jessie/
$ apt-ftparchive packages pool/ | gzip > dists/jessie/Packages.gz
$ apt-ftparchive release dists/jessie/ > dists/jessie/Release
最后,您需要将存储库添加到apt-sources。
# mkdir -p /etc/apt/sources.list.d/
# cat > /etc/apt/sources.list.d/myownrepo.list <<EOF
deb file:////locate/repo/x86_64 jessie main
EOF
#
之后,您只需运行apt-get update
即可通过apt
安装您的软件包。
从存储库中删除文件,只需删除它们:
$ rm /locate/repo/x86_64/pool/ugly*.deb
之后,您需要(重新)生成Packages
个文件