The following article shows the uploading of own Ubuntu packages in a reprepro repository. The packages are transferred by dupload via scp to a folder on the repository server where they are processed by reprepro via an inoticoming job. In the examples shown, the client is an Ubuntu 12.10, on the server is an Ubuntuwith kernel 3.2.0-38 generic.

How to create a reprepro repository is described in Creating apt a repository with reprepro under Ubuntu .


At the repository server

inoticomingtriggered actions when files arrive in a folder.

: ~ $ sudo apt-get install inoticoming

At the client

duploadloads the Ubuntu packages into the folder on the repository server that is being monitored by inoticoming.

: ~ $ sudo apt-get install dupload


At the server

The configuration file incomingdetermines the rules and folders when uploading new packages to the reprepro repository. The configuration file incomingis in the /conffolder of the used reprepro repos.

: ~ $ vi packages / conf / incoming
Name: incoming
IncomingDir: / home / repository / incoming
Allow: precise
Cleanup: on_deny on_error
Tempdir: / home / repository / incoming_tmp
LogDir: / home / repository / incoming_log

About inoticomingwhich is incomingusually called by reprepro:

: ~ $ inoticoming --logfile /home/repository/incoming_log/upload.log/home/repository/incoming/ \
> --stderr-to-log --stdout-to-log --suffix '.changes' \
> reprepro --waitforlock 100 processincoming incoming {} \;

It is thereby made sure that runs inoticomingunder that user, under which the repo is managed and uploads the packages. Then it is ensured that the files and folders may be created and have the correct rights.

: ~ $ ps -u repository
 3098? 00:00:00 inoticoming

At the client

In the first step, we transfer an ssh key to the server for authentication:

: $ ssh-copy-id -i .ssh / repository@

The dupload configuration specifies how the packages are loaded into the repo:

: ~ $ vi .dupload.conf
package config;
$ default_host = "tkpack";
$ cfg {'tkpack'} = {
        fqdn => "",
        method => "scp",
        login => "repository",
        incoming => "/ home / repository / incoming /",
        # files pass on to send which sends emails itself
        dinstall_runs => 1,

Upload packages to the repository

Then a package can be loaded into the repo dupload from the client (here without sending out notification emails):

: ~ $ dupload -f --nomail -t tkpack tkmon_0.0.1-1_amd64.changes
dupload warning: mail options disabled, can not run `/ usr / sbin / sendmail ': No such file or directory
dupload note: no announcement will be sent.
Uploading (scp) to
[job tkmon_0.0.1-1_amd64 from tkmon_0.0.1-1_amd64.changes
 tkmon_0.0.1-1.dsc, size ok, md5sum ok, sha1sum ok, sha256sum ok
 tkmon_0.0.1-1.debian.tar.gz, size ok, md5sum ok, sha1sum ok, sha256sum ok
 tkmon_0.0.1.orig.tar.gz, size ok, md5sum ok, sha1sum ok, sha256sum ok
 tkmon_0.0.1-1_all.deb, size ok, md5sum ok, sha1sum ok, sha256sum ok
 tkmon_0.0.1-1_amd64.changes ok]
Uploading (scp) to tkpack (
[Uploading job tkmon_0.0.1-1_amd64
 tkmon_0.0.1-1.dsc 0.8 kB, ok (0 s, 0.81 kB / s)
 tkmon_0.0.1-1.enbian.tar.gz 6.1 kB, ok (0 s, 6.07 kB / s)
 tkmon_0.0.1.orig.tar.gz 720.0 kB, ok (1 s, 720.00 kB / s)
 tkmon_0.0.1-1_all.deb 701.7 kB, ok (1 s, 701.66 kB / s)
 tkmon_0.0.1-1_amd64.changes 1.4 kB, ok (0 s, 1.43 kB / s)]

On the server , inoticomingthe package plays with reprepro in the repository:

: ~ / incoming_log $ cat upload.log 
Will call action reprepro for: tkmon_0.0.1-1_amd64.changes
Exporting indices ...
: ~ / incoming_log $ reprepro list precise 
precise | main | i386: tkmon 0.0.1-1
precise | main | amd64: tkmon 0.0.1-1
precise | main | source: tkmon 0.0.1-1

Fault diagnosis

The following error occurs with the actual upload method recommended in the dupload man-page scpb:

chmod: can not access `tkmon_0.0.1-1.dsc ': No such file or directory
chmod: can not access `tkmon_0.0.1-1.enbian.tar.gz ': No such file or directory
chmod: can not access `tkmon_0.0.1.orig.tar.gz ': No such file or directory
chmod: can not access `tkmon_0.0.1-1_all.deb ': No such file or directory
chmod: can not access `tkmon_0.0.1-1_amd64.changes': No such file or directory
dupload fatal error: ssh -x -l repository 'cd / home / repository / incoming /; chmod 0644 tkmon_0.0.1-1.dsc tkmon_0.0.1-1.enbian.tar.gz tkmon_0.0.1.orig.tar .gz tkmon_0.0.1-1_all.deb tkmon_0.0.1-1_amd64.changes; ' failed
 at / usr / bin / dupload line 662

This error occurs due to too fast processing of the highly loaded packets inoticoming. The packages have already been reprepromoved to the repository, so they duploadcan not do anything chmodanymore.


With preupload-hook you can also set the right permissions before uploading. This also works with a high load scpb.

$ preupload {'file'} = 'chmod 644% 1',
$ preupload {'deb'} = 'chmod 644% 1',
$ cfg {'tkpack'} = {
        fqdn => "",
        method => "scpb",
        login => "repository",
Categories: Tutorials

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: