Notices


Reply
Thread Tools
Posts: 561 | Thanked: 75 times | Joined on Jan 2010 @ Spain
#1
Thanks to sites like:
http://ubuntuforums.org/showthread.php?t=818619
http://ubuntulife.wordpress.com/?s=fast+apt

I get more speed at the facility from program commands.

Do they work well on the N900?

-------------------------------------------
If we accelerate downloads by apt-get can do the following.

Install axel(You also need egrep):
Code:
sudo apt-get install axel
We then create a file called apt-fast with the following contents (see code below). We execute permissions: chmod + x apt-fast and move it to / usr / bin now, every time you want to install something, instead of running apt-get install package_name, run apt-install-name fast.

Code:
#!/bin/sh
#apt-fast by Matt Parnell http://www.mattparnell.com , this thing is FOSS
#please feel free to suggest improvments to admin@mattparnell.com
# Use this just like apt-get for faster package downloading. Make sure to have axel installed

#If the first user entered variable string contains apt-get, and the second string entered is either install or dist-upgrade
if echo "$1" | grep -q "[upgrade]" || echo "$2" | grep -q "[install]" || echo "$2" | grep -q "[dist-upgrade]"; then
  echo "Working...";

  #Go into the directory apt-get normally puts downloaded packages
  cd /var/cache/apt/archives/;

  #Have apt-get print the information, including the URI's to the packages
  apt-get -y --print-uris $1 $2 $3 $4 > debs.list;

  #Strip out the URI's, and download the packages with Axel for speediness
  egrep -o -e "(ht|f)tp://[^\']+" debs.list | xargs -l1 axel -a;

  #Perform the user's reqested action via apt-get
  apt-get -y $1 $2 $3 $4;

  echo "Done! Make sure and check to see that the packages all were installed properly. If a package is erred, run sudo apt-get autoclean and try installing it again without the use of this script.";

elif echo "$1" | grep -q "[*]"; then
  apt-get $1;
else
  echo "Sorry, but you appear to be entering invalid options. You must use apt-get and one of apt-get's options in order to use this script.";
fi
 

The Following 2 Users Say Thank You to WhiteWolf For This Useful Post:
Posts: 2,225 | Thanked: 3,819 times | Joined on Jun 2010 @ Florida
#2
Neat. I honestly feel it's fast enough with FApMan, but looks neat, and I'm sure plenty of people could use this. (Funny enough, I already have Axel, and have used it as my default for downloading things from command-line for a while now.) So thanks for sharing.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 11:43.