Subscribe to News

Creating a Local Automatic Debian-Ubuntu Repository

Author : Vicente

From TechnologicalWiki

Jump to: navigation, search

There are two types of Debian repositories,

  • trivial
  • automatic


Trivial repositories are simpler and user has to specify exact path in its sources.list file. They only support one architecture.

Automatic ones are more complex to setup but simpler to use. They can be organized for several architectures, and with a pool directory. In sources.list file user has to specify the base path, distribution, and components.


To make easy creating an automatic repository we are going to use reprepro tool.

$sudo aptitude install reprepro


We begin the process creating our depository directory where the web server can handle it.

$sudo mkdir /var/www/repository

$cd /var/www/repository


We create a directory to store the configuration file:

$sudo mkdir conf


With a text editor we create conf/distributions file.

You can use this as a Template:

Origin: Your Name
Label: Your own label
Suite: stable
Codename: sarge
Version: 3.1
Architectures: i386 all source
Components: main non-free contrib
Description: Your description


e.g:

Origin: It is me
Label: Test
Suite: betavine
Codename: betavine
Version: 0.1
Architectures: i386 lpia all
Components: main
Description: VMC

So we are creating a repository for betavine distribution with component main, and it supports i386 and lpia architectures.


Adding some deb packages

We previously have downloaded three files to /tmp/foo directory and now we are going to add them to our repository:

$cd /var/www/repository

$sudo reprepro -Vb . includedeb betavine /tmp/foo/usb-modeswitch_0.9.4-1_i386.deb

$sudo reprepro -Vb . includedeb betavine /tmp/foo/usb-modeswitch_0.9.4-1_lpia.deb

$sudo reprepro -Vb . includedeb betavine /tmp/foo/vodafone-mobile-connect_1.99.17-8_all.deb


We update sources.list file

#echo "deb http://localhost/repository/ betavine main" >> /etc/apt/sources.list

$sudo aptitude update


And then we can install the new packages from our repository:

$sudo aptitude install vodafone-mobile-connect


NOTE: We will receive a warning about untrusted packages. We answer yes and continue installing them.

If we do not want to be annoyed with this question we must execute:


$sudo apt-get --allow-unauthenticated install vodafone-mobile-connect


If we made a mistake and want to remove a package from our repository the command to run is:

$sudo reprepro -Vb . remove betavine vodafone-mobile-connect


NOTE: Newer package versions are automatically handled when new packages are installed.

[edit] Reference

http://www.debian-administration.org/articles/286

[edit] More Info

http://www.debian.org/doc/manuals/repository-howto/repository-howto.en.html

http://people.connexer.com/~roberto/howtos/debrepository

Main Collaborators