M01: Introducction to Operating Systems
TU3: Installing specific purpose software
ASIX1
Pract. Exerc. 2: Creating an APT repository server on Debian 6-05-14

PRACTICAL EXERCISE 2: CREATING AN APT REPOSITORY SERVER ON DEBIAN

GENERAL CONDITIONS

1- Deadline: 16-05-2014.
2- Create your own local respository. Your teacher will check if it is working properly.

1- DOCUMENTATION ABOUT CREATING AN APT REPOSITORY SERVER ON DEBIAN

In the first practical execise of the present training unit, you learned how to create .deb packages. Now, you will learn how to distribute them in a centralized way by setting up an apt repository in your system. This way, you can easily share your packages among users, who will be able to avoid  the tedious task of downloading and intalling them manually.

Setting up an apt repository server on debina this properly requires several steps: 1.1. Links about this topic
1-
Abotu GnuPG (GPG): https://www.digitalocean.com/community/articles/how-to-use-gpg-to-encrypt-and-sign-messages-on-an-ubuntu-12-04-vps
2- http://joseph.ruscio.org/blog/2010/08/19/setting-up-an-apt-repository/
3- https://wiki.debian.org/SettingUpSignedAptRepositoryWithReprepro (This is a very useful link!!!!!!!)
 

1.2. GnuPG
If you want to create a secure APT repository, you have to sign your debian packages and, therefore, you  you need a GPG key. GnuPG helps you to create eaily a GPG key.

1.3.- The reprepro utility

It creates the repository with the help of 4 configuration files called distributions, options, updates and pulls, which  have to be stored  in a subfolder called conf. Folder conf has  to  be created in the directory where you will store your software respository, which we have choosen to be /var/packages/ubuntu, but could be any other folder in your system provided Apache can gain acces to it.
Files updates and pulls can be omitted if not needed but creating distributions, options is compulsory. Addtionally on extra file called override.precise has to be created in order to provide your repository with the proper set of configuration files.

1.4.- Apache
Apache is the typical Linux web server. Your system needs a web server in order to share its repository software with your local network and Internet.  We will create a folder called /var/
packages/ubuntu where our software will be stored.
 
PART 1: SETTING UP AN APT REPOSITORY SERVER


!!!!!!!!!VERY IMORTANT:  In order to set up properly an apt repository server on Debian you should read carefully the third link in section 1.1.!!!!!!!!!!!

1-
Check if the following packages are installed in your system: gnupg, dpkg-sig, reprepro and apache2. If your system lacks some of these packages then install it.

2-
With the help of the third link in section 1.1, create an apt repository in your Debian system:
    a) Directory for the apt repository: /var/www/repos/apt/debianXX (where XX is a number that teachers will provide you)
    b) Configuring reprepro  with the the following features
       
Origin: Escola del Clot
       
Label: Escola del Clot
       
Codename or osrelease: wheezy
       
Architectures: i386 amd64
       
Components: main
       
Description: Escola del Clot APT Repository
       
SignWith: The ID of the GnuPG key you generated.
   
    basedir:  /var/www/repos/apt/debianXX

3
- Add
the loginteller package that you created in your first practical exercise to the apt-repository. Go to you  repository directory (i.e. /var/www/repos/apt/debianXX) and run the reprepro command, which will need the full path and file name of the package that you are adding yo the repository.

4-
Export and save your GnuPG key into /var/www/repos/apt/debianXX. Your GnuPG key should be called fjeclotXX.gpg.key.

5-
Create a file called debianXX.list. Save these two files in /var/www/repos/apt/debianXX. The contents of these two files will be:

deb   http://IP_address_of_your_repository_server/repos/apt/debianXX   wheezy   main 


PART 2: INSTALLATING A PACKAGE

1- Test your APT repository. From another debian machine (DebUb for instance),  log in as root user and add your repository to
/etc/apt/sources.list.d. Information about your repository is written in debianXX.list and debianXX.list.save.  Download with the wget command the  debianXX.list and debianXX.list.save  files into the /etc/apt/sources.list.d directory of your classmate machine (i.e. the client machine). From /etc/apt/sources.list.d, run the following command:

wget
  http://IP_address_of_your_repository_server/repos/apt/debianXX/ debianXX.list


2-
Import the repository’s public key to the client machine.
From /etc/apt/source.list.d, run the following command:

wget   -O   -   http://IP_address_of_your_repository_server/repos/apt/debianXX/fjeclotXX.gpg.key   |   apt-key add   -

3-
From your classmate machine: fetch the list of packages available at the new source. Run the following command:  apt-get update

4-
From your classmate machine: Install loginteller_0.1-1_i386.deb. Run the following commnad:  apt-get install  loginteller.
 
APPENDIX

ASIX-1 (INF-B) --> XX values
Sr. Alvárez
01
Sr. López Martos 10
Sr. Atencia
02
Sr. Pastor
11
Sr. Bertolín
03
Sr. Puigventós 12
Sr. Cano
04
Sr. Sánchez 13
Sr. El Afia
05
Sr. Soler
14
Sr. García Fernández
06
Sr. Vázquez
15
Sr. García Giménez
07
Sr. Yepes 16
Sr. García Salas
08
Sr. Zamorano 17
Sr. López Jiménez
09



      
DAW-1 (INF-A) --> XX values
Sr. Benavent
01
Sr. Nieto
10
Sr. Cuesta
02
Sr. Paniello
11
Sr. Díez
03
Sr. Pérez
12
Sr. Domínguez
04
Sr. Piñol
13
Sr. González
05
Sr. Postigo
14
Sra. López
06
Sr. Travé
15
Sr. Méndez
07
Sr. Valentí
16
Sr. Mentuy
08


Sr. Mulà
09