HomeLinuxLearn how to Disable APT Cache in Debian

Learn how to Disable APT Cache in Debian


Within the Debian system, the packages are usually put in by way of the apt package deal supervisor, which installs the packages from the official Debian repository. The packages put in by way of apt are moved to the cache listing and are managed inside the situation ‘/var/cache/apt/archives’. The rationale to place these recordsdata within the cached listing is to make sure that the subsequent time you put in a dependent package deal of an present package deal, it gained’t set up the identical package deal once more; as a substitute, it is going to choose up the package deal from this location. As time passes, the package deal loses its worthiness and the time will come when it gained’t require any extra on the system. Thus, it’s a good observe to disable the apt cache on the Debian system, as it will assist release some house.

Comply with this text’s detailed tips to disable apt cache in Debian.

Learn how to Disable APT Cache in Debian

A simple step-by-step instruction to disable apt cache in Debian is given under:

Step 1: First, it’s essential to create a 00clean-cache-dir file on the Debian system by way of nano editor:

sudo nano /and so forth/apt/apt.conf.d/00clean-cache-dir

Step 2: Throughout the file, it’s essential to add the next line:

DPkg::Submit-Invoke ;

Step 3: Then save the clear cache file utilizing “CTRL+X”, add “Y” and enter to exit.

Step 4: Then it’s a must to create one other file with “00disbale-cache-files” identify:

sudo nano 00disable-cache-files

Step 5: Inside this file, add the next strains:

Dir::Cache::srcpkgcache “”;

Dir::Cache::pkgcache “”;

Step 6: Save this file utilizing Step 3.

It will disable the apt cache on the Debian system.

Step 7: Now the apt cache is disabled now, it’s higher to empty the ‘/var/cache/apt/archives’ listing on Debian utilizing the next command:

sudo rm -rf /var/cache/apt/archives

Step 8 (Non-obligatory): Alternatively, it’s an excellent observe in the event you run the next command to delete the cache:

Step 9 (Non-obligatory): Additional you can too take away the cache recordsdata and directories by way of the next command:

Step 10 (Non-obligatory): Let’s clear the system by eradicating the cache file and directories utilizing the next command.

Conclusion

The apt cache on Debian might be disabled simply by making a clear cache file contained in the /and so forth/apt/apt.conf.d/ location. Then create one other file with disable cache within the residence location. Save each these recordsdata to disable the apt cache on Debian. It’s higher to take away cache recordsdata and directories by way of “rm -rf” command or some apt instructions which might be optionally available however good observe in the event you run them on the terminal.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments