How to set up an APT repository?


I would like to set up an APT repository on a server that will provide a couple of packages.

I'm not sure where or what, but something's misconfigured. I only currently have one package and it's for all architectures.

Yes. You can do this. You just need to organize the files in the right way and create the index files. If you put the directory structure inside the document root of your web server the packages can just be accessed via the web server.

Here is a detailed description how the files need to be organized and how the index files are created.

You can also use a tool called reprepro if you are willing to install that one package. This will make the administration a little more convenient.

July 31, 2010 00:44 AM

Setting up a trivial repository is very easy using dpkg-scanpackages. This page explains how to set up a trivial repo, and this one explains how to use it (scroll down to example 4).


0 0

I would like to be able to run automatic apt-get upgrade (once per hour) on our servers (Ubuntu 10.04), so that I don't have to do it manually on all of them (about 15). However, for production machines, that's not a good idea ...

So here's my idea:

Set up a local repository for all 'approved' updates for critical packages. I would then push updated packages from upstream to our local repo after I tested them, and all servers could automatically (apt-cron?) upgrade from this repository.

So my question is this: How do I configure apt on the clients so that they use the local repository only for all packages which exist on the local repository, and the upstream one for all other packages?

Does this actually make sense? Or am I missing something?

Anyways, thanks for your...

0 0

When running multiple machine with the same distribution, it is interesting to set up a repository cache on your network so that once a package is downloaded from an official repository, all other machines will download it from your local area network.

Having different machines running the same linux distribution, it becomes interesting to set up a repository cache somewhere on your network. This way, you won’t download common packages more than 1 time from official repositories.

Here is the situation, we have one machine called repository-cache, this machine is going to act as the repository cache, basically, any other machines in your network is going to use it as a repository.

1. Getting started

As usual, you need to install the required packages in the first place. So type in a terminal:

$sudo apt-get install apt-cacher

Once this is done, it is time to get into the configuration files in /etc/apt-cacher/apt-cacher.conf

2. Configuring...

0 0

Here's how to create an apt-package

It's really quite straightforward ... within your app folder there's a debian subfolder ... the ./debian/install file contains a really straightforward map of files to final locations

# debian/install must contain the list of scripts to install # as well as the target directory echo usr/bin > debian/install

You can use the makefile to create installation and post installation tasks. If you've never compiled a c/c++ program with make before ... basically in the app folder you run "./configure" and then "make" or "make install" to compile / unpackage the program ... dh_make has a slightly different process and some defaults but it's a pretty similar workflow ... The following is a really simple makefile from the GNU Make Reference

objects = main.o kbd.o command.o display.o \ insert.o search.o files.o utils.o edit : $(objects) ...
0 0

I would like to set up an APT repository on a server that will provide a couple of packages.

Is there a way to set one up without installing any software on the server?

How do the files have to be organized?

Edit: I must be doing something wrong... can someone please help me? I have the repository at

I'm not sure where or what, but something's misconfigured. I only currently have one package and it's for all architectures.

Here's what's been added to my /etc/apt/sources.list:

deb stable main

Setting up a trivial repository is very easy using dpkg-scanpackages. This page explains how to set up a trivial repo, and this one explains how to use it (scroll down to example 4).

Just set up a simple but signed repository on a webserver. Because most other tutorials are somewhat dated or cumbersome, I'll try to replicate the procedure here. The initial configuration...

0 0

For a recent project I needed to deploy a custom build of PHP 5.2 to multiple Lucid servers. It had to be deployed in such a way as to make it easy to update all the servers with newer versions of the build in future. We decided to set up a Ubuntu repository containing the installation packages which we would access through the apt utilities. This post outlines the steps needed to get something like this working.

First of all, I’m assuming that you’ve got a web server (Apache, nginx, etc.) set to serve documents from the /var/www folder. Install the necessary pre-requisites:

$ sudo apt-get install dpkg-dev

Now setup the repository folders and files. The repository itself will be at /var/www/repo and the package files (.deb) will be at /var/www/repo/binary.

