Membuat Repository Debian dengan Reprepro



Ilustrasi package debian
Debian Packages


Membangunan Lumbung Paket dengan reprepro, ini bisa untuk debian dan turunannya:

  • Membuat sebuah akun yang bernama arsip


Tambahkan akun baru:
$ sudo adduser arsip
$ su – arsip


  • Install aplikasi-aplikasi pendukung

 $ sudo apt-get install reprepro nginx haveged


  • Mengenerate Kunci GnuPG untuk paket yang akan ditandatangani.

 arsip@repo:~$ gpg --gen-key
Catatan: Ikuti perintah sampai selesai dan hasil dari perintah diatas adalah berkas-berkas yang berada pada ~/.gnupg/
arsip@repo:~$ gpg --gen-key
gpg (GnuPG) 1.4.20; Copyright (C) 2015 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)
Requested keysize is 2048 bits
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y

You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
    "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"

Real name: Belajar Repo
Email address: belajar@emhaye.ga
Comment: Repository
You selected this USER-ID:
    "Belajar Repo (Repository) <belajar@emhaye.ga>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
You need a Passphrase to protect your secret key.

gpg: gpg-agent is not available in this session
You don't want a passphrase - this is probably a *bad* idea!
I will do it anyway.  You can change your passphrase at any time,
using this program with the option "--edit-key".

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
......................+++++
........+++++
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
+++++
..+++++
gpg: /home/bel/.gnupg/trustdb.gpg: trustdb created
gpg: key 1D8FF8E7 marked as ultimately trusted
public and secret key created and signed.

gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
pub   2048R/1D8FF8E7 2016-05-26
      Key fingerprint = 9C0E A1C1 41D4 8295 35FE  D0E1 116B 0A46 1D8F F8E7
uid                  Belajar Repo (Repository) <belajar@emhaye.ga>
sub   2048R/1F828DF8 2016-05-26


  • Konfigurasi Nginx

Buat berkas dan tautkan ke /etc/nginx/site-enabled/arsip
 $ sudo nano /etc/nginx/site-available/arsip
 Isi dengan :
server {
     listen 80;
     server_name $DOMAIN;
     access_log /var/log/nginx/arsip.access.log;
     location / {
          root /home/arsip/repo/;
          index index.html index.htm;
          autoindex on;
     }
}
Lakukan symlink konfigurasi nginx
 $ sudo ln -s /etc/nginx/site-available/arsip /etc/nginx/site-enabled/arsip
Restart Nginx
 $ sudo /etc/init.d/nginx restart

  • Konfigurasi Reprepro

Buat direktory untuk area kerja reprepro
 $ mkdir -p /home/arsip/reprepro/conf
 $ cd /home/arsip/reprepro/conf
Periksa gpg key yang sudah dibuat tadi
 $ gpg --list-keys
/home/bel/.gnupg/pubring.gpg
----------------------------
pub   2048R/1D8FF8E7 2016-05-26
uid                  Belajar Repo (Repository) <belajar@emhaye.ga>
sub   2048R/1F828DF8 2016-05-26


Export pgp/gpg
$ gpg --armor --output arsip-archive-keyring.gpg --export belajar@emhaye.ga
Keguanaan ini untuk didistribusikan ke client atau bisa juga dengan memaketkan dan masukkan ke dalam repo.

Buat berkas distribusi
 $ nano distributions
Isi seperti berikut dan disesuaikan dengan kebutuhan
Origin: Blankon
Label: Blankon
Codename: nusantara
Suite: nusantara
Components: main restricted extras extras-restricted
UDebComponents: main
Architectures: i386 amd64 source
Version: 1.0
Description: BlankOn 1.0 nusantara
# Jangan kasih "-" di kolom Update, nanti paket2 khas2 akan dihapus
Update: merge.nusantara
SignWith: yes
DebIndices: Packages Release . .gz .bz2 tiffany.py
UDebIndices: Packages . .gz .bz2
DscIndices: Sources Release . .gz .bz2 tiffany.py
Contents: udebs nodebs . .gz
ContentsArchitectures: i386 amd64
ContentsComponents: main restricted extras extras-restricted
ContentsUComponents: main
Log: nusantara.log
 --type=dsc changelogs
Buat berkas Options
$ nano options
Isi dengan
basedir /home/arsip/reprepro
confdir /home/arsip/reprepro/conf
dbdir /home/arsip/reprepro/db
outdir /home/arsip/repo/blankon/
gnupghome /home/arsip/.gnupg

Buat berkas Updates
$ nano updates
Isi dengan
Name: merge.nusantara
Suite: nusantara
VerifyRelease: blindtrust
Method: http://$DOMAIN/blankon
Architectures: i386 amd64 source
Components: main restricted extras extras-restricted
Untuk berkas tiffany.py bisa langsung diunduh dari repo github dotovr


  • Cara Penggunaan Repo


a. Update repo
Menjadi Pengguna arsip:
$ sudo su – arsip

Masuk ke reprepro
arsip@repo:$ cd /home/arsip/reprepro/
arsip@repo:$ reprepro -v -v -v update nusantara

b. Membuat berkas indez Packages.gz Source.gz
$ reprepro export nusantara

c. Memasukkab berkas .deb/.Udeb Sources dengan berkas .changes
$ reprepro -C COMPONENT -P PRIORITY -S SECTION include DIST /PATH/TO/PACKAGE.changes

d. Memasuukan paket .deb
$ reprepro -C COMPONENT -P PRIORITY -S SECTION includedeb DIST /PATH/TO/PACKAGE.deb

e. Memasukkan paket debian-installer (udeb)
$ reprepro -C COMPONENT -P PRIORITY -S SECTION includeudeb DIST /PATH/TO/PACKAGE.udeb

f. Memasukkan Kode Sumber
$ reprepro -C COMPONENT -P PRIORITY -S SECTION includedsc DIST /PATH/TO/PACKAGE.dsc

g. Menghapus Paket
$ reprepro remove DIST NAMA_PAKET

h. Membekukan Rilis
Tambahkan opsi ReadOnly dan hilangkan tiffany.py , pada distributions contoh:
Origin: Blankon
Label: Blankon
Codename: nusantara
Suite: nusantara
....
ReadOnly: Yes <-------------

Hasil Pekerjaan:
http://$DOMAIN/blankon/
bisa dipasang di /etc/apt/sources.lis
deb http://$DOMAIN/blankon nusantara main restricted extras extras-restricted
deb-src http://$DOMAIN/blankon nusantara main restricted extras extras-restricted

Keterangan:
deb: Binary Deb
deb-src: Source
http://$DOMAIN/blankon : Alamat Repo
nusantara: Dist/Nama Rilis
main: Repo Utama Bebas
restricted: Repo Utama Terbatas Lisensinya
extras: Repo Komunitas
extras-restricted: Repo Komunitas Terbatas Lisensinya
Dari client coba lakukan update dan pasang package
$ sudo apt-get update
$ sudo apt-get install nusantara-keyring

dan install aplikasi-aplikasi lainnya, baik dengan apt-get, aptitude, synaptic atau software
center, jika tidak ada galat/error maka repo sudah siap digunakan.
Next
This is the current newest page
Previous
Next Post »

2 comments

Click here for comments
April 30, 2017 at 10:21 PM ×

Gagal tidak bisa install
$ sudo apt-get install reprepro nginx haveged

repositori blankon tambora error

Reply
avatar
Unknown
admin
May 1, 2017 at 7:03 PM ×

Terkait repo blankon tambora silahkan baca milis ada informasi

Reply
avatar
Thanks for your comment