Comments (10)
I wrote a little python script that does that for me on Debian testing: https://github.com/stfl/apt-fast-mirrors
from apt-fast.
+1
from apt-fast.
you can use netselect-apt for that. it gives you a list of the 10 best mirrors... you can then copy it into the MIRRORS variable..
shouldn't be too hard to automate that in a script.. ;)
sudo netselect-apt testing -n
here for Debian testing ;)
from apt-fast.
I've got a Bash function to extract URLs of up-to-date Ubuntu mirrors below.
ubuntu_mirror() {
local url="https://launchpad.net/ubuntu/+archivemirrors"
local xpath1="//table/tbody/tr[td/span[@class='distromirrorstatusUP']]/td/a[starts-with(@href,'"
local xpath2="${xpath1}$1"
local xpath="${xpath2}')]/@href"
wget -qO- $url | xmllint --html --xpath "$xpath" - 2>&0 | sed 's/.*href="\(.*\)"/\1/g'
}
MIRRORS1="(' "
MIRRORS2=${MIRRORS1}$(ubuntu_mirror https | awk -vRS=' ' -vOFS=', ' '$1=$1')
MIRRORS="${MIRRORS2} ')"
The function can also find
http
orftp
URLs.
from apt-fast.
I've got a Bash function to extract URLs of up-to-date Ubuntu mirrors below.
function ubuntu-mirror { PROTOCOL="$1" str='s/.*href="\(' str+=$PROTOCOL str+=':\/\/.*\)"/\1/p' wget -qO- https://launchpad.net/ubuntu/+archivemirrors | xmllint --html --xpath '//table/tbody/tr[td/span[@class="distromirrorstatusUP"]]/td/a[not(starts-with(@href, "/"))]/@href' - 2>&0 | sed -n $str }* Use either `http`, `https`, `ftp` or `rsync`.
MIRRORS="( '" MIRRORS+="ubuntu-mirror https | awk -vRS='' -vOFS=', ' '$1=$1'" MIRRORS+="' )"
How do you use this function after adding it to .profile?
from apt-fast.
How do you use this function after adding it to .profile?
Sorry, forgot to fix it.
I'm still unsure to keep it as is or make it not as a function which I've tried and seems faster.
from apt-fast.
MIRRORS="( '" MIRRORS+=$(ubuntu-mirror https | awk -vRS='' -vOFS=', ' '$1=$1') MIRRORS+="' )"
So this part also goes into .profile?
from apt-fast.
So this part also goes into .profile?
Actually, both parts.
from apt-fast.
So this part also goes into .profile?
Actually, both parts.
Then we export MIRRORS(?):
export MIRRORS
from apt-fast.
Then we export MIRRORS(?):
export MIRRORS
I now don't think that's needed.
You can use it if it works for you.
from apt-fast.
Related Issues (20)
- Display current and overall speed of package downloads HOT 3
- FIX #minor `aptitude show` & `apt show` should not sudo HOT 1
- FIX #minor apt-fast `show` should not be blocked by lock file: apt-fast already running! HOT 1
- FIX #minor apt-fast `search` should not be blocked by lock file: apt-fast already running! HOT 1
- Download size HOT 1
- Couldn't find supported checksum algorithm from aria2c HOT 4
- PPA Not Working Ubuntu 22.04 HOT 8
- title redacted HOT 1
- [redactet title] HOT 1
- Support Kinetic Kudu (22.10) in Launchpad PPA HOT 1
- _
- Blib
- Link to www.mattparnell.com in About section is dead
- Deprecated apt-key HOT 1
- Bionic Beaver has ended extended support HOT 1
- Authorization failure with Ubuntu ESM repositories using apt-fast
- Do not need authentication when the operation does not need authentication HOT 1
- weak algorithm warning HOT 3
- bash completion does not work: apt-get rename?
- Using PPA repository for Ubuntu Jammy (22.04.x) causes installation on Debian Bullseye (11.x) to fail HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apt-fast.