How To Clear Pip Cache On Linux

How To Clear Pip Cache

Before starting our tutorial, let’s have a quick look into the definition of the Pip if you don’t know about it. PIP is a package manager for Python packages. So, now you got to know about Pip then you should know about the work it does for you. Pip in Python allows you to install  additional packages that are not part of the Python standard library.

How To Clear Pip Cache On Linux

Run the following command to know the Pip cache size in your Linux operating system.

pip cache info

If you want to see the size of the individual packages that you have installed through Pip then run the following command:

pip cache list

So, you are curious and wants more details details like directory then run the following command to know where the cache resides:

pip cache dir

Run the following command to remove a specific package from the cache by appending the package name:

pip cache remove [packagenametoremove]

Run the following command if you want to remove all the packages at once from the cache:

pip cache remove *

Run the following command to use the purge with the pip cache:

pip cache purge

How to remove the pip cache manually in Linux

Run the following command to remove pip cache manually in Linux

sudo rm -r ~/.cache/pip
sudo rm -rf /root/.cache/pip

Leave a Comment