Thursday, 4 November 2021

Configure local repository on Ubuntu

 

Configure local repository on Ubuntu

Prerequisites:

·        Install Apache2
·        Install apt-utils
·        Install dpkg-dev

Server-side configuration:

1.       Download required packages in one machine.

2.       Create a directory in /var/www/ as below,

            Now move to the binary directory,

4.       Move your downloaded packages to this directory.

5.       Create a file named Packages which apt-get can read using the following command,      

# apt-ftparchive packages > Packages

6.       Now create a zip file of that Packages file created above using below command,

# gzip -c Packages > Packages.gz

Client-side configuration :

1.       Change the internet configurations with no internet.

2.       Edit the /etc/apt/sources.list file as shown below,

deb http://yourIP/localrepo/pkg/binary /

And hash all other lines. Save and exit.

3.       Issue apt-get update the changes you made in sources.list will be updated and you will get a message like below,

Reading packages lists….. Done.

4.       Once successfully verifying the sources you can start installing any package available from your local repository using apt-get.

# apt-get install package_name

Note : you will get a warning like package is not authenticated just continue with yes and the package will be downloaded.

No comments:

Post a Comment