I would like to build my own local repository on my LAN, so that machines on the LAN can update and upgrade from it. I want to download the packages and store them on my local server so that I can update, upgrade, install, etc, from it without using the internet.
There are 4 steps to setting up a simple repository for yourself
Type in a terminal
Create a directory where you will keep your packages. For this example, we'll use
Now move your packages into the directory you've just created.
Previously downloaded Packages are generally stored on your system in the
The Script update-mydebs
It's a simple three liner:
Cut and paste the above into gedit, and save it as update-mydebs in ~/bin. (the tilde '~' means your home directory. If ~/bin does not exist, create it: Ubuntu will put that directory in your PATH. It's a good place to put personal scripts). Next, make the script executable:
dpkg-scanpackages looks at all the packages in mydebs, and the output is compressed and written to a file (Packages.gz) that apt-get update can read (see below for a reference that explains this in excruciating detail). /dev/null is an empty file; it is a substitute for an override file which holds some additional information about the packages, which in this case is not really needed. See deb-override(5) if you want to know about it.
add the line
to your /etc/apt/sources.list, and you're done.
You can burn the directory containing the debs to a CD and use that as a repository as well (good for sharing between computers). To use the CD as a repository, simply run
Using the Repository
Whenever you put a new deb in the mydebs directory, run
Now your local packages can be manipulated with Synaptic, aptitude and the apt commands: apt-get, apt-cache, etc. When you attempt to apt-get install, any dependencies will be resolved for you, as long as they can be met.
Badly made packages will probably fail, but you won't have endured dpkg hell.
*To make an offline Repository Over LAN *
By default, Debian's Apache package will set up a website under
I used the actual hostname of my system instead of localhost -- this way the code is the same for all of the computers on my LAN, but localhost will do just fine if you are running just one computer.
You can also setup local source server by nginx and reprepro:
Reference to Install Guide Link
You might want to take a look at
Here is a guide on how to install and use it.
To make an offline local Repository
1Source:Create an Ubuntu Repository
I have done using apt-mirror.
Its good but you need to have more hard drive space as it will be syncing with repos server.