How to recreate /etc/cron.daily/apt?

Solution 1:

first find which package contains the missing file:

$ dpkg --search /etc/cron.daily/apt
apt: /etc/cron.daily/apt

which is that case is the package "apt", and then re-install it:

$ sudo apt-get -o Dpkg::Options::="--force-confmiss" --reinstall install apt

edit: added the option to force the miss conf

Solution 2:

You should extract the apt deb package in a temp location and then copy the missing file to where it should be. For instance if your apt cache still contains the deb package apt you can do:

cd /tmp
dpkg -x /var/cache/apt/archives/apt_0.9.7.9+deb7u1_amd64.deb .
cp /tmp/etc/cron.daily/apt /etc/cron.daily/

If you don't have the deb file in your cache anymore, just download it and apply the same procedure.