Difference between revisions of "Reflector"

From ArchWiki
Jump to: navigation, search
m (removed extraneous word from previous edit.)
m (Usage: Removed redundant mention of backing up pacman.d/mirrorlist. Breaking examples out into separate headings Effective Use of Headers. Moved generic usage info up to better fit with new headings. Cleaned up the second warning and integrated.)
Line 16: Line 16:
 
== Usage ==
 
== Usage ==
  
{{Warning|Please back up your {{ic|/etc/pacman.d/mirrorlist}} file first.}}
+
{{Warning|
 +
* Back up the {{ic|/etc/pacman.d/mirrorlist}} file first:
 +
** {{bc|# cp -vf /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup}}
 +
* Make sure /etc/pacman.d/mirrorlist does not contain entries that you consider untrustworthy before syncing or updating with [[Pacman]].}}
  
First back up your {{ic|/etc/pacman.d/mirrorlist}}
+
To see all of the available commands, run the following command:
  # cp -vf /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
+
  # reflector --help
  
 +
=== Examples ===
 +
==== Example 1 ====
 
The following command will filter the first five mirrors, sort them by speed and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}:
 
The following command will filter the first five mirrors, sort them by speed and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}:
 
  # reflector --verbose -l 5 --sort rate --save /etc/pacman.d/mirrorlist
 
  # reflector --verbose -l 5 --sort rate --save /etc/pacman.d/mirrorlist
  
 +
==== Example 2 ====
 
The following command will verbosely rate the 200 most recently synchronized HTTP servers, sort them by download rate, and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}:
 
The following command will verbosely rate the 200 most recently synchronized HTTP servers, sort them by download rate, and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}:
 
  # reflector --verbose -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist
 
  # reflector --verbose -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist
  
 +
==== Example 3 ====
 
This command will verbosely rate the 200 most recently synchronized HTTP servers located in the US, sort them by download rate speed, and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}:
 
This command will verbosely rate the 200 most recently synchronized HTTP servers located in the US, sort them by download rate speed, and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}:
 
  # reflector --verbose --country 'United States' -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist
 
  # reflector --verbose --country 'United States' -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist
 
To see all of the available commands, run the following command:
 
# reflector --help
 
 
{{Warning|Make sure the mirror list does not contain strange entries before syncing or updating with pacman.}}
 

Revision as of 03:24, 16 January 2014

Related articles

Reflector is a script which can retrieve the latest mirror list from the MirrorStatus page, filter the most up-to-date mirrors, sort them by speed and overwrite the file /etc/pacman.d/mirrorlist.

Installation

Install reflector from the official repositories.

Usage

Warning:
  • Back up the /etc/pacman.d/mirrorlist file first:
    • # cp -vf /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
  • Make sure /etc/pacman.d/mirrorlist does not contain entries that you consider untrustworthy before syncing or updating with Pacman.

To see all of the available commands, run the following command:

# reflector --help

Examples

Example 1

The following command will filter the first five mirrors, sort them by speed and overwrite the file /etc/pacman.d/mirrorlist:

# reflector --verbose -l 5 --sort rate --save /etc/pacman.d/mirrorlist

Example 2

The following command will verbosely rate the 200 most recently synchronized HTTP servers, sort them by download rate, and overwrite the file /etc/pacman.d/mirrorlist:

# reflector --verbose -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist

Example 3

This command will verbosely rate the 200 most recently synchronized HTTP servers located in the US, sort them by download rate speed, and overwrite the file /etc/pacman.d/mirrorlist:

# reflector --verbose --country 'United States' -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist