0% found this document useful (0 votes)
34 views

LocalRepoUseConfig 2 PDF

This document provides instructions for configuring the apt package manager on Ubuntu-based systems to use a local Linux repository mirror for faster package installation and updates. It involves making a backup copy of the sources.list file, editing it to replace the default Ubuntu archive URL with the local mirror URL, and updating package indexes to start using the local repository. Certain "universe" packages will still be downloaded from the official archive to avoid issues.

Uploaded by

Hari Vallabha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

LocalRepoUseConfig 2 PDF

This document provides instructions for configuring the apt package manager on Ubuntu-based systems to use a local Linux repository mirror for faster package installation and updates. It involves making a backup copy of the sources.list file, editing it to replace the default Ubuntu archive URL with the local mirror URL, and updating package indexes to start using the local repository. Certain "universe" packages will still be downloaded from the official archive to avoid issues.

Uploaded by

Hari Vallabha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

apt Configuration to Use Local Linux Repository (Ubuntu Mirror)

Have you ever been in a situation trying to update your ubuntu or trying to install some package from
the ubuntu repository and it takes a lot of time, of course due to bad internet connection. From now on
it wont take that much time, You can update and install packages with speed more than 5MB/s. We
have a local repository for Ubuntu, and yes it works for Ubuntu derived distros like Linux Mint,
Elementary OS, Kali Linux etc (the derived distros should be derived from Ubuntu 14.x or 16.x as local
repository supports only LTS 14 and 16). You can configure your package manager (apt) to use the
local repository:

1. Firstly to be safe, copy the sources.list file (stores information about the repositories the package
manager i.e. apt uses), execute the following command to copy it to your home directory.
cp /etc/apt/sources.list ~/

2. Now open /etc/apt/sources.list file with root access.


sudo gedit /etc/apt/sources.list

3. Now you will find something like


deb http://in.archive.ubuntu.com/ubuntu/ xenial multiverse

4. To use the local repository replace http://in.archive.ubuntu.com/ubuntu/ with


http://172.16.3.168:8090/repos/Ubuntu/ .

5. Ubuntu has categorized its packages into four - main, multiverse, universe, and restricted of
which we are (as of now) not providing support for universe packages. So, if you encounter a line
which is of the format deb mirror_url distro_version_name universe, dont replace mirror_url
with http://172.16.3.168:8090/repos/Ubuntu/ .
Examples:
deb http://in.archive.ubuntu.com/ubuntu/ xenial universe
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates universe
deb http://in.archive.ubuntu.com/ubuntu/ xenial-security universe
Leave it as it is.

6. In some cases you may find more than one categories including universe, like
deb http://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
For this case change it to .
deb http://in.archive.ubuntu.com/ubuntu/ xenial-backports universe
deb http://172.16.3.168:8090/repos/Ubuntu/ xenial-backports main restricted multiverse
This way apt downloads universe packages from the official repository, and rest of the packages from
local repository.

7. Now save this file, quit gedit, and enter the following command.
sudo apt-get update

Thats it :)

PS: IN CASE YOU MESS YOUR /etc/apt/sources.list WHILE EDITING, YOU CAN ALWAYS
COPY YOUR BACKED UP FILE FROM HOME FOLDER, using
sudo cp ~/sources.list /etc/apt/sources.list

You might also like