I use aptly to deliver my unofficial debian packages both to myself and others that might be interested.
However I’ve found that using aptly to do package development is a bad idea, because you can’t (by design, probably) overwrite packages in an aptly archive. You can only create new versions.
For some installation tests it’s OK to use “dpkg –install”. But if your package needs to pull in depdencies, or if you wish to test a package upgrade, you need to use APT.
This article explains how to create a fake debian repository for use in package development.
Initial setup
Initial setup:
- Create the repository directory (this should be done as the same user you use to build the package)
mkdir -p /tmp/repo
- Open /etc/apt/sources.list in a text editor and add the following (you need to be root to do this)
# Test install apt archive deb [trusted=yes] file:///tmp repo/
Add new package to the repo
This the development cycle:
- Build the package (the example builds karaf)
cd ~/git/karaf-debian/ dpkg-buildpackage
- Copy the package to the fake repo (this example uses karaf, replace with your own package and package version):
cp ~/git/karaf_4.1.5-0~9.30_all.deb /tmp/repo
- Generate a Packages file
(cd /tmp; dpkg-scanpackages repo >repo/Packages)
Upgrading an existing package
This has to be done as root:
- First update APTs database of packages and archives
apt-get update
- Run an upgrade with the following command
apt-get dist-upgrade
- There will will be a question for if you wish to continue, to continue is the default, just press ENTER
Do you want to continue? [Y/n]
- There will be a warning about that the package to be installed cannot be authenticated, the default here is not to install, so press “y” (without the quotes) to continue
Install these packages without verification? [y/N]
Installing a package
This is used to e.g. test that a package is able to install its dependencies.
These operations have to be done as root:
- First update APT’s database of packages and archives
apt-get update
- Use the following command to install a package and its dependencies, this example installs apache karaf:
apt-get install karaf
- If the package pulls in new dependencies there will be a prompt for if you wish to continue. The default is to continue, so just press ENTER
Do you want to continue? [Y/n]
- There will be a warning about that the package to be installed cannot be authenticated, the default here is not to install, so press “y” (without the quotes) to continue
Install these packages without verification? [y/N]
Edited the line added to /etc/apt/sources.list to add “[trusted=yes]”.
Without this setting “apt updated” refuses to use the repository.