downloaded packages are removed just after installation

Bug #1970110 reported by Jérôme Bouat
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Opinion
Undecided
Unassigned

Bug Description

When installing a package with 'apt install [package name]', I see the deb files which appear in /var/cache/apt/archives.
However, just after installation, the deb file are deleted from this directory.
I would prefer a deletion after a few days. Sometimes, we install/uninstall and reinstall.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: apt 2.4.5
ProcVersionSignature: Ubuntu 5.15.0-25.25-generic 5.15.30
Uname: Linux 5.15.0-25-generic x86_64
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: XFCE
Date: Sun Apr 24 16:10:48 2022
InstallationDate: Installed on 2022-04-24 (0 days ago)
InstallationMedia: Xubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jérôme Bouat (jeromebouat) wrote :
Revision history for this message
David Kalnischkies (donkult) wrote :

apt 1.2~exp1 came with the follow NEWS entry:
  [ 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.

If you have disabled this feature you can do manual maintenance with the `autoclean` and `clean` commands. More automatic maintenance can be achieved with our cronjob, see `/usr/lib/apt/apt.systemd.daily`for details, which can e.g. be configured to remove files after a few days as you seem to prefer here.

As this default behavior is a deliberate choice and there are various options to change this I am closing this report as not a bug.

Changed in apt (Ubuntu):
status: New → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.