How to Uninstall Programs on a Raspberry Pi (Free up space)

1. Open the Terminal window on your Raspberry Pi.

2. Type in the command “sudo apt-get remove ” and press enter. Replace with the name of the program you want to uninstall.

3. Type in your password when prompted and press enter.

4. Type in “Y” and press enter to confirm the uninstallation.

5. Type in “sudo apt-get autoremove” and press enter to remove any dependencies that were installed with the program.

6. Type in “Y” and press enter to confirm the uninstallation.

7. Type in “sudo apt-get autoclean” and press enter to clean up any unnecessary files.

8. Type in “Y” and press enter to confirm the clean up.

9. Reboot your Raspberry Pi to complete the uninstallation process.

I conduct many tests on Raspberry Pi that require me to install different applications, but I don’t necessarily clean up afterwards. If you are here, you might be in the same boat. Let’s learn how to easily uninstall your applications to free up space on your Raspberry Pi.

To remove applications on Raspberry Pi OS with Desktop, you can use the “Add/Remove Software tool” and uncheck the programs to uninstall. It’s also possible to uninstall applications with a command line: sudo apt remove package_name in a terminal.

In this article, I will show you how to generate a list of currently installed packages, uninstall applications from your Raspberry Pi and gain more space on your SD card.

If you need help getting started on Raspberry Pi, I have an entire course to guide you through your first steps. I’ll help you use the perfect hardware, plug everything in and install your first system. You’ll also do your first project with me, just to make sure you are ready for the next level. Get all the information on this page if you are interested.

List installed packages on a Raspberry Pi

Use the Packages Manager

Current status of your SD card

The first question you might ask yourself is probably: how do I find the used space on my SD card?
The quickest way to do this is to go to Accessories> File Manager, right-click on the “/” folder (at the very top) and then click Properties.

This window will show you all space used by your files. From there, you can guess the remaining space available depending on the media size.

List installed packages

By default, the only way to find the installed packages graphically is to go to the package manager: Preferences> Add / Remove Software.

The tool displays installed programs with a checked box, so you can easily find and uninstall them if needed:

Unfortunately, this method is not perfect. There isn’t a way to get a list of all installed packages on one page. You have to enter each category and scroll through the list to find the checked lines.

This is probably the main reason why beginners on Raspberry Pi, or at least those who are not familiar with Linux commands, have trouble removing packages. I’ll give you other solutions for this throughout this post.

The good news is that you can see the package size in the bottom-right corner.

You can also go to Options> Packages logs, and see the latest changes made to the packages. It looks like this:

This screen displays the latest packages installed and generally allows you to find which ones you can quickly remove.

Note: it still isnt perfect, as packages installed with the command line are not shown here. I also noticed that it sometimes doesn’t include the full packages list.

If you want to go through the GUI, know that it is possible to install Synaptic, which is a similar tool, but it allows more advanced filters, like only listing installed packages (I suggest it in my favorite apps for Raspberry Pi).

You can find Synaptic in the Add/Remove Software tool.

Then start Synaptic, click Status > Installed in the left menu, and you will get the list of installed packages:

The easiest way to list installed packages is to go through the command line. Let’s learn how to do this.

Alternative: Use the command line

If you manage to remember these few commands, using a terminal is the fastest way to find the packages installed on your Raspberry.

Disk usage

Firstly, if you want to see the disk space used in a terminal or ssh, use the df command like this:
df -h

The -h option displays values in a human-readable format.

List installed packages

To list every package installed on your Raspberry Pi you can use:
dpkg -l

This command will list all packages, in this format:

The df command doesn’t display the space used by each program directly, but to find the most significant packages you can do something like this:
dpkg-query -W -f="${Installed-Size;8} ${Package}\n" | sort -nr | head -10
(you don’t have to remember this one ^^)

  688414  wolfram-engine
  171382  chromium-browser
  168481  oracle-java8-jdk
  143795  scratch2
  114332  raspberrypi-kernel
  110694  libgl1-mesa-dri
   84603  libreoffice-core
   83391  libreoffice-common
   49227  quake3-demo-data
   47627  gnome-user-guide

This command will show you the size of each package, and sort the list by size. You can change the last -10 option to get more results.

Are you a bit lost in the Linux command line? Check this article first for the most important commands to remember, and a free downloadable cheat sheet so you can have the commands at your fingertips.

How to uninstall programs on a Raspberry Pi

Now you know how much space is left on your Raspberry Pi, and which packages use the most space. Let’s learn how to remove these programs! It’s not very complicated.

Use the package manager

In graphic mode, the search is not very convenient, but removing a package is simple.

Once you find the package to delete, uncheck the box, click the Apply button at the bottom and confirm.

The package will be uninstalled immediately.

Use the command line

Most of the time, you can use apt to remove the package via the terminal.

For example, if I see that I forgot to remove a quake3 package from another tutorial, I can do it with:
sudo apt remove quake3-demo-data

And that’s it, the package will be deleted and disk space released.

APT also has interesting options you can use in a command line:

  • You can ask it to remove all related files with:
    sudo apt remove --purge <package>
  • Use a wildcard to remove everything related to a specific application or service:
    sudo apt remove quake3*
    Make sure to carefully check the output, as something using a wildcard can select packages you don’t want to remove.
  • And use autoremove to uninstall the dependencies that are no longer required on your system:
    sudo apt autoremove

Free more space on Raspberry Pi

I have an entire on this topic that you can find here, but I’ll give you a few tips in this section.

Temporary files

