Skip to content

Instantly share code, notes, and snippets.

@awesomebytes
Last active May 7, 2024 11:50
Show Gist options
  • Star 27 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save awesomebytes/ce0643c1ddead589ab06e2a1e4c5861b to your computer and use it in GitHub Desktop.
Save awesomebytes/ce0643c1ddead589ab06e2a1e4c5861b to your computer and use it in GitHub Desktop.
How to create a simple debian repository with minimal dependences

Simple debian repository

How to have a simple debian repository to offer your packages.

Requirements

You probably have them already installed

  • Python (I used 2.7).
  • dpkg-scanpackages: sudo apt-get install dpkg-dev
  • gzip: sudo apt-get install gzip

Create your debian hosting folder structure

mkdir simple_debian_repo
cd simple_debian_repo
mkdir debian

Add your .deb files to the debian folder

cp my_awesome_thing.deb simple_debian_repo/debian

Create Packages.gz file

You'll need to do this every time you add/update a .deb.

dpkg-scanpackages debian /dev/null | gzip -9c > debian/Packages.gz

You'll get an output similar to:

dpkg-scanpackages: warning: Packages in archive but missing from override file:
dpkg-scanpackages: warning:   my_awesome_thing.deb
dpkg-scanpackages: info: Wrote 1 entries to output Packages file.

Run a webserver to host it

Any will do, for simplicity I used Python one.

python -m SimpleHTTPServer 8000

Configure any machine to point to your new debian repository

For testing in your own machine (for other machines just use your IP address).

echo "deb [trusted=yes] http://127.0.0.1:8000 debian/" > /etc/apt/sources.list

Note that the packages will be non authenticated, so if you want to stop having warnings you'll need to add the [trusted=yes]

Tips

How to generate a Debian from a ROS Package

Follow instructions in this gist.

How to generate a Debian from a Python script

Nice instructions in this stack overflow answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment