Raspberry Pi

How to Completely Remove an Application from Raspberry Pi

The Raspberry Pi device is a single-board computer used for multiple purposes, especially in automation, robotics, web designing and more. One of the significant problems that Raspberry Pi users face is the limited storage capacity of the device, which they need to consider while installing an application or software. The users install many applications or software on the Raspberry Pi system but forget to delete them once they are no longer required. It increases the device’s storage capacity and decreases the system’s performance.

In this article, I will show you how to completely remove the application so that you no longer require it on your system.

Free up Disk Space by Completely Removing Application or Software from Raspberry Pi

Removing the application or software from the Raspberry Pi system can easily be done through the following command:

$ sudo apt remove <application_name>

However, removing through the above command won’t be an effective choice since it doesn’t completely remove the application’ files cache or directories from the system.

Let’s take an example to remove an application from “apt remove” command as shown below:

$ sudo apt remove vlc

When you enter the above command to remove an application like VLC from the Raspberry Pi system, you will see that it frees up only 237kB space on your system. It only removes the application from your Raspberry Pi system leaving behind configuration files and user settings. So, whenever you install this application again, you can use the application with the same configuration.

The same command can be used in another way as shown below:

$ sudo apt purge vlc

It also frees up the 237kB space on your Raspberry Pi system. If you don’t want to remove your configuration files, you can choose any of the above commands to remove an application or software from your system.

However, if you aim to free up the disk space, you can completely remove the application or software from your Raspberry Pi system through the following command:

$ sudo apt --purge autoremove <application_name>

The above command removes the application, configuration files and dependencies related to the application file.

You can see from the above command output that it frees up 76MB of space on your Raspberry Pi system.

After removing the application or software completely, you can also apply the following command to remove the downloaded archive files for the application or software.

$ sudo apt clean

Doing this method removes the packages and whenever you want to install the application or software again, you have to reinstall those packages on your Raspberry Pi system.

You can also use the following command without the application name to remove those dependencies that are no longer required on your Raspberry Pi system.

$ sudo apt autoremove

So, if your focus is to free up space, you can use the above commands on your Raspberry Pi system to completely remove applications, software, and dependencies.

Conclusion

Removing applications on the Raspberry Pi system is straightforward through “apt remove” or “apt purge” commands. However, they don’t completely remove the application, leaving configuration files and dependencies behind. You can use the “–purge autoremove” command to remove the application with its configuration files and dependencies to free up the disk space.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.