Remove deb-packages from local repo and configure apt

时间:2015-06-30 13:50:34

标签: ubuntu repository debian apt

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?

1 个答案:

答案 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安装您的软件包。

从存储库中删除.deb文件

从存储库中删除文件,只需删除它们:

$ rm /locate/repo/x86_64/pool/ugly*.deb

之后,您需要(重新)生成Packages个文件