Author Topic: Synaptic on steroids using apt-fast directly  (Read 1780 times)

Offline axxer

  • New Friend
  • *
  • Posts: 2
Synaptic on steroids using apt-fast directly
« on: December 12, 2011, 11:49:22 AM »
just to share my findings, i can use synaptic to use apt-fast script to act as man in the middle, so it will use axel to accelerate downloading packages.

before this, apt-fast can only be use in terminal, now can use it directly using synaptic. perfect for lazy-to-type-in-terminal as me  ;D

now to the point, first open /usr/bin/apt-fast using any text editor as root. apt-fast script is installed by default for me (using 2011.09 kde minime version), dont really know about other version. search for it in synaptic if its not already installed.

btw edit the file, search for this string (line 24) and edit it, from
Code: [Select]
y) if apt-get install axel -y --force-yes
to
Code: [Select]
y) if apt-fast install axel -y --force-yes
then this string, line 42
Code: [Select]
apt-get -y --print-uris $@ | egrep -o -e "(ht|f)tp://[^\']+" > apt-fast.list && cat apt-fast.list | xargs -l1 axel -a
to
Code: [Select]
apt-fast -y --print-uris $@ | egrep -o -e "(ht|f)tp://[^\']+" > apt-fast.list && cat apt-fast.list | xargs -l1 axel -a
then both line 45 and line 50
Code: [Select]
apt-get $@;
to
Code: [Select]
apt-fast $@;
then save it.
after done saving, rename the apt-fast into apt-get and the original apt-get file in the same folder as apt-fast. make sure both renamed file is executable and ur done.
now start synaptic, try downloading any big package and see how the speed is  ;D

also if u use apt-get command from terminal from now own, its actually the apt-fast script and its works just fine. all original apt-get command eg apt-get install, remove, dist-upgrade etc works.

do take note that before upgrading the actual apt and apt-fast package itself (if any update come after u do this), u need to rename back both file, apt-get into apt-fast and the other way around. also that i wouldnt be responsible if u borked ur machine, it exploded and ur cat is catch on fire from ur exploded machine because doing all this. do it on ur own risk.

on the light note, i've been using this for months without any problem whatsoever :D
« Last Edit: December 12, 2011, 12:01:37 PM by axxer »

Offline rubentje1991

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2110
  • Rubenus Parvus MCMXCI
Re: Synaptic on steroids using apt-fast directly
« Reply #1 on: December 12, 2011, 12:24:08 PM »
What are the speed differences for you (you tested it: how much advantage someone can get from using this)?  :)

Offline axxer

  • New Friend
  • *
  • Posts: 2
Re: Synaptic on steroids using apt-fast directly
« Reply #2 on: December 12, 2011, 12:30:36 PM »
my max speed arent that fast, around 100kBps. originally synaptic just hovering around 60-70. doing this it easily stable at 90.

Offline rubentje1991

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2110
  • Rubenus Parvus MCMXCI
Re: Synaptic on steroids using apt-fast directly
« Reply #3 on: December 13, 2011, 03:42:05 AM »
Thanks for the info!  :)

Offline YouCanToo

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 5337
  • Location: Lebanon, OR., USA
    • Spreading the word.......
Re: Synaptic on steroids using apt-fast directly
« Reply #4 on: December 13, 2011, 09:08:27 AM »
just to share my findings, i can use synaptic to use apt-fast script to act as man in the middle, so it will use axel to accelerate downloading packages.

before this, apt-fast can only be use in terminal, now can use it directly using synaptic. perfect for lazy-to-type-in-terminal as me  ;D

now to the point, first open /usr/bin/apt-fast using any text editor as root. apt-fast script is installed by default for me (using 2011.09 kde minime version), dont really know about other version. search for it in synaptic if its not already installed.

