Difference between revisions of "Membuat Repository Ubuntu Lokal menggunakan debmirror"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 8: | Line 8: | ||
− | * Buatlah folder untuk menempatkan [[repository]], misalnya /home/media/repo-9. | + | * Buatlah folder untuk menempatkan [[repository]], misalnya /home/media/repo-9.10 |
− | # mkdir /home/media/repo-9. | + | # mkdir /home/media/repo-9.10 |
Line 24: | Line 24: | ||
## THE NEXT LINE IS NEEDED THE REST OF THE LINES STARTING WITH A # CAN BE DELETED | ## THE NEXT LINE IS NEEDED THE REST OF THE LINES STARTING WITH A # CAN BE DELETED | ||
− | #!/bin/bash | + | #!/bin/bash |
## Setting variables with explanations. | ## Setting variables with explanations. | ||
Line 31: | Line 31: | ||
# Don't touch the user's keyring, have our own instead | # Don't touch the user's keyring, have our own instead | ||
# | # | ||
− | export GNUPGHOME=/home/media/mirrorkeyring | + | export GNUPGHOME=/home/media/mirrorkeyring |
# Arch= -a # Architecture. For Ubuntu can be i386, powerpc or amd64. | # Arch= -a # Architecture. For Ubuntu can be i386, powerpc or amd64. | ||
Line 40: | Line 40: | ||
# Minimum Ubuntu system requires main, restricted | # Minimum Ubuntu system requires main, restricted | ||
# Section= -s # Section (One of the following - main/restricted/universe/multiverse). | # Section= -s # Section (One of the following - main/restricted/universe/multiverse). | ||
− | # You can add extra file with $Section/debian-installer. ex: main/debian-installer,universe/debian installer,multiverse/debian-installer,restricted/debian-installer | + | # You can add extra file with $Section/debian-installer. ex: main/debian-installer,universe/debian-installer,multiverse/debian-installer,restricted/debian-installer |
# | # | ||
section=main,restricted,universe,multiverse | section=main,restricted,universe,multiverse | ||
− | # Release= -d # Release of the system (Dapper, Edgy, Feisty, Gutsy, Hardy, Intrepid), and the -updates and -security ( -backports can be added if desired) | + | # Release= -d # Release of the system (Dapper, Edgy, Feisty, Gutsy, Hardy, Intrepid), and the -updates and -security ( -backports can be added if desired) |
# | # | ||
− | release=jaunty,jaunty-security,jaunty-updates | + | # release=jaunty,jaunty-security,jaunty-updates |
− | + | # release=karmic | |
+ | release=karmic,karmic-security,karmic-updates | ||
+ | |||
# Server= -h # Server name, minus the protocol and the path at the end | # Server= -h # Server name, minus the protocol and the path at the end | ||
# CHANGE "*" to equal the mirror you want to create your mirror from. au. in Australia ca. in Canada. | # CHANGE "*" to equal the mirror you want to create your mirror from. au. in Australia ca. in Canada. | ||
# This can be found in your own /etc/apt/sources.list file, assuming you have Ubuntu installed. | # This can be found in your own /etc/apt/sources.list file, assuming you have Ubuntu installed. | ||
# | # | ||
− | server=opensource.telkomspeedy.com:5432 | + | # server=opensource.telkomspeedy.com:5432 |
− | + | # server=dl2.foss-id.web.id | |
+ | server=125.160.17.22 | ||
+ | |||
# Dir= -r # Path from the main server, so http://my.web.server/$dir, Server dependant | # Dir= -r # Path from the main server, so http://my.web.server/$dir, Server dependant | ||
# | # | ||
− | inPath= | + | inPath=ubuntu |
− | + | ||
# Proto= -e # Protocol to use for transfer (http, ftp, hftp, rsync) | # Proto= -e # Protocol to use for transfer (http, ftp, hftp, rsync) | ||
# Choose one - http is most usual the service, and the service must be avaialbe on the server you point at. | # Choose one - http is most usual the service, and the service must be avaialbe on the server you point at. | ||
# | # | ||
proto=http | proto=http | ||
− | + | ||
# Outpath= # Directory to store the mirror in | # Outpath= # Directory to store the mirror in | ||
# Make this a full path to where you want to mirror the material. | # Make this a full path to where you want to mirror the material. | ||
# | # | ||
− | outPath=/home/media/repo-9. | + | outPath=/home/media/repo-9.10 |
− | + | ||
# The --nosource option only downloads debs and not deb-src's | # The --nosource option only downloads debs and not deb-src's | ||
# The --progress option shows files as they are downloaded | # The --progress option shows files as they are downloaded | ||
Line 83: | Line 87: | ||
-e $proto \ | -e $proto \ | ||
$outPath | $outPath | ||
− | + | ||
− | #### End script to automate building of Ubuntu mirror #### | + | #### End script to automate building of Ubuntu mirror #### |
− | |||
Line 100: | Line 103: | ||
* Ubah ijin dari folder mirror | * Ubah ijin dari folder mirror | ||
− | # chown -Rf root.root /home/media/repo-9. | + | # chown -Rf root.root /home/media/repo-9.10 |
− | # chmod -Rf 571 /home/media/repo-9. | + | # chmod -Rf 571 /home/media/repo-9.10 |
Line 128: | Line 131: | ||
# mkdir /var/www/ubuntu | # mkdir /var/www/ubuntu | ||
− | # mount --bind /home/media/repo-9. | + | # mount --bind /home/media/repo-9.10 /var/www/ubuntu |
==Cron supaya secara periodik di update== | ==Cron supaya secara periodik di update== |
Revision as of 07:18, 4 November 2009
Langkah membuat repository Ubuntu dari server opensource.telkomspeedy.com:5432/ubuntu ke Server lokal di LAN
Mengkonfigurasi debmirror
- Install debmirror
# apt-get install debmirror
- Buatlah folder untuk menempatkan repository, misalnya /home/media/repo-9.10
# mkdir /home/media/repo-9.10
- Buatlah script mirror
# vi /usr/local/bin/mirrorbuild.sh
- Masukan script berikut
#### Start script to automate building of Ubuntu mirror ##### ## THE NEXT LINE IS NEEDED THE REST OF THE LINES STARTING WITH A # CAN BE DELETED #!/bin/bash ## Setting variables with explanations. # # Don't touch the user's keyring, have our own instead # export GNUPGHOME=/home/media/mirrorkeyring # Arch= -a # Architecture. For Ubuntu can be i386, powerpc or amd64. # sparc, only starts in dapper, it is only the later models of sparc. # arch=i386 # Minimum Ubuntu system requires main, restricted # Section= -s # Section (One of the following - main/restricted/universe/multiverse). # You can add extra file with $Section/debian-installer. ex: main/debian-installer,universe/debian-installer,multiverse/debian-installer,restricted/debian-installer # section=main,restricted,universe,multiverse # Release= -d # Release of the system (Dapper, Edgy, Feisty, Gutsy, Hardy, Intrepid), and the -updates and -security ( -backports can be added if desired) # # release=jaunty,jaunty-security,jaunty-updates # release=karmic release=karmic,karmic-security,karmic-updates
# Server= -h # Server name, minus the protocol and the path at the end # CHANGE "*" to equal the mirror you want to create your mirror from. au. in Australia ca. in Canada. # This can be found in your own /etc/apt/sources.list file, assuming you have Ubuntu installed. # # server=opensource.telkomspeedy.com:5432 # server=dl2.foss-id.web.id server=125.160.17.22
# Dir= -r # Path from the main server, so http://my.web.server/$dir, Server dependant # inPath=ubuntu
# Proto= -e # Protocol to use for transfer (http, ftp, hftp, rsync) # Choose one - http is most usual the service, and the service must be avaialbe on the server you point at. # proto=http
# Outpath= # Directory to store the mirror in # Make this a full path to where you want to mirror the material. # outPath=/home/media/repo-9.10
# The --nosource option only downloads debs and not deb-src's # The --progress option shows files as they are downloaded # --source \ in the place of --no-source \ if you want sources also. # --nocleanup Do not clean up the local mirror after mirroring is complete. Use this option to keep older repository # Start script # debmirror -a $arch \ --no-source \ -s $section \ -h $server \ -d $release \ -r $inPath \ --progress \ -e $proto \ $outPath
#### End script to automate building of Ubuntu mirror ####
Simpan script jika sudah selesai di edit semua-nya.
- Ubah ijin agar file mirrorbuild.sh dapat di jalankan
# chmod -Rf 777 /usr/local/bin/mirrorbuild.sh
- Ubah ijin dari folder mirror
# chown -Rf root.root /home/media/repo-9.10 # chmod -Rf 571 /home/media/repo-9.10
- Buat folder untuk mirror keyring
# mkdir /home/media/mirrorkeyring # gpg --no-default-keyring --keyring /home/media/mirrorkeyring/trustedkeys.gpg --import /usr/share/keyrings/ubuntu-archive-keyring.gpg
- Jalankan mirrorbuild.sh
# mirrorbuild.sh
- Sebelum bisa digunakan dengan baik, kadang kala kita perlu beberapa kali menjalankan perintah
# gpg --no-default-keyring --keyring /home/media/mirrorkeyring/trustedkeys.gpg --import /usr/share/keyrings/ubuntu-archive-keyring.gpg # mirrorbuild.sh
Membuat Repository di Web
- Pertama-tama Instalasi Apache
- Buat link statik antara download repository ke Web
# mkdir /var/www/ubuntu # mount --bind /home/media/repo-9.10 /var/www/ubuntu
Cron supaya secara periodik di update
- Edit Tabel cron
# crontab -e
- Agar setiap jam 10 malam di update. Isi dengan kata-kata
0 22 * * * /usr/local/bin/mirrorbuild.sh
- Aktifkan cron
# /etc/init.d/cron restart
Setup di sisi Client
- Edit /etc/apt/sources.list dan isi
deb http://mirrorbox/ubuntu jaunty main restricted universe multiverse deb http://mirrorbox/ubuntu jaunty-updates main restricted universe multiverse deb http://mirrorbox/ubuntu jaunty-security main restricted universe multiverse