Skip to content

Instantly share code, notes, and snippets.

@stephanlachnit
Last active May 21, 2023 11:05
Show Gist options
  • Save stephanlachnit/55e5b549e222c925a8899c8b0e1a5242 to your computer and use it in GitHub Desktop.
Save stephanlachnit/55e5b549e222c925a8899c8b0e1a5242 to your computer and use it in GitHub Desktop.
Clean apt-cacher-ng cache
#!/bin/sh
# Cleans apt-cacher-ng cache
# SPDX-FileCopyrightText: 2022 Stephan Lachnit <stephanlachnit@debian.org>
# SPDX-License-Identifier: 0BSD
systemctl stop apt-cacher-ng
rm -rf /var/lib/apt/*
rm -rf /var/cache/apt/*
rm -rf /var/cache/apt-cacher-ng/
mkdir -p /var/cache/apt-cacher-ng/{headers,import,packages,private,temp}
chown apt-cacher-ng:apt-cacher-ng -R /var/cache/apt-cacher-ng
systemctl start apt-cacher-ng
systemctl status apt-cacher-ng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment