Repo Lokal Harddisk Debian GNU/Linux

Sejak pertama kali memakai Debian, aku telah menggunakan repository lokal dari DVD repo Debian. Karena memang di rumah tidak ada koneksi internet dan ternyata sangat mudah membuat repository lokal dengan DVD. Pertama download file iso repository Debian, lalu bakar ke DVD setelah itu tinggal gunakan perintah apt-cdrom add dan apt-get update. Nanti apt akan langsung memindai mana repository dari Debian. Jika ada lebih dari 1 DVD tinggal masukkan satu per satu. Setiap memasukkan DVD diikuti dengan perintah apt-cdrom add dan jika telah selesai semua diakhiri dengan perintah apt-get update.
Instalasi dengan cara demikian bagiku cukup mudah karena ketika memakai perintah apt-get install atau aptitude install secara otomatis apt akan meminta DVD ke berapa yang harus dimasukkan. Its so cool!

Karena sudah setahun dengan cara demikian lalu tiba-tiba aku kepikiran bagaimana sih caranya repo lokal via harddisk sehingga tidak harus gonta-ganti DVD. Dulu aku sempat punya file tutorialnya dari debianindonesia.org, tapi sayangnya sudah kehapus, lalu setelah googling lagi akhirnya nemu juga yang baru😀. Nah, begini caranya, memang sih jadul, tapi insya Allah ada gunanya.
Pertama download file iso-nya, yang aku pakai di sini, debian-6.0.0-i386-DVD-3.iso. Setelah itu aku letakkan di /mnt/temp. Nah dari sini nanti akan di mount-kan ke /mnt/iso3 dengan perintah
cd /mnt/temp
mount -o loop debian-6.0.0-i386-DVD-3.iso /mnt/iso3/
setelah itu edit /etc/apt/source.list dengan menambahkan baris berikut
deb file:/mnt/iso3 squeeze contrib main
simpan file tadi dan ikuti dengan perintah apt-get update
oke, sekarang kita coba menginstall rasmol (di Debian Squeeze,rasmol ada di DVD ke-3).
apt-get install rasmol mpqc viewmol ghemical
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
libcommons-collections3-java libhsqldb-java-gcj libstlport4.6ldbl libwpd8c2a
libcolamd2.7.1 lp-solve libgcj-bc ttf-sil-gentium xscreensaver-gl libgraphite3
libhyphen0 libwpg-0.1-1 bsh-gcj libcommons-compress-java libregexp-java gcj-jre
liblucene2-java gcj-4.4-jre-lib libgcj10 ttf-lyx libdb4.7-java-gcj
gcj-jre-headless libcommons-logging-java libmythes-1.2-0 uno-libs3 bsh
gcj-4.4-base libgcj-common ttf-sil-gentium-basic gcj-4.4-jre libjaxp1.3-java
libgle3 ttf-opensymbol libjline-java libtextcat-data-utf8 libwps-0.1-1
libcommons-beanutils-java gcj-4.4-jre-headless libdb-je-java ure
xscreensaver-gl-extra libdb4.7-java libcommons-digester-java libjtidy-java
libhsqldb-java libservlet2.5-java libicu4j-java libgcj10-awt xfonts-mathml
xscreensaver-data libneon27-gnutls
Use ‘apt-get autoremove’ to remove them.
The following extra packages will be installed:
lesstif2 libcbf0 libcvector2 libghemical-data libghemical5 libmopac7-1gf
liboglappth2 libopenbabel3 libsc-data libsc7 libvte-common libvte9 libxp6
Suggested packages:
mpqc-support rasmol-doc openbabel xfonts-cyrillic
The following NEW packages will be installed:
ghemical lesstif2 libcbf0 libcvector2 libghemical-data libghemical5
libmopac7-1gf liboglappth2 libopenbabel3 libsc-data libsc7 libvte-common
libvte9 libxp6 mpqc rasmol viewmol
0 upgraded, 17 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/14.8 MB of archives.
After this operation, 40.5 MB of additional disk space will be used.
Do you want to continue [Y/n]?
WARNING: The following packages cannot be authenticated!
libmopac7-1gf libsc-data libsc7 libghemical-data libghemical5 liboglappth2 mpqc
ghemical libcbf0 libcvector2 rasmol viewmol
Install these packages without verification [y/N]? y
Selecting previously deselected package libmopac7-1gf.
(Reading database … 93121 files and directories currently installed.)
Unpacking libmopac7-1gf (from …/libmopac7-1gf_1.15-4_i386.deb) …
Selecting previously deselected package libsc-data.
Unpacking libsc-data (from …/libsc-data_2.3.1-6_all.deb) …
Selecting previously deselected package libsc7.
Unpacking libsc7 (from …/m/mpqc/libsc7_2.3.1-6_i386.deb) …
Selecting previously deselected package libghemical-data.
Unpacking libghemical-data (from …/libghemical-data_2.99.1-1_all.deb) …
Selecting previously deselected package libghemical5.
Unpacking libghemical5 (from …/libghemical5_2.99.1-1_i386.deb) …
Selecting previously deselected package liboglappth2.
Unpacking liboglappth2 (from …/liboglappth2_0.98-2_i386.deb) …
Selecting previously deselected package libopenbabel3.
Unpacking libopenbabel3 (from …/libopenbabel3_2.2.3-1+b1_i386.deb) …
Selecting previously deselected package mpqc.
Unpacking mpqc (from …/m/mpqc/mpqc_2.3.1-6_i386.deb) …
Selecting previously deselected package ghemical.
Unpacking ghemical (from …/ghemical_2.99.2-1_i386.deb) …
Selecting previously deselected package libxp6.
Unpacking libxp6 (from …/libxp6_1.0.0.xsf1-2_i386.deb) …
Selecting previously deselected package lesstif2.
Unpacking lesstif2 (from …/lesstif2_0.95.2-1_i386.deb) …
Selecting previously deselected package libvte-common.
Unpacking libvte-common (from …/libvte-common_0.24.3-2_all.deb) …
Selecting previously deselected package libvte9.
Unpacking libvte9 (from …/vte/libvte9_0.24.3-2_i386.deb) …
Selecting previously deselected package libcbf0.
Unpacking libcbf0 (from …/libcbf0_0.7.9.1-3_i386.deb) …
Selecting previously deselected package libcvector2.
Unpacking libcvector2 (from …/libcvector2_1.0.3-1_i386.deb) …
Selecting previously deselected package rasmol.
Unpacking rasmol (from …/rasmol/rasmol_2.7.5-1_i386.deb) …
Selecting previously deselected package viewmol.
Unpacking viewmol (from …/viewmol_2.4.1-15+b1_i386.deb) …
Processing triggers for man-db …
Processing triggers for menu …
Setting up libmopac7-1gf (1.15-4) …
Setting up libsc-data (2.3.1-6) …
Setting up libsc7 (2.3.1-6) …
Setting up libghemical-data (2.99.1-1) …
Setting up libghemical5 (2.99.1-1) …
Setting up liboglappth2 (0.98-2) …
Setting up libopenbabel3 (2.2.3-1+b1) …
Setting up mpqc (2.3.1-6) …
Setting up ghemical (2.99.2-1) …
Setting up libxp6 (1:1.0.0.xsf1-2) …
Setting up lesstif2 (1:0.95.2-1) …
Setting up libvte-common (1:0.24.3-2) …
Setting up libvte9 (1:0.24.3-2) …
Setting up libcbf0 (0.7.9.1-3) …
Setting up libcvector2 (1.0.3-1) …
Setting up rasmol (2.7.5-1) …
update-alternatives: using /usr/bin/rasmol-gtk to provide /usr/bin/rasmol (rasmol) in auto mode.
Setting up viewmol (2.4.1-15+b1) …
Processing triggers for menu …
memang sih, masih ada warning karena tidak ada autentifikasi file-file yang akan diinstall hehe😀.
sayangya dengan cara yang demikian harus jika kita reboot harus mount ulang setiap ingin install program yang ternyata ada di iso3, oleh karena itu, aku mengedit /etc/fstab dengan menambahkan baris
/mnt/temp/debian-6.0.0-i386-DVD-3.iso /mnt/iso3 iso9660 loop  0 0
Sip! Sekarang tidak perlu lagi me-mount ulang setiap ingin install program baru😀.
jika ingin agar repo lokal kita dapat terautentifikasi adalah dengan membuat file Release dan digital signature bagi file Release tersebut. Kemudian memasukkannya ke dalam trusted APT
Pertama-tama buat dulu pasangan kunci gpg
$ gpg –gen-key
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? 4 → kita gunakan RSA karena lebih powerful daripada DSA
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 4096
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) 5
Key expires at Wed 05 Oct 2011 03:44:15 AM WIT
Is this correct? (y/N) y
Real name: debian dvd 4
Email address:
Comment:
You selected this USER-ID:
“debian dvd 4”
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
You need a Passphrase to protect your secret key.
Enter passphrase:
Repeat passphrase:
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: key C115B188 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:   3  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 3u
gpg: next trustdb check due at 2011-10-04
pub   4096R/xxxxxxxx 2011-09-29 [expires: 2011-10-04]
Key fingerprint = xxxx xxxx xxxx xxxx  xxxx  xxxx xxxx xxxx xxxx xxxx
uid                  debian dvd 4
Note that this key cannot be used for encryption.  You may want to use
the command “–edit-key” to generate a subkey for this purpose.
$ gpg –list-key
pub   4096R/xxxxxxxx 2011-09-29 [expires: 2011-10-04]
uid                  debian dvd 4
kemudian export kunci publik ini
$ gpg –output pubkey-export-file –armor –export xxxxxxx
nah, sekarang masukkan kunci ini ke APT
$ sudo apt-key add pubkey-export-file
[sudo] password for root:
Sorry, try again.
[sudo] password for root:
OK
$ sudo apt-key list
pub   4096R/xxxxxxxx 2011-09-29 [expires: 2011-10-04]
uid                  debian dvd 4
jika paket dpkg-dev belum terinstall, install dulu paket tersebut
$ sudo apt-get install dpkg-dev
kemudian buat folder untuk file-file repository lokal Debian
$ mkdir /mnt/script/debian
$ sudo dpkg-scanpackages . /dev/null > Packages
lalu buatlah file gzip dari Packages
$ gzip -9c Packages > Packages.gz
untuk file Release
$ cat > Release << EOF
> Origin: Debian
> Label: Debian
> Suite: stable
> Version: 6.0
> Codename: squeeze
> Date: Sat, 05 Feb 2011 12:29:37 UTC
> Architectures: i386
> Components: main contrib
> Description: Debian 6.0 Released 05 February 2011
> MD5Sum:
> EOF
$  printf ‘ ‘$(md5sum Packages |cut –delimiter=’ ‘ –fields=1)’ %16d Packages\n’ \ $(wc –bytes Packages |cut –delimiter=’ ‘ –fields=1) >> Release
$  printf ‘ ‘$(md5sum Packages.gz |cut –delimiter=’ ‘ –fields=1)’ %16d Packages.gz’ \ $(wc –bytes Packages.gz |cut –delimiter=’ ‘ –fields=1) >> Release
lalu buat digital signature untuk file Release
$  gpg –armor –detach-sign –output Release.gpg Release
Oke, langkah terakhir edit source.list APT dan update APT
$ sudo vim /etc/apt/sources.list
masukkan link repository lokal misalnya : deb file:///mnt/script/debian /
$ sudo apt-get update
sekarang kita coba menginstall gabedit dan mopac dari repository lokal ini
$ sudo apt-get install gabedit mopac7-bin
Suggested packages:
a2ps povray
The following NEW packages will be installed:
gabedit mopac7-bin
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/1,735 kB of archives.
After this operation, 4,915 kB of additional disk space will be used.
Selecting previously deselected package gabedit.
(Reading database … 168255 files and directories currently installed.)
Unpacking gabedit (from …/gabedit_2.2.12-1_i386.deb) …
Selecting previously deselected package mopac7-bin.
Unpacking mopac7-bin (from …/mopac7-bin_1.15-4_i386.deb) …

Akhirnya, repository lokal telah dapat terautentifikasi🙂
Semoga bermanfa’at!
# bagi yang ingin menambahkan silahkan saja, cuz I’m still beginner😀
# Debian di sini merupakan singkatan dari Debian GNU/Linux
# cara-cara mengautentifikasi diambil dari ubuntu forum.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s