my question is very simple, but I think it will create a wide range of answers, suggestions and so on ;)
How can I create packages for linux system like Ubuntu or Debian and publish them via a root server?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communitymy question is very simple, but I think it will create a wide range of answers, suggestions and so on ;)
How can I create packages for linux system like Ubuntu or Debian and publish them via a root server?
The Debian packaging system is one of the most elegant methods of installing, upgrading, and removing software available in a public repository.
If you need to build and maintain an unofficial Debian package repository, you may consider some tips. Here I will describe briefly some steps to get your public Debian repository.
Firstly, install some necessary packages :
sudo apt-get install build-essential devscripts debhelper dh-make diff patch gnupg fakeroot lintian linda pbuilder
and may be cdbs if you intend to use it in your rules file :
sudo apt-get install cdbs
Create a working directory, and move in the source of your package that you intend to build
mkdir packages
cp mypackage-0.1.tar.gz packages
cd packages
Set the maintainer email and full name, this information will be used in the package meta data information.
export DEBEMAIL="user@address"
export DEBFULLNAME ="full name"
After run dh_make, a few questions will pop up which should be answered accordingly, this tool will extract some templates into packages/debian directory. for more information about that run dh_mahe -h
dh_make
There are many files needed to create .deb package that are stored in the project’s root directory packages/debian. for setting changes necessary to these files you have to
know some informatins about your package: dependencies, copyright, changelog, makefile ...
please refer to this tuto
The next step to build the binaries package which is built calling the following commands in the ./debian directory:
cd debian
debuild -rfakeroot
This will do everything for you. It will:
Let's say that our repository will contain only two sub directories: binary and source
dpkg-scanpackages scans the .deb packages; dpkg-scansources scans the .dsc files.
It is thus necessary to put the .orig.gz, .diff.gz and .dsc files together. The .changes files are not needed.
create repository directory in your www like this:
sudo mkdir -p /var/www/repository/{binary,source}
Move your deb and source package into /var/www/repository/{binary,source} and generate the index.
$ cp mypackage-0.1-1.deb /var/www/repository/binary/
$ cp mypackage-0.1-1.tar.gz /var/www/repository/source/
$ cd /var/www/repository
$ dpkg-scanpackages binary /dev/null | gzip -9c > /var/www/repository/binary/Packages.gz
$ dpkg-scansources source /dev/null | gzip -9c > /var/www/repository/source/Sources.gz
Lastly, add this your your source.lst to be able to get your package from the repository.
deb http://yourwebserver/repository binary/
deb-src http://yourwebserver/repository source/
I hope that can help, for more information please refer to the complete documentation:
You can create packages using the documentation at
When your packages are ready you can use dpkg-scanpackage to create the package files apt needs to list your software.
Alternatively you could use apt-ftparchive that needs a little bit more configration but can be used for bigger repositories with different architectures etc. You can find a nice guide on apt-ftparchive
Maybe you should also have a look at ubuntu's ppas. This is an automatic build service and repository for ubuntu and debian.
The checkinstall tool will automatically create .deb / .rpm and slackware packages by watching what an installation script or makefile does to install something. For less complex packages (those without a lot of pre/post install scripting) it does a reasonably good job.
I would not, however blindly post a package made with checkinstall to the public at large. I use it only for bundling stuff that we install on our local office network.
Still, its worth checking out. A lot of work has gone into it over the last year to make it build even complex packages correctly and without lint.
I like it because its very easy to drop into any build system and populate trivial repositories.
If you are using ubuntu mainly, you should read this :
https://help.launchpad.net/Packaging
I suggest you use launchpad for hosting your packages, unless the packages are private for you company. You should also read Ubuntu's Basic packaging guide, for detailed instructions on how to build packages from sources.