$ cd /var/www /var/www$ sudo mkdir repo /var/www$ cd repo /var/www/repo$ sudo mkdir binary /var/www/repo$ cp /*.deb binary ``` Now lets generate an index. This will create a file at `binary/Packages.gz`: ```bash...
0 0

Posted by Steve on Sat 5 Nov 2005 at 16:04

We've previously covered setting up your own repository for the Debian's apt-get system, but we didn't cover managing automatic uploads. Thankfully this is a simple task with the reprepro, and dupload tools and a small amount of scripting.

The reprepro package is tool for creating an APT repository with a pool structure, the same type of structure the official Debian mirrors use.

The repository may:

Contain packages for multiple distributions: Stable, Unstable, Testing, etc. Contain packages for multiple architectures: Be managed quickly and easily. Creating Your Repository

Installing the package is straightforward if you're using unstable, or etch, simply install it as you would install any other package:

apt-get install reprepro

Unfortunately the package contained within Debian's stable release, sarge, is a little outdated. For that reason I'd recommend that you install a back ported version....

0 0

UPDATE: This post has been updated to include a section on accessing downloaded packages through a local intranet.Some obsolete info has also been deleted. The techniques detailed here have been tested on all versions of Ubuntu and will probably work on other debian-based linux distributions.

I was going through my /var/cache/apt/archives folder the other day and I thought to myself, “So will I have to re-download all these packages if I do a clean install? Internet access is not cheap here in Ghana and the speed is nothing to write home about… I’m talking about you, Vodafone!! It’d be cool to build my own APT repository with the 3000+ packages in my local cache.” The only snag was I didn’t know how to do it. So I went hunting on google and it turned out a lot has been published on this topic. I found it all rather confusing, mostly geeks talking to other geeks in geekish, so I decided to write my own how-to for my much simpler mind.

If your roaring to go and know...

0 0

Docker CE Apt Repository Setup on Debian 64bit

Hello Debian User! This Tip Shows You Step-by-Step How-to Setup the Apt Repository for Docker Comunity Edition Installation on Linux Debian and derived like Kali GNU/Linux.

Docker is a Command-line Program, a background Daemon, and a set of Remote Services that take a logistical approach to solving common software problems and simplifying your experience installing, running, publishing, and removing software.

Getting-Started with Docker on Debian is Easy, it’s enough to Install it and then Use the Docker Engine to Create and Manage Containers.

Open a Shell Terminal emulator window
(Press “Enter” to Execute Commands)

Install Required Packages

sudo apt-get install apt-transport-https curl

Add the Docker CE Repository
For Debian 7/8/9:

sudo add-apt-repository \ "deb [arch=amd64] \ $(lsb_release -cs) stable"

For Kali at this Time...

0 0

If you often create guest VMs or containers on your Linux computer, you will go through package installation many times across different VMs/containers. In that case, your time may be better spent on something more productive than just waiting to finish installing packages. While server provisioning tools like Puppet, Chef or Ansible can automate the whole machine provisioning process, they are an overkill for virtualization on a single laptop or desktop computer. Also parallel downloads have a limited effect when the network is slow.

A more practical approach to saving time on installing packages on disposable VMs/containers on your computer is to set up a local Apt/Yum repository mirror, so that packages can be pulled locally instead of over the Internet. However, mirroring an entire repository takes a toll on disk space and bandwidth, and is not worth the effort as the number of packages required is typically not very large.

An alternative to repository mirroring...

0 0

Following up on our previous post about yum repository internals, this blog post will dive into the internals of APT repositories. Similarly, we’ll cover what each index file does and take a look at how a user can inspect and verify the metadata themselves.

An APT repository is a collection of deb packages with metadata that is readable by the apt-* family of tools, namely, apt-get. Having an APT repository allows you to perform package install, removal, upgrade, and other operations on individual packages or groups of packages.

APT repositories are essential for storing, managing, and delivering software to Debian and Ubuntu systems.

Generate GPG key for signing an APT repository

(Feel free to skip this section if you already have a GPG key you wish to use)

We’ll start by creating a GPG key to sign our repository metadata for a fuller, more illustrative example:

Since this is a throwaway blog example, we’ll just pick all the defaults...

0 0

When today traffic and casual internet speeds is measured in teens of Giga over an eye blink even for ordinary Internet clients, what’s the purpose of setting a local repository cache on LAN’s you may ask?

Setup Local Repositories in Ubuntu

One of the reasons is to reduce Internet bandwidth and high speed on pulling packages from local cache. But, also, another major reason should be privacy. Let’s imagine that clients from your organization are Internet restricted, but their Linux boxes need to regular system updates on software and security or just need new software packages. To go further picture, a server that runs on a private network, contains and serves secret sensitive information only for a restricted network segment, and should never be exposed to public Internet.

This are just a few reasons why you should build a local repository mirror on your LAN, delegate an edge server for this job and configure internal clients to pull out software form its...

0 0

Why a local package repository

If you are packaging software for Debian Linux or (K)Ubuntu sometimes you need not only one package, but you have to provide a dependency like a library or whatever. When those dependencies are not in the official repositories, the only way to fulfill those dependencies is to put your package inside the repository.

But what, if you don't have the permission to upload to main/universe/multiverse? So, inject your packages to your pbuilder enviroment via a local apt-get repository.

In this document I will describe how to setup a local apt-get repository, how to upload it to your root server via rsync and how to change your pbuilders sources.list.

You might wish to also check out LocalAptGetRepositoriesTrivial for a slightly easier way to make a local repository.


You need to install the following packages:

pbuilder dput mini-dinstall rsync


The installation of...

0 0

From time to time I build and backport deb packages. Most of them are for my personal use, but sharing them would be nice. Another advantage for setting up a personal repository over directly installing deb files is that you can install dependencies from that repository automatically. Especially useful if one source package builds multiple binary packages which depend on one another.

There is a list of programs ways how to setup such personal repository in the Debian wiki. However, I found most ways to be too cumbersome for my limited requirements. The way I’m describing below is probably the simplest and easiest way to get up and running.

First thing is installing dpkg-dev which provides dpkg-scanpackages.

sudo apt install dpkg-dev

Next put the deb files you created in some local repository such as /usr/local/debian and cd into it.

# dpkg-scanpackages -m . | gzip -c > Packages.gz

will scan all the *.deb files in the directory and create an appropriate...

0 0

If you create deb packages and would like to distribute them in a more centralized way instead of asking your users to download them and install them manually, then setting up an apt repository is the way to go.

The following walk-through sets up signed Ubuntu repository.

1. Install GnuPG and generate a GPG key.

In order to create a secure APT repository you might want to sign your debian packages. You'll need a GPG key in order to do that.

The “builder” name mentioned is a debian convention, indicating that the builder of the package signed it. The GPG key used will be the one you set up above, providing you’re running the command as the same user you set up the key with.

For more information on how to create a deb package read this article.

2. Install and Configure reprepro.

3. Create the file system layout for the repository.

If you would like to support multiple platforms besides Ubuntu, then you need to create similar...

0 0

Just set up a simple but signed repository on a webserver. Because most other tutorials are somewhat dated or cumbersome, I'll try to replicate the procedure here. The initial configuration takes a bit of effort, but the simple build script keeps it easy to manage. And you can just drop in new *.deb files, then update, or let a cron job handle that.

Generate some signing keys

First you need to create a gpg signing key for packages and your repository. Make it a (4) RSA signing key, no password, and give it a unique $KEYNAME when asked for. (Further examples assume "dpkg1" as keyname.)

gpg --gen-key gpg -a --export-secret-key dpkg1 > secret.gpg gpg -a --export dpkg1 > public.gpg

I said no password, because your webserver has no builtin monkey to type it in repeatedly. And the signed packages and repository are only meant to satisfy the update-managers complaints about that. Just upload both keys to the new /apt/ repository directory on your webserver, but...

0 0

There are 4 steps to setting up a simple repository for yourself

1.Install dpkg-dev
2.Put the packages in a directory
3.Create a script that will scan the packages and create a file apt-get update can read
4. Add a line to your sources.list pointing at your repository

Install dpkg-dev

Type in a terminal

sudo apt-get install dpkg-dev

The Directory

Create a directory where you will keep your packages. For this example, we'll use /usr/local/mydebs.

sudo mkdir -p /usr/local/mydebs

Now move your packages into the directory you've just created.

Previously downloaded Packages are generally stored on your system in the /var/cache/apt/archives directory. If you have installed apt-cacher you will have additional packages stored in its /packages directory.

The Script update-mydebs

It's a simple three liner:

#! /bin/bash cd /usr/local/mydebs dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz ...
0 0

Setting Up An APT Repository With reprepro And nginx On Debian Wheezy

This tutorial explains how to set up an apt repository with the tool reprepro and a Debian Wheezy system. The repository will be served by an nginx server.

1 Preliminary Note

In this tutorial I want to set up a small apt repository for the nginx packages that I built in the tutorial Using ngx_pagespeed With nginx On Debian Jessie/testing. Therefore my repository will be fpr Debian testing, not stable, so you have to adjust this tutorial where appropriate.

2 Generating A Key For Signing Packages

We will have to create a key for signing packages. This key can be generated with gnupg which we install as follows:

apt-get install gnupg

On servers, when generating a key, you might see this common error:

Not enough random bytes available. Please do some other work to give
the OS a chance to collect more entropy! (Need 284 more bytes)

To avoid...

0 0

Why Local repository is important?

As a System administrator, you have to install software, security updates and fixes often in all systems. Obviously, it will consume more Internet bandwidth. So instead of downloading and installing applications every time in all systems from the Ubuntu repositories, it is good idea to save all applications in a local server in your LAN and distribute them to the other Ubuntu systems when required. Having a local repository is really fast and efficient way, because all required applications will be transferred over the fast LAN connection from your local server. So that it will save the Internet bandwidth and ultimately it reduces the annual cost of Internet.

In this tutorial, I will show you how to setup local repository in Ubuntu 15.04 server in two methods.

APT-Mirror ; APT-Cacher.

Both methods are very easy to set up and configure.

All you need is sufficient hard drive space. At least 50GB or more free space in...

0 0

Have you ever wanted to save bandwidth when updating your Ubuntu computers? It’s very possible by creating a local APT repository server for your local LAN using Apache and some standard tools. This method allows for the ability to host any Debian package file you desire locally to make it easier to distribute.

There are multiple reasons to have a local repository. The main reason would be to capture large updates downstream and re-distribute them via a local repository to save on Internet usage. Other reasons someone might want to do this would be to more easily distribute software that isn’t found on the default Ubuntu servers.

So, how do you get it installed? Let’s find out!

For the local repository to work, an Apache server will need to be set up on the host system. Open up a terminal and enter the following command:

sudo apt-get install apache2

This will set up a website on Ubuntu and the folder structure that it needs to function. It can be tested...

0 0

Installing, updating, and removing (when needed) installed programs are key responsibilities in a system administrator’s daily life. When a machine is connected to the Internet, these tasks can be easily performed using a package management system such as aptitude (or apt-get), yum, or zypper, depending on your chosen distribution, as explained in Part 9 – Linux Package Management of the LFCE (Linux Foundation Certified Engineer) series. You can also download standalone .deb or .rpm files and install them with dpkg or rpm, respectively.

Linux Foundation Certified Engineer – Part 11

Introducing The Linux Foundation Certification Program

However, when a machine does not have access to the world wide web, another methods are necessary. Why would anyone want to do that? The reasons range from saving Internet bandwidth (thus avoiding several concurrent connections to the outside) to securing packages compiled from source locally, and including the possibility of providing...

0 0

Today we will show you how to setup a local repository in your Ubuntu PC or Ubuntu Server straight from the official Ubuntu repository. There are a lot benefit of creating a local repository in your computer if you have a lot of computers to install software, security updates and fixes often in all systems, then having a local Ubuntu repository is an efficient way. Because all required packages are downloaded over the fast LAN connection from your local server, so that it will save your Internet bandwidth and reduces the annual cost of Internet..

You can setup a local repository of Ubuntu in your local PC or server using many tools, but we'll featuring about APT-Mirror in this tutorial. Here, we'll be mirroring packages from the default mirror to our Local Server or PC and we'll need at least 120 GB or more free space in your local or external hard drive. It can be configured through a HTTP or FTP server to share its software packages with local system clients.


0 0
0 0

Apartment Guide is the most trusted rental resource that connects apartment consumers to their ideal place to live. With an unmatched search capability, amplified by constantly refined tools and industry insights, Apartment Guide provides consumers with a clear and simple guide to apartment living through content-rich apartment listings in a user-friendly format with Internet, mobile and social media solutions.

Leading the industry with first-to-market mobile introductions of iPad™, iPhone® and Android™ applications, as well as Reputation Monitor and Social Media Manager, Apartment Guide’s multi-platform search capability allows renters and property managers to connect wherever they are, whenever they want, in the medium that works best for them. The brand’s commitment to maximizing owner and manager value makes Apartment Guide a leading multi-family housing industry partner.

Apartment Guide is a division of RentPath, LLC, with headquarters in Atlanta, Georgia. For...

0 0