Close Menu
    Facebook X (Twitter) Instagram
    • Articles
    • How it Works
    • Our Story
    • Contact Us
    Facebook X (Twitter) Instagram Pinterest Vimeo
    IT Beginner
    • Home
    • Blog
      • Happiness
      • Productivity
      • Leadership
    • About us
    • Contact us
    IT Beginner
    Software

    How to update and upgrade with fastest mirror from the command line

    18/07/2017Updated:20/07/2017No Comments3 Mins Read

    If you want to update and upgrade your sources.list file with the fastest servers from the command line in a fresh Ubuntu Server install, it’s quite easy with the GUI, but it doesn’t seem to be a simple way to do it from from the command line. You can us deb mirror to have the best mirror picked for you automatically.

    apt-get now supports a ‘mirror’ method that will automatically select a fastest mirror based on your location.

    Edit sources.list file

    # nano /etc/apt/sources.list

    Put these codes on the top of the file, it will automatically pick a fastest mirror for you based on your geographical location.
    Replace precise with the appropriate name Lucid (10.04), Maverick (10.10), Natty (11.04), Oneiric (11.10), Precise (12.04), Quantal (12.10), and Raring (13.04).

    deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
    deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
    deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
    deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse

    Or you can use netselect-apt program, to install it

    # apt-get install netselect-apt

    Output

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    The following extra packages will be installed:
    curl libcurl3 librtmp0 libssh2-1 netselect
    Suggested packages:
    dpkg-dev
    The following NEW packages will be installed:
    curl libcurl3 librtmp0 libssh2-1 netselect netselect-apt
    0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
    Need to get 852 kB of archives.
    After this operation, 1542 kB of additional disk space will be used.
    Do you want to continue [Y/n]? y

    To run netselect-apt

    # netselect-apt

    In my case, one of my vps is located at Arizona

    The fastest 10 servers seem to be:

    http://debian.securedservers.com/debian/

    http://debian.mirrors.easynews.com/linux/debian/

    http://mirrors.usc.edu/pub/linux/distributions/debian/

    http://mirror.hmc.edu/debian/

    http://mirror.picosecond.org/debian/

    http://mirrors.kernel.org/debian/

    http://mirrors.kernel.org/debian/

    http://ftp.keystealth.org/debian/

    http://ftp.nz.debian.org/debian/

    http://debian.osuosl.org/debian/

    Wait for netselet-apt to run, when its finished you will have a new sources.list in the directory where you executed the command in. You can either move or copy it to your /etc/apt/ directory by executing:

    # mv ./sources.list /etc/apt/sources.list

    or

    # cp ./sources.list /etc/apt/sources.list

    After having a new sources.list file you will need to run update command

    # apt-get update

    netselect-apt options

    stable|testing|unstable|experimental|woody|sarge|etch|sid Specify which distribution of Debian to use. By default stable is used.

    -s, –sources
    While generating OUTFILE include also deb-src lines to use with ‘‘apt-get source’’ to obtain Debian source packages.

    -i, –infile INFILE
    Use INFILE instead of mirrors_full for reading mirror list. The file must be in the same format as mirrors_full.

    -o, –outfile OUTFILE
    Use OUTFILE instead of sources.list.

    -n, –nonfree
    Include also non-free section while generating OUTFILE.

    -f, –ftp
    Use FTP mirrors instead of HTTP and generate OUTFILE accordingly.

    mirror netselect-apt sources.list
    Previous ArticleHow to install nginx by compiling source
    Next Article How to install mod_rewrite on Ubuntu

    Related Posts

    Software

    Cisco Packet Tracer 9.0.0 Open BETA Download

    02/04/2025
    Tips – Tricks

    How to fix nginx an upstream response is buffered to a temporary file error

    05/08/2017
    Tips – Tricks

    Optimize WordPress with Nginx

    04/08/2017
    Subscribe
    Notify of
    guest

    guest

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    0 Comments
    Oldest
    Newest Most Voted
    Inline Feedbacks
    View all comments
    • Productivity
    • Leadership

    No posts

    No posts

    Subscribe to Newsletter
    Our Socials
    • Instagram
    • Facebook
    • Twitter
    • YouTube
    • LinkedIn

    Archives

    • April 2025
    • May 2024
    • March 2023
    • July 2022
    • March 2022
    • July 2020
    • January 2019
    • August 2018
    • July 2018
    • August 2017
    • July 2017
    • September 2016

    Categories

    • Business
    • CCNA 1 Instructor Materials
    • CentOS
    • Database
    • Debian
    • Fedora
    • Firefox
    • Happiness
    • Hardware
    • ICND1 Labs
    • ICND2 Labs
    • Leadership
    • Linux Essentials
    • Linux Mint
    • Marketing
    • My SQL
    • Netflix
    • Networking
    • Productivity
    • Resources
    • Security
    • SEO
    • Server
    • Social Media
    • Software
    • Tips – Tricks
    • Ubuntu
    • Uncategorized
    • User Experience
    • WordPress
    • Xubuntu

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna accumsan in scelerisque.

    Facebook X (Twitter) Instagram Pinterest

    Type above and press Enter to search. Press Esc to cancel.

    wpDiscuz