How to create local repository in the zone

Sometimes it is usefully to have your own local repository. It is safe a lot of time because we can use

apt install <package_name> instead of dpkg -i <package_name>.deb .

To create empty simple repository use following (it is possible to add this into the script and run it):

mkdir -p REPO/conf echo 'Origin: Debian Suite: unstable Codename: unstable Version: 1.0 Architectures: solaris-i386 Components: main Description: local repository' >> REPO/conf/distributions cd REPO reprepro export reprepro createsymlinks

Now we can add some *.deb to the repository by commands:

reprepro -b /path/to/REPO> -C main includedeb unstable /path/to/*.deb reprepro export reprepro createsymlinks

To use use this repository we should add it into the /etc/apt/source.list:

echo “deb file:///path/to/REPO unstable main “ >> /etc/apt/source.list apt-get update

Now we cat use apt install <package_name>.