Close Menu
    Facebook X (Twitter) Instagram
    • Download Cisco Packet Tracer
    Facebook X (Twitter) Instagram Pinterest Vimeo
    IT Beginner
    • Home
    • Server
    • WordPress
    IT Beginner
    Home»Software»How to update and upgrade with fastest mirror from the command line
    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
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleHow to install nginx by compiling source
    Next Article How to install mod_rewrite on Ubuntu

    Related Posts

    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
    Security

    How to secure Apache HTTP Web Server

    29/07/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
    Tags
    apache centos Centos 6 cuda Desktop Environment dual boot environment featured gnome GUI hostname hosts intel kernel kill lamp server lemp server life MariaDB netflix nginx nvidia password php-fpm phpmyadmin pids processes s.m.a.r.t Security session solid state drive ssd ssh ssh server tag 1 tag 2 Ubuntu upgrade varnish VirtualBox VNC Server web server window manager wordpress xfce
    Facebook X (Twitter) Instagram Pinterest

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

    wpDiscuz