Home > Uncategorized > Local Repository Ubuntu/Debian

Local Repository Ubuntu/Debian

Sometimes we dont want download all needed packages from web and installing each deb file and all dependencies disturb us.
We need a apt-get repository locally in example on USB disk, i show how make it.
first we need dpkg-dev package:

sudo apt-get install dpkg-dev

next we need a folder in example /home/user/REPO
and all debs file we need put to that folder.

cp /var/cache/apt/archives/*.deb /home/user/REPO/

or move it:

sudo mv  /var/cache/apt/archives/*.deb /home/user/REPO/

Now we need to build an index of all packages (Packages.gz)

cd /home/user/

sudo dpkg-scanpackages REPO /dev/null | gzip > REPO/Packages.gz

Our repository is ready to add to sources.list
Add below line to begin of /etc/apt/sources.list

deb file:/home/user REPO/

And update a packages by sudo apt-get update

Sometimes apt download files from web instead take it locally.

To avoid this add below lines to /etc/apt/apt.conf (create it probably not exist yet)

APT {
Get {
AllowUnauthenticated “true”;
};
};

Thats should be all. 🙂

Advertisements
Categories: Uncategorized Tags: , , ,
  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: