I used following method to install packages by local-repository
mkdir /var/my-lcaol-repo
and put all debs inside this folder- Create
/etc/apt/sources.list.d/my-local.list
withdeb file:/var/my-local-repo/ ./
andsudo apt-get update
- Install package(s) by
sudo apt-get install [package]
All working fine but there is one problem:
If package which I'm tiring to install from local-repository (i.e /var/my-local-repo
) is available from Repository that enabled (example: main or universe) then apt first tries to download packages from online repository and at that time I am not connected to internet , it fails to download archives and stops.
Temporary solution: Disable repository (ex- main or universe) then apt installs package from off-line repository. But I don't want to disable online repository.
Possible solution: Give first priority to off-line repository. How to?
Note: same package version (which is available on main/universe repo) is available in offline-repository