Each DNF and APT — the package deal managers for Crimson Hat and Ubuntu-based Linux distributions — retailer cached data to make sure the software program set up course of is way sooner and extra dependable. With these caches in place, neither package deal supervisor has to obtain the knowledge everytime you try and replace, improve, or set up software program.
However typically, that cache data can turn out to be outdated or corrupted. When that occurs, you may discover that the DNF of APT doesn’t perform correctly.
What do you do? You clear the cache, which can delete all of that data, so you’ve got a clear slate.
How do you clear these caches? Let me present you.
SEE: Debian vs Ubuntu: Which Linux Distro Matches Your Wants Finest? (roosho)
Tips on how to clear the cache for the DNF package deal supervisor
One of the simplest ways to scrub the DNF cache is by working the command:
sudo dnf clear dbcache
It will take away all cache information generated from the repository metadata.
If that doesn’t resolve your issues, you’ll be able to run a whole clear with the command:
sudo dnf clear all
SEE: Prime Instructions Linux Admins Have to Know (roosho Premium)
Tips on how to clear the cache for the APT package deal supervisor
With the APT package deal supervisor, you’ll be able to problem the command:
sudo apt-get clear
It will take away the content material from /var/cache/apt/archives (aside from the lock file).
One other APT possibility is to run:
sudo apt-get autoclean
This solely removes the packages that can’t be downloaded from repositories. In different phrases, should you downloaded a .deb package deal and put in it (versus putting in it from a distant repository), any file related to that package deal will stay.
And that’s all there may be to cleansing the package deal supervisor caches for each Crimson Hat and Ubuntu-based distributions. You most likely received’t have to make use of these instruments, however should you do, you know the way.
This text was initially revealed in June 2021. It was up to date by Antony Peyton in January 2025.
No Comment! Be the first one.