Raspberry Pi

How to uninstall software from the Raspberry Pi operating system

We install many packages on Raspberry Pi but most of them we do not use after performing a particular task. Hence these packages occupy the space of the device. These packages occupy the memory of the system, which makes the memory-less for the installation of the future packages and also slows down the performance of the system.

We can uninstall such packages which are of no use from the terminal as well as from the GUI method. In this write-up, both these methods of uninstalling software from the Raspberry Pi have been explained.

How to uninstall the software from the Raspberry Pi OS using the CLI

To uninstall the software from the Raspberry Pi OS using the command line, in order to free some space there are different methods which are:

Method 1: Using the remove command

This method is used when you want to remove any package or software without removing its configuration files from the Raspberry Pi OS. The general syntax of using the remove command with an apt package manager to uninstall any package is:

$ sudo apt remove [package-name]

To understand it, we will uninstall the package of vim editor using the above syntax:

$ sudo apt remove vim -y

In the above command, “-y” is used to confirm the removal of the package and on the successful execution of the command, the vim package has been removed from the Raspberry Pi OS without removing its configuration files.

Method 2: Using the purge command

Another command to uninstall the package using the terminal of the Raspberry Pi OS is with the use of purge command with the apt package manager. This will remove the package along with its configuration files and other related files from the directory of the Raspberry Pi OS and the general syntax of using the purge command is:

$ sudo apt purge [package-name]

To understand its use, we will remove the VLC media player from the Raspberry Pi OS using the purge command:

$ sudo apt purge vlc -y

After the execution of the above command, the VLC media player has been permanently removed from the Raspberry Pi with its all configuration files.

Method 3: Using the clean command

This command is used to remove all the cache and archive files from the Raspberry Pi OS and will free the memory. In order to use the clean command, use the command:

$ sudo apt clean

Method 4: Using the autoremove command

This command is used to delete all those packages from the Raspberry Pi OS, which are either outdated or haven’t been used for a long time. The command of the autoremove in the Raspberry Pi OS is used as:

$ sudo apt autoremove -y

How to uninstall the software from the Raspberry Pi OS using the GUI

The most convenient way to remove any software from the Raspberry Pi OS is by using the Graphical User Interface (GUI). Go to the Raspberry Pi Icon on the top left corner of the screen, choose the “Preferences” and then click on the “Add/Remove Software”:

Search for the package or software which you want to remove, let us say we want to remove the “Geany” software so we will search for it in the search bar. The results will be displayed on the screen, right-click the mouse button on the selected result and choose the “Remove Package” and then click on the Apply button:

>>Why this screenshot is blurred<<

It will confirm once again about the removal of the packages, click on the “Continue” button:

Lastly, for authorization purposes, it will ask for the user account password, give it and press on the “Ok” button to remove the software:

The Geany software has been successfully uninstalled from the Raspberry Pi OS.

Conclusion

The Raspberry Pi is a Debian-based Linux distribution in which we can manage the packages with the apt package manager. The uninstallation of the packages on the Raspberry Pi makes the memory free for the new packages. In this write-up, we have explained the different command-line methods to uninstall the packages from the Raspberry Pi OS as well as the graphical user interface method.

About the author

Hammad Zahid

I'm an Engineering graduate and my passion for IT has brought me to Linux. Now here I'm learning and sharing my knowledge with the world.