Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Server side configuration :

there is many method to create local repository . here i am using apache2.

sudo apt-get install apache2
sudo apt-get install apt-mirror

create any directory

sudo mkdir /repo

Now, open the file /etc/apt/mirror.list file using command

sudo vi /etc/apt/mirror.list

add

set base_path /repo

and

 deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/kilo main

remove other repository . final /etc/apt/mirror.list will look like:

    ############# config ##################
    #
    # set base_path    /var/spool/apt-mirror
     set base_path /repo
    # set mirror_path  $base_path/mirror
    # set skel_path    $base_path/skel
    # set var_path     $base_path/var
    # set cleanscript $var_path/clean.sh
    # set defaultarch  <running host architecture>
    # set postmirror_script $var_path/postmirror.sh
    # set run_postmirror 0
    set nthreads     20
    set _tilde 0
    #
    ############# end config ##############
 deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/kilo main

then run command:

sudo apt-mirror

it will download all packages to /repo directory. after download completion go to /var/www/html/ and create symbolic link here :

sudo ln -s /repo/mirror/ubuntu-cloud.archive.canonical.com/ubuntu  ubuntu

client side configuration :

open /etc/apt/sources.list

sudo vi /etc/apt/sources.list

add line

deb http://yoursystemIP/ubuntu trusty-updates/kilo main

save it and update

sudo apt-get update

now enjoy local repository

sudo apt-get install PackageName

Note: check your symbolic link is correct.