Sasikiran Vaddi
Sasikiran Vaddi

Reputation: 2319

Remove deb-packages from local repo and configure 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?

Upvotes: 0

Views: 2866

Answers (1)

umläute
umläute

Reputation: 31324

maintaining your own repository

In order to make your .deb files indexable by apt, you need to provide at least a Packages files in /locate/repo/x86_64/dists. This file lists all the Packages (for a given suite), and includes all the meta-data (description, dependencies,...)

How exactly you do this, depends on your setup, as there are numerous options to manage an apt-repository.

One simple option would be to use apt-ftparchive (can be found in the apt-utils package):

$ 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

Finally, you need to add the repository to your 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
#

After that, you can simply run apt-get update and your packages can be installed via apt.

removing .deb files from the repository

to remove files from the repository, just delete them:

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

after that, you need to (re-)generate the Packages files

Upvotes: 1

Related Questions