In theory, temporary files are temporary. This means they are automatically deleted when you restart your Raspberry Pi. But if you can’t reboot it, or you’re stuck, you can empty the folder with one of these commands:

  1. Remove only old temporary files:
    sudo find /tmp -type f -atime +10 -delete
  2. Clear all temporary files (can corrupt some running apps):
    sudo rm -rf /tmp/*

Related article: 3 Commands to Search For a File on Raspberry Pi (and find it!)

Apt cache

The apt tool caches a large part of the information used, to avoid downloading everything each time you use it.

Clearing this cache may allow you to unlock a stuck Raspberry Pi due to the lack of disk space. Simply execute this command:
sudo apt clean

But remember that the cache will come back after the next update, so it’s a very temporary solution.

As we talk about the cache, if you surf on the internet with your Raspberry Pi, remember to clear the browser’s cache too. I bet that you will gain some valuable MB.

On any browser, you have to go to Options to clear the cache.

By the way, if you are looking for the best web browser on Raspberry Pi, you’ll find the answer here. I tested all of them.

Remove unused packages

When you uninstall packages, dependencies often do not automatically uninstall, so you can uninstall them with this command:
sudo apt autoremove

But the most effective way to free up space, if you do not use these tools is to uninstall wolfram-engine and LibreOffice. This tip will allow you to gain about 1 GB of disk space in 10s.

Use these commands:
sudo apt remove --purge wolfram-engine libreoffice*
sudo apt autoremove

free space

Yes, I do!

Find other big folders and files

Ok, let’s say you still have a disk space issue.

We saw how to remove packages or clear different caches, but this is not necessarily the most important part of your used disk space.

If you have a huge log file or hundreds of photos/videos stored on your SD card, you’ll have to deal with it before, but how do you find them? Let’s learn how.

Graphical way:

“Gnome utility” is a great tool that you can use (the package name is baobab). You can find it in the Add/Remove software tool, search for “baobab”.

It will graphically show you exactly how much free space you have left and which folder is taking up a lot of space:

Thanks to this, it will be much easier to find a file that you would have missed.

I talk a bit more about this in my article on how to free up space on a Raspberry Pi.

Command line:

In a terminal, you can do something similar.

du is a command available directly on Raspberry Pi OS (and most other Linux distributions).
It lists the size of the files and folders on the disk.

With some additional options, we will get the same result as the graphical tool:

  1. You can see the size taken by each subfolder like this:
    sudo du -h --max-depth=1 /
  2. And you can also find the biggest files on the disk like this:
    sudo du -ak | sort -nr | head -50

    You can change the -50 options to get more or fewer files in the list.
    Don’t pay attention to access errors when running the command.

Want to chat with other Raspberry Pi enthusiasts? Join the community, share your current projects and ask for help directly in the forums.

Conclusion :

You have now learned how to uninstall packages on your Raspberry Pi, and also some tips to free space on your SD card (I go into more details here).

And of course, if you have a lot of issues with your SD card, it might mean that it is too small and you will have to think about changing it. It does not cost much nowadays, so you will be relieved.

Check my reviews of the best SD cards for Raspberry Pi here if you don’t know which one to choose.
USB can also be a solution if you really need a lot of space. I explain how to choose between SD cards and USB drives here.

Additional Resources

Not sure where to start?
Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.
Watch the Raspberry Pi Bootcamp course now.

Master your Raspberry Pi in 30 days
Don’t want the basic stuff only? If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.
Download the e-book.

VIP Community
If you just want to hang out with me and other Raspberry Pi fans, you can also join the community. I share exclusive tutorials and behind-the-scenes content there. Premium members can also visit the website without ads.
More details here.

Need help building something with Python?
Create, understand, and improve any Python script for your Raspberry Pi.
Learn the essentials step-by-step without losing time understanding useless concepts.
Get the e-book now.

You can also find all my recommendations for tools and hardware on this page.

How to Uninstall Programs on a Raspberry Pi (Free up Space)

If you’re running out of space on your Raspberry Pi, one of the best ways to free up some space is to uninstall programs you no longer need. Uninstalling programs on a Raspberry Pi is a relatively simple process, and can be done in just a few steps.

Step 1: Identify Programs to Uninstall

The first step is to identify which programs you no longer need. To do this, open the terminal and type in the command “dpkg -l”. This will list all of the installed packages on your Raspberry Pi. Look through the list and identify any programs you no longer need.

Step 2: Uninstall the Program

Once you’ve identified the program you want to uninstall, type in the command “sudo apt-get remove [program name]”. This will uninstall the program from your Raspberry Pi. You may also need to type in the command “sudo apt-get autoremove” to remove any dependencies associated with the program.

Step 3: Clean Up

Finally, you’ll want to clean up any leftover files associated with the program. To do this, type in the command “sudo apt-get clean”. This will remove any cached files associated with the program, freeing up even more space on your Raspberry Pi.

Conclusion

Uninstalling programs on a Raspberry Pi is a relatively simple process. By following the steps outlined above, you can easily free up some space on your Raspberry Pi by uninstalling programs you no longer need.

Jaspreet Singh Ghuman

Jaspreet Singh Ghuman

Jassweb.com/

Passionate Professional Blogger, Freelancer, WordPress Enthusiast, Digital Marketer, Web Developer, Server Operator, Networking Expert. Empowering online presence with diverse skills.

jassweb logo

Jassweb always keeps its services up-to-date with the latest trends in the market, providing its customers all over the world with high-end and easily extensible internet, intranet, and extranet products.

Contact
San Vito Al Tagliamento 33078
Pordenone Italy
Item added to cart.
0 items - 0.00
Open chat
Scan the code
Hello 👋
Can we help you?