## page was renamed from Udienz/Debmirror/Script {{{ #!/bin/bash # created by Mahyuddin Susanto # please give this file exsecution mode # sudo chmod +x this_file.sh # i asumsed you run this file at /home/mirror/ # type $ man debmirror for more information about debmirror MIR=/usr/bin/debmirror if test -e $MIR; then # this is most important :p echo "Debian/Ubuntu scanning packages for own repository" echo "Created by Mahyuddin Susanto aka udienz@ubuntu.com" echo "Use Your Own Risk" else echo "Currently, package dependency is not installed on your system, please install first" echo "using apt-get install debmirror" exit 1 fi # Server, lets declare your target server, you can add your nearest ubuntu mirror like jp.archive.ubuntu.com SERVER=archive.ubuntu.com # tellme where root server have ubuntu mirror, you can insert like: ubuntu, pub/ubuntu depends your server # example: ubuntu mirror at foss-id like http://dl2.foss-id.web.id/ubuntu of course you can type ROOT=ubuntu ROOT=ubuntu # What's your method to use mirroring? you can use http, ftp, hftp, rsync method METHOD=http # let's discuss about release ubuntu, ubuntu have code name release like wathy, breezy, dapper, edgy, feisty, gutsy, hardy, intrepid # in this case you can mirroring release ubuntu more than one release, or you can mirroring update package, security package, proposed package # ex: $release-security so you can type hardy,hardy-updates,hardy-security,hardy-backports,hardy-proposed RELEASE=hardy,hardy-updates,hardy-security,hardy-backports,hardy-proposed,intrepid,intrepid-updates,intrepid-security,intrepid-backports,intrepid-proposed # section, hm... no more information here :D # ubuntu section is main, restricted, universe, multiverse # but you can add more section like debian-installer on the section SECTION=main,restricted,universe,multiverse,main/debian-installer,restricted/debian-installer,universe/debian-installer,multiverse/debian-installer # architecture... hm.. what architecture fo you want to mirroring? i386 (32bit), amd64 (64bit, include IA64), sparc or powerpc? ARCHITECTURE=i386,amd64 #just it? # okey next you must save mirror file to your directory, but you must declare on here. i save my mirror at /media/mirror/ubuntu TARGET=ubuntu if test -d `pwd`/ubuntu; then EXISTS="yes" else echo "it seems you don't have ubuntu directory, create first!" exit 1 fi # hmm.... do you cannocted under proxy? if yes you must add --proxy=http://you-name:your_passwd@url:port debmirror -m --passive \ --host=$SERVER \ --root=$ROOT \ --method=$METHOD \ --progress \ --dist=$DISTRO \ --section=$SECTION \ --arch=$ARCHITECTURE \ $TARGET \ --nosource --getcontents # if you want to mirroring both of binary package and source you can delete --nosource, i'm not this option because my disk is limiitted. # and if you don't want to remove previous repositories you can add --nocleanup option # if you get error messages about gpg files maybe you forget to add gpg ubuntu archive as trusted keys :D # gpg --keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg --export | gpg --no-default-keyring --keyring trustedkeys.gpg --import # note: remember your free space and bandwidth :D}}}