I have an ubuntu mirror set up and ready to be transferred by hard drive to an offline machine. I want to verify that the mirror has all the packages I need and add any missing packages to it. The mirror is located in
/var/spool/apt-mirror
, is 120 GB in size and has hundreds of .deb files in it. How do I do these two tasks?
(1) To check for a package to be present, I assume I have to use dpkg
and point it somehow to my mirror and ask it whether my package in somewhere in the mirror. How do I do that? This is what I tried unsuccessfully:
dpkg --info /var/spool/apt-mirror/ astyle
dpkg-deb: error: error reading archive magic version number from file /var/spool/apt-mirror/: Is a directory
Maybe I should be using the apt-cache
command somehow?
(2) Assuming that the package is missing, how do I get it into the mirror? Do I just find a deb file(s) and copy them wherever I want into the mirror "pool"? For example, lets say I want this package:
apt-cache showpkg astyle
Package: astyle
Versions:
2.01-1 (/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_universe_binary-amd64_Packages)
This package is apparently available in my local cache (but not installed on my staging machine). How would I move it into the mirror?
Asked by Tyler Durden
(6193 rep)
Mar 25, 2016, 03:27 PM
Last activity: May 25, 2016, 08:10 PM
Last activity: May 25, 2016, 08:10 PM