Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
46
rated 0 times [  46] [ 0]  / answers: 1 / hits: 301377  / 2 Years ago, fri, july 15, 2022, 8:03:51

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.


More From » apt

 Answers
5

*To make an offline Repository Over LAN *


Install a Local Apache Webserver



# apt-get install apache2


By default, Debian's Apache package will set up a website under /var/www on your system. For our purposes, that's fine, so there's no reason to do anything more. You can easily test it by pointing your favorite browser at http://localhost You should see the default post-installation web page which is actually stored in /var/www/index.html




Create a Debian Package Repository Directory



chose to create a directory /var/www/debs for this. Under it, you should create "architecture" directories, one for each architecture you need to support. If you're using just one computer (or type of computer), then you'll only need one -- typically "i386" for 32-bit systems or "amd64" for 64 bit. If you are using some other architecture, I'll assume you probably already know about this.
Now just copy the ".deb" package files for a given architecture into the appropriate directories. If you now point your favorite web browser at http://localhost/debs/amd64 (for example) you'll see a listing of the packages for 64 bit systems.




Create a Packages.gz file



Now we need to create a catalog file for APT to use. This is done with a utility called "dpkg-scanpackages". Here's the commands I use to update the AMD64 packages on my LAN:



# cd /var/www/debs/

# dpkg-scanpackages amd64 | gzip -9c > amd64/Packages.gz






Make the repository known to APT



Now the only thing left to do is to let APT know about your repository. You do this by updating your /etc/apt/sources.list file. You'll need an entry like this one:




deb http://localhost/debs/ amd64/




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.

Now, update APT:



# apt-get update

[#36465] Saturday, July 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
whoppinolo

Total Points: 93
Total Questions: 113
Total Answers: 107

Location: Cyprus
Member since Mon, Oct 24, 2022
2 Years ago
whoppinolo questions
Tue, Feb 14, 23, 08:30, 1 Year ago
Wed, Sep 28, 22, 06:56, 2 Years ago
Fri, May 27, 22, 01:55, 2 Years ago
Tue, Oct 12, 21, 09:33, 3 Years ago
;