How to add my own .deb file to my local mirror to use with apt?
Solution 1
If you plan to update your packages in the future, or add new ones, I would strongly recommend not relying on kludges, but instead use the right tools.
So rather than mixing your own packages with a Ubuntu mirror, consider putting together your own little repo to keep things neat and isolated, and also sign your packages for authentication.
This will take a little time to set things up, but will save you a ton of maintenance headaches down the road.
I've found that the best tool for that task is reprepro
.
Some links to get you started:
- https://www.digitalocean.com/community/tutorials/how-to-use-reprepro-for-a-secure-package-repository-on-ubuntu-14-04
- http://kaivanov.blogspot.com.by/2012/08/creating-apt-repository-with-reprepro.html
- https://wiki.debian.org/SettingUpSignedAptRepositoryWithReprepro
Solution 2
Create a directory and place you .deb package within.
Remind yourself of some of the info present in the debian file:
dpkg --info <yourpackage.deb>
Move to your directory and enter sudo dpkg-scanpackages . /dev/null | gzip -c9 > Packages.gz
Add this line to your sources.list
: deb file:///path/to/directory /
- yes, include the whitespace :)
sudo apt-get update
sudo apt-get install <packagename>
Related videos on Youtube
Comments
-
Arronical over 1 year
I've created a full local mirror of the 14.04 repositories using
apt-mirror
and connect to it over LAN usingapache
. I have adapted my sources.list file on the machine that I wish to update from the local mirror.What is the process required to add my own .deb file (mypackage.deb) and make it available through
apt-get install mypackage
? -
Arronical over 8 yearsThen this could be hosted alongside the full local Ubuntu mirror, and wouldn't require much extra apt configuration right?
-
A.P. over 8 yearsYes, that would be a separate repo you would host alongside your other mirror. Not sure what you mean by "extra apt configuration", could you clarify?
-
Arronical over 8 yearsI just meant any further work on each client machine, other than updating the source.list files. I should probably digest those links first though!
-
A.P. over 8 yearsCorrect. You'll just drop a sources file into /etc/apt/sources.list.d with your repo information and you're done.
-
TellMeWhy over 8 years@Arronical re-enter the
dpkg-scanpackages
command when you add a new package -
TellMeWhy over 8 years@Arronical I made a mistake - the
file:///
part shouldn't be to the package itself, but to it's parent directory