PCLinuxOS-Forums
News: ...FLASH!!! ...New PCLinuxOS Testing board now open. Register today! Be an active contributor to the PCLinuxOS future! ... Read all about it now, on THIS forum!!!..
 
*
Welcome, Guest. Please login or register. May 24, 2012, 04:31:34 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Synaptic on steroids using apt-fast directly  (Read 832 times)
axxer
New Friend
*
Offline Offline

Posts: 2


« on: December 12, 2011, 01:49:22 PM »

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  Grin

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:
y) if apt-get install axel -y --force-yes

to
Code:
y) if apt-fast install axel -y --force-yes

then this string, line 42
Code:
apt-get -y --print-uris $@ | egrep -o -e "(ht|f)tp://[^\']+" > apt-fast.list && cat apt-fast.list | xargs -l1 axel -a

to
Code:
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:
apt-get $@;

to
Code:
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  Grin

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 Cheesy
Logged
rubentje1991
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 2052


Rubenum Parvus MCMXCI


« Reply #1 on: December 12, 2011, 02:24:08 PM »

What are the speed differences for you (you tested it: how much advantage someone can get from using this)?  Smiley
Logged
axxer
New Friend
*
Offline Offline

Posts: 2


« Reply #2 on: December 12, 2011, 02: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.
Logged
rubentje1991
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 2052


Rubenum Parvus MCMXCI


« Reply #3 on: December 13, 2011, 05:42:05 AM »

Thanks for the info!  Smiley
Logged
YouCanToo
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 4243


Location: Lebanon, OR., USA


WWW
« Reply #4 on: December 13, 2011, 11: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  Grin

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:
y) if apt-get install axel -y --force-yes

to
Code:
y) if apt-fast install axel -y --force-yes

then this string, line 42
Code:
apt-get -y --print-uris $@ | egrep -o -e "(ht|f)tp://[^\']+" > apt-fast.list && cat apt-fast.list | xargs -l1 axel -a

to
Code:
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:
apt-get $@;

to
Code:
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  Grin

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 Cheesy


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





Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!
Matt Parnell/ilikenwf
New Friend
*
Offline Offline

Posts: 4


WWW
« Reply #5 on: December 22, 2011, 03: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
Logged

See my site here... http://www.mattparnell.com
johnmart
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 741


Make Love Not War


« Reply #6 on: December 23, 2011, 12:02:31 AM »

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.  Grin
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.  Grin (I know you knew that Grin)
Logged

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
Just18
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 4584


MLUs Forever!


« Reply #7 on: December 23, 2011, 08: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? .....
Logged

MLUs rule the roost!

Linux XPS 3.2.17-pclos1.pae.bfs  32 bit
Intel(R) Core(TM)2 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 ‎DVB-T 2 USB DTT
Archie
Global Moderator
Hero Member
*****
Offline Offline

Posts: 6858


I will never forget you, uhhh...


« Reply #8 on: December 23, 2011, 09: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. Wink

Anyway, thanks for the tip.
Logged

Archie
Global Moderator
Hero Member
*****
Offline Offline

Posts: 6858


I will never forget you, uhhh...


« Reply #9 on: December 23, 2011, 05: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 Grin
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM