Debian based distros beware of apt clearing your cache

These past few days when apt and its coworkers were updated, apt by default deletes cached packages after the installation.  So if you were used to keep the cached pkgs so you can reinstall without redownloading, or sharing your cache with other installations, or using a common cache in a network to save bandwidth, DO NOT USE APT, USE APT-GET.  Either apt upgrade, apt dist-upgrade (which in the past few months had become identical to apt-get dist-upgrade), or apt install, all remove cached packages.  The hunt for a configuration to change the new default did not bare any fruits, or it would have been noted here.  Check this antiX thread.  The chief developer of Anti-X did not know about it either.

Using apt-get instead in all above mentioned combinations keeps downloaded packages in /var/cache/apt/archives like apt used to for years.

If you find any news or links to why and how this was changed please let us all know by commenting below.


Update 1: Oct 16th-2018

I found this in an ubuntu site and it is old.  This indicates that this file existed in my system since installation (about 4 different ones) and must have been removed by an update, otherwise I can’t explain the sudden change.

[ Automatic removal of debs after install ] After packages are successfully installed by apt(8), the corresponding .deb package files will be removed from the /var/cache/apt/archives cache directory.

This can be changed by setting the apt configuration option Binary::apt::APT::Keep-Downloaded-Packages to true. E.g:

# echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' \
> /etc/apt/apt.conf.d/01keep-debs

Please note that the behavior of apt-get is unchanged. The downloaded debs will be kept in the cache directory after they are installed. To enable the behavior for other tools, you can set APT::Keep-Downloaded-Packages to false.

According to this and my past years experience this file (01lkeep-debs) must have been there and was removed, not by me or alerting me of such change.  Unless there is a better explanation, this is the only sense I make out of it.

Classic Debian crap, devs decide to wipe settings and configurations off your installation and then if asked they sarcastically respond by “you should have read release notes before installing”, like anyone does this for 100pkgs a week.


If your comment is considered off-topic a new topic will be created with your comment to continue a different discussion. This community is based on open and free communication, meaning we must all respect all in minimizing the exercise of freedom to disrupt such communication. Feel free to post what you think but keep in mind the subject matter discussed. It is just as easy to start a new topic as it is to dilute the content of an existing discussion.

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.