APT /etc/apt/apt.conf.d/01autoremove

Original 📋 Debian 13 (Trixie) 32 lines

Works On

Viewing:
Debian 13 (Trixie)
Same on:
Debian 12 (Bookworm) Ubuntu 24.04 LTS (Noble Numbat)
Other versions:

Details

Size
32 lines
MD5
879455db9b938ce287b23383629aedce
SHA256
35b4360d9126e5e5efc1ce42cea8a957ba42921de749ad8502922d536c9f385c
/etc/apt/apt.conf.d/01autoremove
APT
{
  NeverAutoRemove
  {
	"^firmware-linux.*";
	"^linux-firmware$";
	"^linux-image-[a-z0-9]*$";
	"^linux-image-[a-z0-9]*-[a-z0-9]*$";
  };

  VersionedKernelPackages
  {
	# kernels
	"linux-.*";
	"kfreebsd-.*";
	"gnumach-.*";
	# (out-of-tree) modules
	".*-modules";
	".*-kernel";
  };

  Never-MarkAuto-Sections
  {
	"metapackages";
	"tasks";
  };

  Move-Autobit-Sections
  {
	"oldlibs";
  };
};

Copy & Paste

curl:
curl https://exampleconfig.com/api/v1/config/original/879455db9b938ce287b23383629aedce?hint=01autoremove
wget:
wget -O 01autoremove https://exampleconfig.com/api/v1/config/original/879455db9b938ce287b23383629aedce?hint=01autoremove

For AI Agents

<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/879455db9b938ce287b23383629aedce?hint=01autoremove' /><config><app>APT</app><os>Debian 13 (Trixie)</os><location>/etc/apt/apt.conf.d/01autoremove</location><lines>32</lines><md5>879455db9b938ce287b23383629aedce</md5><sha256>35b4360d9126e5e5efc1ce42cea8a957ba42921de749ad8502922d536c9f385c</sha256></config></prompt>

Paste into Claude, ChatGPT, or any AI assistant.

Install APT

Debian

sudo apt update && sudo apt install apt

Ubuntu

sudo apt update && sudo apt install apt

File Location

File Path
/etc/apt/apt.conf.d/01autoremove
Directory
/etc/apt/apt.conf.d/
Significance
System-wide configuration directory
Description
Files in /etc/ contain system-wide configuration settings that affect all users.

FAQ

When should I use this 01autoremove?

Use it to restore a missing default, confirm what shipped, or diff against your current APT config.

How do I restore APT defaults?

Download the file, back up the current one in /etc/apt/apt.conf.d/01autoremove, replace it, then reload or restart APT.

Is 01autoremove safe for production?

It is the vendor default for Debian 13 (Trixie). Treat it as a baseline and review security and performance settings before production use.

How does this differ from other OS versions?

Defaults vary by distro and version. This copy matches Debian 13 (Trixie).

Can I use this for APT troubleshooting?

Yes. Diff it against yours to find drift, then restore only the sections you need.