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

Original 📋 Ubuntu 20.04 LTS (Focal Fossa) 41 lines

Works On

Viewing:
Ubuntu 20.04 LTS (Focal Fossa)
Same on:
Debian 11 (Bullseye) Ubuntu 22.04 LTS (Jammy Jellyfish)
Other versions:

Details

Size
41 lines
MD5
ab6540f7278a05a4b7f9e58afcaa5f46
SHA256
93e7e6d2fdb36b04cb10127e3b0d1b9d19d822327fd959484639bbbd65cce004
/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";
	"contrib/metapackages";
	"non-free/metapackages";
	"restricted/metapackages";
	"universe/metapackages";
	"multiverse/metapackages";
  };

  Move-Autobit-Sections
  {
	"oldlibs";
	"contrib/oldlibs";
	"non-free/oldlibs";
	"restricted/oldlibs";
	"universe/oldlibs";
	"multiverse/oldlibs";
  };
};

Copy & Paste

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

For AI Agents

<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/ab6540f7278a05a4b7f9e58afcaa5f46?hint=01autoremove' /><config><app>APT</app><os>Ubuntu 20.04 LTS (Focal Fossa)</os><location>/etc/apt/apt.conf.d/01autoremove</location><lines>41</lines><md5>ab6540f7278a05a4b7f9e58afcaa5f46</md5><sha256>93e7e6d2fdb36b04cb10127e3b0d1b9d19d822327fd959484639bbbd65cce004</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 Ubuntu 20.04 LTS (Focal Fossa). 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 Ubuntu 20.04 LTS (Focal Fossa).

Can I use this for APT troubleshooting?

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