Dimensione: 2760
Commento:
|
Dimensione: 6986
Commento:
|
Le cancellazioni sono segnalate in questo modo. | Le aggiunte sono segnalate in questo modo. |
Linea 5: | Linea 5: |
[[Indice()]] | [[Indice(depth=2 align=right)]] |
Linea 9: | Linea 10: |
'''zsync''' is a usefull progam to download the parts of a file that are changed on the server, so you haven't to download everytime a full copy of Ubuntu but simply update it. | '''zsync''' is an usefull progam to download the parts of a file that are changed on the server, so you haven't to download everytime a full copy of Ubuntu but simply update it. |
Linea 12: | Linea 13: |
A nice thing about the way the Ubuntu CDs are constructed is that it's quite easy to keep an up to date local install CD using zsync. Since the daily CDs generally change quite little, it can be processed quite quickly. | |
Linea 19: | Linea 21: |
All Ubuntu's CD images are stored on the http://cdimage.ubuntu.com site. | All Ubuntu's CD images are stored on http://cdimage.ubuntu.com site. |
Linea 21: | Linea 23: |
If you have a local Ubuntu archive mirror or cache, you can also use Jigdo, zsync is handy for finishing up Jigdo downloads that still have a few missing pieces. | |
Linea 56: | Linea 59: |
== Updating with rsync instead == | = Updating with rsync instead = |
Linea 58: | Linea 61: |
Another way to update your ISO is by rsync. | Another way to update your ISO is by '''rsync'''. |
Linea 60: | Linea 63: |
https://launchpad.net/products/rsync is a good resource for more information. | |
Linea 70: | Linea 74: |
A slightly more advanced script will automate much of the syncing process. To run this script successfully, you will need to set the DIR variable according to your needs. You can set ISO inside the script or simply pass it in on the command-line (to make it easier to sync multiple ISO images). In some cases you may need to manually set ISOPATH if you're downloading an image not automatically detected. Add "#!/bin/bash" on Top of the script (It is there in editing-mode). {{{ #Script for updating individual ISO image at cdimage.ubuntu.com (daily/current versions). #Orginal script written by Henrik Omma, slightly adjusted by Bert Verhaeghe, then a bit by Victor Van Hee #Jeremy Yoder made it try to automatically pick an ISOPATH, adapted to lucid by Fabio Marconi. # Change this next line to the directory where your previously downloaded iso image sits. DIR="/home/USERNAME/Desktop/lucid" # Choose only one of the iso files below and uncomment it ISO="lucid-desktop-amd64.iso" # ISO="lucid-desktop-i386.iso" # ISO="lucid-alternate-amd64.iso" # ISO="lucid-alternate-i386.iso" # Uncomment the line below if you want a different image not listed below # ISOPATH="cdimage.ubuntu.com/cdimage/LOCATION/current" # Default ISO to the first command-line parameter if [ "$1" != "" ]; then ISO=$1 fi if [ "$ISOPATH" = "" ]; then if [[ "$ISO" =~ "-desktop-" ]]; then ISOPATH="cdimage.ubuntu.com/cdimage/daily-live/current" elif [[ "$ISO" =~ "-alternate-" ]]; then ISOPATH="cdimage.ubuntu.com/cdimage/daily/current" elif [[ "$ISO" =~ "-dvd-" ]]; then ISOPATH="cdimage.ubuntu.com/cdimage/dvd/current" elif [[ "$ISO" =~ "-netbook-remix-" ]]; then ISOPATH="cdimage.ubuntu.com/cdimage/ubuntu-netbook-remix/daily-live/current" elif [[ "$ISO" =~ "-server-" ]]; then ISOPATH="cdimage.ubuntu.com/cdimage/ubuntu-server/daily/current" else echo "Unrecognized distribution, set ISOPATH manually" exit 1 fi fi if [ ! -d $DIR ]; then echo "Sorry, $DIR does not exist" exit fi cd $DIR md5sum $ISO | sed -e "s/ / */" > $ISO.md5.local # ^ create identical formatted md5sum file from local copy echo "" echo "########################################" echo "# diff'ing MD5SUMs : local <-> server #" echo "########################################" wget -q http://$ISOPATH/MD5SUMS grep $ISO MD5SUMS > $ISO.md5.server rm MD5SUMS diff -q $ISO.md5.local $ISO.md5.server if [ ! $? -eq "0" ]; then echo "" echo "!!! MD5SUMs differ !!!" echo "...Performing rsync..." echo "###################" echo "# rsync iso image #" echo "###################" rsync -avzhhP rsync://$ISOPATH/$ISO . else echo "" echo "MD5SUMs identical -- no need to Rsync" echo "" exit 0 fi echo "" echo "########################################" echo "# diff'ing MD5SUMs : local <-> server #" echo "########################################" md5sum $ISO | sed -e "s/ / */" > $ISO.md5.local diff -q $ISO.md5.local $ISO.md5.server if [ ! $? -eq "0" ]; then echo "" echo "!!! MD5SUMs differ !!!" echo "!!! Rsync failed! !!!" else echo "" echo "MD5SUMs identical" echo "SUCCESS!" fi echo "" }}} This script does three things. First, it creates files containing the MD5SUMs of both the current local and server images, and outputs if the MD5SUMs are identical or not. If they are not identical, it syncs your local ISO image to the most recent ISO image on the Ubuntu servers. It then rechecks the new local MD5SUM and compares it to the server image, and outputs if the MD5SUMs are identical or not. |
BR Indice(depth=2 align=right)
Intro
zsync is an usefull progam to download the parts of a file that are changed on the server, so you haven't to download everytime a full copy of Ubuntu but simply update it.
zsync will also provvide to make the checksum comparison and made possible the change of flavor (e.g. you have an ISO of Ubuntu and want to change it on kubuntu, simply copy/paste the right line for Kubuntu and it will download only the files that differs from the two versions). A nice thing about the way the Ubuntu CDs are constructed is that it's quite easy to keep an up to date local install CD using zsync. Since the daily CDs generally change quite little, it can be processed quite quickly.
Installing zsync
Install [apt://zsync zsync] package.
Acquiring the ISO
All Ubuntu's CD images are stored on http://cdimage.ubuntu.com site. The fastest way to download is by [http://en.wikipedia.org/wiki/BitTorrent_(software): Torrent]. If you have a local Ubuntu archive mirror or cache, you can also use Jigdo, zsync is handy for finishing up Jigdo downloads that still have a few missing pieces.
Updating the ISO
To update your ISO image, open a Terminal, go to the directory where you have saved the image and copy/paste the appropriate from the following commands.
** Computer with 32 bit (i386) architecture
UBUNTU
zsync http://cdimage.ubuntu.com/daily-live/current/lucid-desktop-i386.iso.zsync
KUBUNTU
zsync http://cdimage.ubuntu.com/kubuntu/daily-live/current/lucid-desktop-i386.iso.zsync
XUBUNTU
zsync http://cdimage.ubuntu.com/xubuntu/daily-live/current/lucid-desktop-i386.iso.zsync
** Computer with 64 bit (amd64 or multicore) architecture
UBUNTU
zsync http://cdimage.ubuntu.com/daily-live/current/lucid-desktop-amd64.iso.zsync
KUBUNTU
zsync http://cdimage.ubuntu.com/kubuntu/daily-live/current/lucid-desktop-amd64.iso.zsync
XUBUNTU
zsync http://cdimage.ubuntu.com/xubuntu/daily-live/current/lucid-desktop-amd64.iso.zsync
Updating with rsync instead
Another way to update your ISO is by rsync. It use the same algorithm of zsync but as it require special software on the server end it is a little bit less efficient than zsync. https://launchpad.net/products/rsync is a good resource for more information. A number of the Ubuntu servers also work as rsync servers with quite similar URIs to the websites. For example:
rsync -zhhP rsync://cdimage.ubuntu.com/cdimage/daily-live/current/lucid-desktop-i386.iso .
will sync the server's daily Lucid desktop image (for i386) to your local system with an older desktop image already stored on your hard drive. -z is compression, -hh is human readable file size (in KB or MB), and -P is a progress indicator.
Note: If you are using other flavors of Ubuntu don't forget to add the flavor's name in the rsync path after cdimage/, e.g.
rsync -zhhP rsync://cdimage.ubuntu.com/cdimage/kubuntu/daily-live/current/lucid-desktop-i386.iso .
A slightly more advanced script will automate much of the syncing process. To run this script successfully, you will need to set the DIR variable according to your needs. You can set ISO inside the script or simply pass it in on the command-line (to make it easier to sync multiple ISO images). In some cases you may need to manually set ISOPATH if you're downloading an image not automatically detected. Add "#!/bin/bash" on Top of the script (It is there in editing-mode).
#Script for updating individual ISO image at cdimage.ubuntu.com (daily/current versions). #Orginal script written by Henrik Omma, slightly adjusted by Bert Verhaeghe, then a bit by Victor Van Hee #Jeremy Yoder made it try to automatically pick an ISOPATH, adapted to lucid by Fabio Marconi. # Change this next line to the directory where your previously downloaded iso image sits. DIR="/home/USERNAME/Desktop/lucid" # Choose only one of the iso files below and uncomment it ISO="lucid-desktop-amd64.iso" # ISO="lucid-desktop-i386.iso" # ISO="lucid-alternate-amd64.iso" # ISO="lucid-alternate-i386.iso" # Uncomment the line below if you want a different image not listed below # ISOPATH="cdimage.ubuntu.com/cdimage/LOCATION/current" # Default ISO to the first command-line parameter if [ "$1" != "" ]; then ISO=$1 fi if [ "$ISOPATH" = "" ]; then if [[ "$ISO" =~ "-desktop-" ]]; then ISOPATH="cdimage.ubuntu.com/cdimage/daily-live/current" elif [[ "$ISO" =~ "-alternate-" ]]; then ISOPATH="cdimage.ubuntu.com/cdimage/daily/current" elif [[ "$ISO" =~ "-dvd-" ]]; then ISOPATH="cdimage.ubuntu.com/cdimage/dvd/current" elif [[ "$ISO" =~ "-netbook-remix-" ]]; then ISOPATH="cdimage.ubuntu.com/cdimage/ubuntu-netbook-remix/daily-live/current" elif [[ "$ISO" =~ "-server-" ]]; then ISOPATH="cdimage.ubuntu.com/cdimage/ubuntu-server/daily/current" else echo "Unrecognized distribution, set ISOPATH manually" exit 1 fi fi if [ ! -d $DIR ]; then echo "Sorry, $DIR does not exist" exit fi cd $DIR md5sum $ISO | sed -e "s/ / */" > $ISO.md5.local # ^ create identical formatted md5sum file from local copy echo "" echo "########################################" echo "# diff'ing MD5SUMs : local <-> server #" echo "########################################" wget -q http://$ISOPATH/MD5SUMS grep $ISO MD5SUMS > $ISO.md5.server rm MD5SUMS diff -q $ISO.md5.local $ISO.md5.server if [ ! $? -eq "0" ]; then echo "" echo "!!! MD5SUMs differ !!!" echo "...Performing rsync..." echo "###################" echo "# rsync iso image #" echo "###################" rsync -avzhhP rsync://$ISOPATH/$ISO . else echo "" echo "MD5SUMs identical -- no need to Rsync" echo "" exit 0 fi echo "" echo "########################################" echo "# diff'ing MD5SUMs : local <-> server #" echo "########################################" md5sum $ISO | sed -e "s/ / */" > $ISO.md5.local diff -q $ISO.md5.local $ISO.md5.server if [ ! $? -eq "0" ]; then echo "" echo "!!! MD5SUMs differ !!!" echo "!!! Rsync failed! !!!" else echo "" echo "MD5SUMs identical" echo "SUCCESS!" fi echo ""
This script does three things. First, it creates files containing the MD5SUMs of both the current local and server images, and outputs if the MD5SUMs are identical or not. If they are not identical, it syncs your local ISO image to the most recent ISO image on the Ubuntu servers. It then rechecks the new local MD5SUM and compares it to the server image, and outputs if the MD5SUMs are identical or not.