2click Update v5.5: Going Lightning with Axel

Dr Android ROM

I am pleased to announce that 2click Update version 5.5 of 5.X series is out. In this major release the entire structure of code has changed. The code is structured in a modular way so that every feature is just a module. Also a new feature is available that will automatically boost the downloading of upgrades in a way that traditional apt-get cannot. The new module is called Speed-apt.

Go grab the new version of 2clickUpdate 5.5 at the Download Page

Behind the scenes…

Not so long ago in WebUpd8 I came across with Axel, a simple piece of software that tries to accelerate HTTP/FTP downloading process by using multiple connections for one file. It can use multiple mirrors for a download. Axel has no dependencies and is lightweight, so it might be useful as a wget clone on byte-critical systems.

I told Andrew, the editor of WebUpd8, that I would integrate Axel in 2clickUpdate for faster downloading of packages. One of the main advantages of Open Source is that there is no need to reinvent the wheel. If a tool exists, use it or make it better. This is the way Science works, in contrast to Closed-Source software development.

Well, 2clickUpdate is a script so I had to find a simple way to implement Axel and more over future improvements and  new features. I had to make the move to a “Modular Bash Scripting” (I am not aware if this is the right definition). Modular Script Writing is the notion that many scripts will use the same features/processes over and over again.  Rather than copying the concept from one project to another, entire segments are duplicated. In 5.1 version of 2clickUpdate I made an announcement that the 5.X series until 6.0 will change, internally, so that the code will lead to a better expandable and maintainable software. Version 6.0 is not so far and 5.5 is a complete, working version with implemented Axel software.

Matt Parnell, has released a “replacement” of apt-get (upgrade, install, dist-upgrade) by combining it with axel in a bash script. With some modifications I was able to create a module that will load when you use 2clickUpdate and accelerate the downloading of package upgrades by using multiple connections. This move, lead me to “extract” all internal procedures to modules. The following image represents the new structure of 2clickUpdate:

I hope that this new approach will eventually lead to a better 2clickupdate and future improvements and new features will be implemented faster, better and in an easier way.

Advertisement

7 Comments

  1. Το axel είναι το αγαπημένο μου download εργαλείο εδώ και χρόνια. Από τα πρώτα προγράμματα που βάζω σε μια καινούρια εγκατάσταση.
    Αν και με βολεύει μια χαρά και το δουλεύω στην κονσόλα… κάποτε είχα ψιλοφτιάξει μια (ας πούμε) “γραφική” λύση μέσω zenity, υπάρχει ακόμα εδώ, για όσους παθαίνουν κάτι στην κονσόλα 🙂

    Like

  2. Fog, άψογο ! Αυτο το zentity είναι μαγικό ! Κάνεις τις εντολές να μοιάζουν με επαγγελματικά λογισμικά… 😛

    Like

  3. I’ve added checksumming to your version of apt-fast and got rid of the need for a temporary file.

    #!/bin/bash

    #This script will download with ‘Axel’ (axelerator) the packages and install them

    #Enabled untrusted and no-promp package installations
    UntrustedUPEnabled=’y –force-yes –allow-unauthenticated upgrade’

    #Beginig the axeleration of package downloads
    if echo “$@” | grep -q “$UntrustedUPEnabled”; then
    cd /var/cache/apt/archives/
    apt-get -qq –print-uris $@ | while read line ; do
    Url=”$(echo $line | awk ‘{print $1}’ | tr -d ‘)”
    axel -a -n 10l “$Url”
    Hash=”$(echo $line | sed “s/.* .*:(.*)/1/g”)”
    HashType=”$(echo $line | sed “s/.* (.*):.*/1/g”)”
    HashCalc=”$(echo ${HashType,,}sum)”
    File=”$(basename $Url)”
    FileHash=”$($HashCalc $File | awk ‘{print $1}’)”
    if [[ “$FileHash” = “$Hash” ]]; then
    echo -e “E[32m33[1m$File successfully verified.33[0m”
    else
    echo -e “E[31m33[1m$File failed verification, retrying…33[0m”
    rm ‘$File’
    axel -a -n 10l “$Url”
    FileSum=”$($HashCalc $File | awk ‘{print $1}’)”
    if [[ “$FileHash” = “$Hash” ]]; then
    echo -e “E[32m33[1m$File successfully verified.33[0m”
    else
    echo -e “E[31m33[1m$File failed verification, quiting.33[0m”
    rm ‘$File’
    exit 1
    fi
    fi
    done
    apt-get $@
    fi

    Like

    1. Mark… you did a great job ! However as you can see through my code, I am not in any way guru in bash scripting. Can you please explain why do we need checksumming as showed in your code instead of a temporary file ? Is this making code much more complicated 🙂 Also, I am curious, how will perform if I implement your version in the GUI flavor of 2clickUpdate if it come to the <> ? What will happen ?

      Simple, noob questions ! 😛 😛 😛

      Like

  4. Sorry for the late response (just email me next time).
    Checksumming is necessary as it stops malicious attempts at changing the .deb downloaded.
    Temporary files are just pointless if it can be done easily without one.
    This code should just work with everything else as is, just replace the apt-fast file with the code.
    Basically if the downloaded .deb fails the checksum twice it falls back on normal downloading.

    Like

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.