You are not logged in.

#1 2016-10-20 08:53:39

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 730

Tip: Speed up apt-get up(date/grade) use netselect-apt to pick mirror.

httpredir.debian.org is a wonderfully reliable way to specify a mirror during install, and it keeps working, but it's far from optimal in terms of speed, as it introduces a redirect in the whole list of every contact, picking a fast local mirror speeds things up significantly, at least on my systems it does.

Fortunately the process of determining which is a good mirror is automated by netselect-apt taking the guesswork out of the process.

Here is, blow-by-blow, how I used it on my system:

sudo apt-get install netselect-apt

Then run it

sudo  netselect-apt

After a lot of stuff scrolls up the screen, you'll be presented with the top 10 fastest mirrors, something like this:

beardy@debian-vbox:~$ sudo netselect-apt
Using distribution stable.
Retrieving the list of mirrors from www.debian.org...
<omitted>
....................
The fastest 10 servers seem to be:

	http://ukdebian.mirror.anlx.net/debian/
	http://ukdebian.mirror.anlx.net/debian/
	http://mirror.sov.uk.goscomb.net/debian/
	http://mirrors.evowise.com/debian/
	http://mirror.lchost.net/debian/
	http://debian.mirror.uk.sargasso.net/debian/
	http://mirror.vorboss.net/debian/
	http://mirrors.melbourne.co.uk/debian/
	http://mirror.mythic-beasts.com/debian/
	http://free.hands.com/debian/

Of the hosts tested we choose the fastest valid for HTTP:
       http://ukdebian.mirror.anlx.net/debian/

Writing sources.list

Done.
beardy@debian-vbox:~$

This drops a sample sources.list (without non-free or bunsen entries) in the current directory, which can safely be deleted, sometimes the generated list has some odd entries, in my case the first one makes sense, if it didn't I'd pick something lower on the list, now to revise the real sources.list, you could use your favourite text editor, but I'm lazy and did :

sudo sed -i "s|http://httpredir.debian.org/debian|http://ukdebian.mirror.anlx.net/debian|g" /etc/apt/sources.list

and because I had bl-welcome add jessie-backports also:

sudo sed -i "s|http://httpredir.debian.org/debian|http://ukdebian.mirror.anlx.net/debian|g" /etc/apt/sources.list.d/debian-jessie-backports.list

Obviously you'll use your chosen mirror rather than http://ukdebian.mirror.anlx.net/debian
As a sanity check, you might want to

cat /etc/apt/sources.list

And we're done, apart from the very important

sudo apt-get update

Which should go rather faster than before!

If one was being really thorough, one could run this at different times of day for a period of time, and specify a mirror that appeared consistently in the top ten, I'm not that thorough.


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

#2 2016-10-20 12:22:07

dolly
Miss Mixunderstand
From: /lab1
Registered: 2015-10-03
Posts: 402

Re: Tip: Speed up apt-get up(date/grade) use netselect-apt to pick mirror.

Interesting, thanks. smile


Keep BunsenLabs #!yish please.

Offline

#3 2016-10-21 04:01:18

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 7,136
Website

Re: Tip: Speed up apt-get up(date/grade) use netselect-apt to pick mirror.

Thanks for bringing this up B_B.
While httpredir.debian.org seems to be a good default choice, it is a bit slow at times.
I had forgotten to change my current system to a local mirror, and now having done so 'apt-get update' does indeed run quite a bit faster.  cool

It might be worth mentioning why netselect-apt needs to be run with sudo:

man netselect-apt wrote:

       If netselect is not installed setuid, then netselect-apt needs to  run  as  an
       administrator  user  (i.e.  root).  This  is only required because the network
       probes done by netselect requires these permissions. No changes  are  done  to
       the system.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Online

#4 2016-10-21 06:06:56

ohnonot
...again
Registered: 2015-09-29
Posts: 4,774
Website

Re: Tip: Speed up apt-get up(date/grade) use netselect-apt to pick mirror.

since, afaiu, on debian one has to choose one url for each list entry, i'd like to add:
choose the fastest and most reliable.
as B_B muses, a few subsequent analytical runs (over a couple of days) of netselect-apt will probably show you which one that is.
in my experience, the fastest mirror is not always the fastest.

+rant:
i don't really see the point though, other than taking the load off httpredir.debian.org.
updating my system is one of the few occasions where i really like to take some time, sit by my screen and watch intently.
experience has told me that it's better to do that immediately, rather than to wonder later what went wrong.
reliability really comes first here, not speed.


BL quote proposals to this thread please.
how to ask smart questions | my repos / my repos | my blog
---
Thank you for posting direct image links!

Offline

#5 2016-10-21 06:45:46

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: Tip: Speed up apt-get up(date/grade) use netselect-apt to pick mirror.

ohnonot wrote:

updating my system is one of the few occasions where i really like to take some time, sit by my screen and watch intently.

You should use Debian stable, updating that is a carefree experience tongue

Thanks for the tip B_B, I had not heard of this tool smile


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#6 2016-10-21 07:22:29

Snap
Member
Registered: 2015-10-02
Posts: 465

Re: Tip: Speed up apt-get up(date/grade) use netselect-apt to pick mirror.

Wonderful tip. Thanks a bunch.

Offline

#7 2016-10-22 06:30:55

ohnonot
...again
Registered: 2015-09-29
Posts: 4,774
Website

Re: Tip: Speed up apt-get up(date/grade) use netselect-apt to pick mirror.

Head_on_a_Stick wrote:

You should use Debian stable, updating that is a carefree experience tongue

i'm aware my comment is coloured by my archlinux experiences (and i appreciate the tongue-in-cheek), but i act the same way with my debian stable server.

and i have seen many help threads that started precisely for that reason: not knowing what went wrong during upgrade, because the user assumed that you're supposed to "hold down the enter key".

that said, of course it makes sense to find the most suitable mirror!!!
so, +1 for netselect-apt; i just got hung up on the thread title.

Last edited by ohnonot (2016-10-22 06:35:01)


BL quote proposals to this thread please.
how to ask smart questions | my repos / my repos | my blog
---
Thank you for posting direct image links!

Offline

#8 2016-10-22 07:01:17

damo
....moderator....
Registered: 2015-08-20
Posts: 6,121

Re: Tip: Speed up apt-get up(date/grade) use netselect-apt to pick mirror.

^ Yes, as in "Do you want to install the package maintainers version, or keep the current file?" That occasionally causes trouble with Stable!


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#9 2016-10-22 07:41:41

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 730

Re: Tip: Speed up apt-get up(date/grade) use netselect-apt to pick mirror.

damo wrote:

^ Yes, as in "Do you want to install the package maintainers version, or keep the current file?" That occasionally causes trouble with Stable!

I'd still rather be asked that two minutes after i start than three.


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

Board footer

Powered by FluxBB