btw edit the file, search for this string (line 24) and edit it, from
Code: [Select]
y) if apt-get install axel -y --force-yes
to
Code: [Select]
y) if apt-fast install axel -y --force-yes
then this string, line 42
Code: [Select]
apt-get -y --print-uris $@ | egrep -o -e "(ht|f)tp://[^\']+" > apt-fast.list && cat apt-fast.list | xargs -l1 axel -a
to
Code: [Select]
apt-fast -y --print-uris $@ | egrep -o -e "(ht|f)tp://[^\']+" > apt-fast.list && cat apt-fast.list | xargs -l1 axel -a
then both line 45 and line 50
Code: [Select]
apt-get $@;
to
Code: [Select]
apt-fast $@;
then save it.
after done saving, rename the apt-fast into apt-get and the original apt-get file in the same folder as apt-fast. make sure both renamed file is executable and ur done.
now start synaptic, try downloading any big package and see how the speed is  ;D

also if u use apt-get command from terminal from now own, its actually the apt-fast script and its works just fine. all original apt-get command eg apt-get install, remove, dist-upgrade etc works.

do take note that before upgrading the actual apt and apt-fast package itself (if any update come after u do this), u need to rename back both file, apt-get into apt-fast and the other way around. also that i wouldnt be responsible if u borked ur machine, it exploded and ur cat is catch on fire from ur exploded machine because doing all this. do it on ur own risk.

on the light note, i've been using this for months without any problem whatsoever :D


Have you thought about adding your tip in the PCLinuxOS knowledge base (http://pclinuxoshelp.com)




Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!

Offline Matt Parnell/ilikenwf

  • New Friend
  • *
  • Posts: 4
    • Matt Parnell's Brain: Plugged In!
Re: Synaptic on steroids using apt-fast directly
« Reply #5 on: December 22, 2011, 01:50:46 PM »
12/22/2011: I've moved development of apt-fast to github. Note that the current version I have not tested yet, so I need testers...and users...and people to improve apt-fast and put in pull requests

https://github.com/ilikenwf/apt-fast
See my site here... http://www.mattparnell.com

Offline johnmart

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1106
  • Make Love Not War
Re: Synaptic on steroids using apt-fast directly
« Reply #6 on: December 22, 2011, 10:02:31 PM »
Axxer, I think this is a great tip.
I Followed your how-to 'til I got to your fiery cat disclaimer, then backed out.
When I thought about remembering to check for apt & apt-fast updates, & reverting the renamed files I knew that I would most likely fail to catch that after a few months, & mess up apt.

Thanks for the great disclaimer.  ;D
btw. I've used apt-fast for quite a while & appreciate any speed boost I can get.
hint:the up arrow in konsole save you keystrokes.  ;D (I know you knew that ;D)
« Last Edit: December 22, 2011, 10:05:18 PM by johnmart »
Acer Aspire, Intel core2 2.20GHz, ‎Graphics nVidia ‎G98M [GeForce G 105M], 2gb ram, Wireless Intel Link 5100

Why, any 5 year old child could understand this.
Somebody bring me a 5 year old.
Groucho

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10696
  • MLUs Forever!
Re: Synaptic on steroids using apt-fast directly
« Reply #7 on: December 23, 2011, 06:59:18 AM »
wondering if it is possible, without causing confusion in the system, to have apt-get point to apt-fast and vice versa .....  and would this then allow updates to continue normally ...... alias or something of that nature maybe? .....
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8603
  • Aurum nostrum non est aurum vulgi.
Re: Synaptic on steroids using apt-fast directly
« Reply #8 on: December 23, 2011, 07:20:34 AM »
Wow, that's a pretty cool tip.

I'd like to try it sometime but at the moment I have several aliases tied to both downloaders, e.g. agu=sudo apt-get update, agi=sudo apt-get install, agr=sudo apt-get remove, etc. and afi=sudo apt-fast install, afr=sudo apt-fast remove and so on.

I've copied and paste your tip on Zim and would surely give it a try. What would be really cool would be to speed up rsync. ;)

Anyway, thanks for the tip.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8603
  • Aurum nostrum non est aurum vulgi.
Re: Synaptic on steroids using apt-fast directly
« Reply #9 on: December 23, 2011, 03:23:51 PM »
Come to think of it, it might just work with the tweak and my aliases ... I'd just have to think the other way around! If I want to use apt-get, I'd need to remember it's changed to apt-fast!

LOL ;D
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42