Sample Header Ad - 728x90

How to run a command before download with apt-get?

8 votes
5 answers
8117 views
How can I run a command before apt-get starts to download a package? I know about the dpkg pre-invoke hook ( https://unix.stackexchange.com/questions/76294/hook-a-script-to-apt-get ), but that seems to be run after the download. $ apt-get update Get: 11 http://security.debian.org/ wheezy/updates/main qemu amd64 1.1.2+dfsg-6a+deb7u7 [115 kB] Fetched 70.9 MB in 10s (6,776 kB/s) refreshing freenet index --2015-05-19 15:55:25-- http://127.0.0.1:8888/freenet:USK@oRy7ltZLJM-w-kcOBdiZS1pAA8P-BxZ3BPiiqkmfk0E,6a1KFG6S-Bwp6E-MplW52iH~Y3La6GigQVQDeMjI6rg,AQACAAE/deb.mempo.org/-42/ What we need is to run a command *before* the download. More exactly: The script must run after calling apt-get but before apt-get accesses any online resource. Is there something like a Pre-Download hook? It is important that the installation can be done without having to replace the script apt-get (and without doing anything else which could be undone by an update).
Asked by Arne Babenhauserheide (239 rep)
May 19, 2015, 08:00 PM
Last activity: Jun 1, 2022, 08:00 AM