How to fix E: Lists directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied) in APT

APTINTERMEDIATEMEDIUMUpdated Dec 29, 2025ยท 363 views

This error occurs when apt lacks permission to access or create the /var/lib/apt/lists/partial directory, commonly in Docker containers or when running apt as a non-root user. The fix involves recreating the directory structure and updating the package cache with proper permissions.

Quick fix

Fixes E: Lists directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)

whoami
  1. Check your current permissions
  2. Remove corrupted apt lists
  3. Recreate the lists structure
  4. Rebuild the package cache
apt โ€” error
whoami
E: Lists directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)

What this error means

The apt package manager stores metadata about available packages in /var/lib/apt/lists. The partial subdirectory is used as a temporary staging area during downloads. When apt cannot create or access this directory due to insufficient permissions (error code 13), it fails to update the package cache. This typically happens because the command is running with insufficient privileges or in a restricted environment like Docker containers where the filesystem permissions are not properly configured.

Typical symptoms

  • apt update or apt-get update commands fail immediately with permission denied error
  • Unable to install new packages because the package index cannot be refreshed
  • In Docker, apt-get fails during the RUN instruction after switching to a non-root user
  • Error message specifically mentions /var/lib/apt/lists/partial directory is missing

Common causes

  1. Running apt commands without root privileges (sudo)
  2. In Docker containers, switching to a non-root user before running apt-get
  3. Corrupted or deleted /var/lib/apt/lists directory from previous failed operations
  4. File system permissions on /var/lib/apt directory are incorrectly set
  5. The /var/lib/apt/lists directory was manually deleted but the partial subdirectory was not recreated

How to fix "E: Lists directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)"

1Check your current permissions

First, verify whether you are running the command with proper privileges:

bash
whoami

If the output is not "root" and you are on a standard Linux system (not in a container), you need to use sudo with apt commands.

2Remove corrupted apt lists

Delete all files in the /var/lib/apt/lists directory to clear any corrupted package metadata:

bash
sudo rm -rf /var/lib/apt/lists/*

This command removes all cached package information, which will be rebuilt in the next step.

3Recreate the lists structure

Create the necessary directory structure with proper permissions:

bash
sudo mkdir -p /var/lib/apt/lists/partial

The -p flag ensures parent directories are created if they do not exist.

4Rebuild the package cache

Clean the apt cache and rebuild it by running update:

bash
sudo apt-get clean
sudo apt-get update

The clean command removes unnecessary files, and update rebuilds the package index from configured repositories.

5For Docker containers, run apt before USER switching

If you are building a Docker image, ensure all apt operations occur before switching to a non-root user:

dockerfile
FROM ubuntu:22.04

# Run apt operations as root
RUN apt-get update && apt-get install -y curl wget

# Switch to non-root user after apt operations
RUN useradd -m appuser
USER appuser

The key is to keep apt-get update and apt-get install commands before the USER instruction.

Advanced notes

In Debian and newer Ubuntu releases, the apt package manager uses a dedicated "_apt" user for sandboxed downloads. If you see warnings about "_apt" user not being able to access files, you can fix ownership with: sudo chown -R _apt:root /var/lib/apt/lists/partial. Additionally, if using Docker, be aware that the package lists are large and rebuilding them on every container restart can slow down image builds. Consider using a multi-stage build or caching the apt-get update in your Docker layer.

Frequently asked questions

What does "E: Lists directory /var/lib/apt/lists/partial is missing. - Acquire (1" mean?
The apt package manager stores metadata about available packages in /var/lib/apt/lists. The partial subdirectory is used as a temporary staging area during downloads. When apt cannot create or access this directory due to insufficient permissions (error code 13), it fails to update the package cache.
How do I fix "E: Lists directory /var/lib/apt/lists/partial is missing. - Acquire (1"?
This error occurs when apt lacks permission to access or create the /var/lib/apt/lists/partial directory, commonly in Docker containers or when running apt as a non-root user. The fix involves recreating the directory structure and updating the package cache with proper permissions.
What causes "E: Lists directory /var/lib/apt/lists/partial is missing. - Acquire (1"?
Running apt commands without root privileges (sudo) In Docker containers, switching to a non-root user before running apt-get Corrupted or deleted /var/lib/apt/lists directory from previous failed operations
Is the "E: Lists directory /var/lib/apt/lists/partial is missing. - Acquire (1" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading