When using apt-get
to install or upgrade a package, a copy of that package (the .deb file) will be saved in: /var/cache/apt/archives
but when using apt
command it's just download and installs the requested package and nothing will be saved in /var/cache/apt/archives
.
Is it the default behavior of apt
command?
Is there any switch/config to makes apt
cache the deb files? (to have a backup of deb files)
I'm running: ubuntu 16.04.2 LTS - With all updates.
What you've reported could be a consequence of a bug filed way back in 2002, apt: apt-get clean should run weekly
This was reported fixed in 2016.
However, the code suggested to prevent the automatic removal of .debs after successful installation of the package needed further work as a result of another bug, New option in apt "APT::Keep-Downloaded-Packages" is ignored.
Those interested may read the bugs and also
/usr/share/doc/apt/NEWS.Debian.gz
on your system (which can be opened by right-clicking and choosing "Open with gedit").On my fully updated 16.04 LTS,
apt policy
has:and
/usr/share/doc/apt/NEWS.Debian.gz
has:It maybe worth noting that
apt
is still evolving vis-à-visapt-get
and that users going this route should keep checking to see if code used in previous versions still works in the future.