Home > Debian, Experiments > Setting up a Debian repo in LAN

Setting up a Debian repo in LAN

It was really a nice experience going to MES College Of Engineering, Kuttippuram last week to attend Debian Mini Conf 2011. Met friends, made new friendships and learned many new things from there. Thanks to Jishnu ettan, for giving me a 50GB Debian repo that contains all the packages of squeeze of both i686 and amd64 architectures. Today, I will explain how to set up a Debian repo (squeeze) so that it be can shared over LAN.

First, run terminal and switch to root user.


If you have the repo as an ISO image file, we need to mount it to a directory. The following command does that:

#mount <path-to-iso> <path-to-mount> -o loop

Edit /etc/apt/source.lst and add the repo we mounted. Append the following line to the file:

deb file:///<mounted-path> squeeze main

Update the package list:

#apt-get update

We are going to share the files using http, hence we need a webserver. To install apache:

#apt-get install apache2

Make a symbolic link of <mounted-path> in /var/www

#ln -s /var/www/repo <mounted-path>

Done! Now add this machine as a repository in other Debian systems in LAN, edit /etc/apt/source.lst to:

deb http://<ip-of-server>/repo squeeze main

The same can be done using a FTP server. All you have to do is to make the symbolic link in FTP’s configured path and use ftp:// instead of http:// in /etc/apt/source.lst. Thank you 🙂

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: