• Home
  • Subscribe
  • Contribute Us
    • Share Your Interview Experience
  • Contact Us
  • About
    • About CSEstack
    • Campus Ambassador
  • Forum & Discus
  • Tools for Geek
  • LeaderBoard
CSEstack

What do you want to Learn Today?

  • Programming
    • Tutorial- C/C++
    • Tutorial- Django
    • Tutorial- Git
    • Tutorial- HTML & CSS
    • Tutorial- Java
    • Tutorial- MySQL
    • Tutorial- Python
    • Competitive Coding Challenges
  • CSE Subject
    • (CD) Compiler Design
    • (CN) Computer Network
    • (COA) Computer Organization & Architecture
    • (DBMS) Database Management System
    • (DS) Data Structure
    • (OS) Operating System
    • (ToA) Theory of Automata
    • (WT) Web Technology
  • Interview Questions
    • Interview Questions- Company Wise
    • Interview Questions- Coding Round
    • Interview Questions- Python
    • Interview Questions- REST API
    • Interview Questions- Web Scraping
    • Interview Questions- HR Round
    • Aptitude Preparation Guide
  • GATE 2022
  • Linux
  • Trend
    • Full Stack Development
    • Artificial Intelligence (AI)
    • BigData
    • Cloud Computing
    • Machine Learning (ML)
  • Write for Us
    • Submit Article
    • Submit Source Code or Program
    • Share Your Interview Experience
  • Tools
    • IDE
    • CV Builder
    • Other Tools …
  • Jobs

How to Auto Remove All Unused Packages in Ubuntu (Linux)?

Aniruddha Chaudhari/42237/4
Linux

In this tutorial, you will learn to auto remove all unused packages in Ubuntu. I will also show you how this simple technique increases your system performance.

Note: This tutorial will work on Debian, LinuxMint and Ubuntu Linux distros. Basically this works for all the Linux DEB systems which use an apt package management tool.

Why should You Delete or Uninstall All Unused Packages in Ubuntu?

Managing installed packages is a very tedious job. Many times we end up installing unnecessary packages that are no longer in use.

When you install any Linux package on your system, many other dependent packages also get installed. Now, even if you uninstall that original package, some dependent packages will be left behind.

Over the year, we work on many projects which require different packages. After completion of the project even if we delete packages there are some dependent packages that create clutter. We end up having a lot of unnecessary packages.

Let’s take an example:

I tried to install the python3-venv Python package.

(This is the package to create a virtual environment for Python. If you don’t know about it, don’t worry. This is just an example.)

sudo apt-get install python3-venv

I already had python3-env installed on my system. After executing this command, this is what I can see on my terminal.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-venv is already the newest version (3.6.7-1~18.04).
The following packages were automatically installed and are no longer required:
  amd64-microcode gir1.2-geocodeglib-1.0 intel-microcode iucode-tool libglu1-mesa libllvm8 libpython-all-dev libpython-dev libpython-stdlib libpython2.7-dev libxatracker2
  libxvmc1 linux-generic-hwe-18.04 linux-headers-generic-hwe-18.04 linux-image-generic-hwe-18.04 thermald ubuntu-web-launchers x11-apps x11-session-utils xbitmaps xinit xinput
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

You can see the text as “The following packages were automatically installed and are no longer required“.

I have updated the python3-venv package. It does not require some of the dependent packages which were required for the earlier python3-venv package.

Does it make sense to keep these unused packages?

No. It creates clutter and consumes a lot of memory. Keeping these unnecessary packages also degrades your system performance.

Also, check- Most Useful Linux Command You Need Everyday.

How you can remove packages that are no longer required?

Here you go…

Command to Remove All Unused Packages in Ubuntu (Linux)

Here is a simple command you can run to remove all no-longer required packages.

sudo apt autoremove

Done.

With this simple command, you have removed all the unnecessary packages. It checks all the packages and finds out packages that are no longer in use. And remove them one by one. It makes your job very easy.

Also, remove old kernels from your Linux system to speed your Linux system.

If you find any unuseful packages installed on your system, make a habit of removing them. You don’t need to compromise with your system performance.

linuxlinux cmd
Aniruddha Chaudhari
I am complete Python Nut, love Linux and vim as an editor. I hold a Master of Computer Science from NIT Trichy. I dabble in C/C++, Java too. I keep sharing my coding knowledge and my own experience on CSEstack.org portal.

Your name can also be listed here. Got a tip? Submit it here to become an CSEstack author.

Comments

  • Reply
    Alfaz
    February 17, 2020 at 5:39 pm

    My Linux is running too slow. Thanks for this help. Now it is running better.

    • Reply
      Aniruddha Chaudhari
      February 17, 2020 at 6:20 pm

      Glad you find it helpful for your system. You can also try removing old Kernal for better performance. I have shared the link to the tutorial to delete the old kernels.

      • Reply
        Alfaz
        February 17, 2020 at 6:21 pm

        Okay. Thank you so much, Sir!

        • Reply
          Aniruddha Chaudhari
          February 17, 2020 at 6:22 pm

          You’re welcome, Alfaz!

Leave a Reply Cancel reply

Make Your Linux Run Faster

Linux- Remove Old Kernels

Linux- Auto-Remove Unused Packages

Linux Commands

Linux- Most Useful Commands

Linux- LS command [Tool]

Linux- 7 Hostname Commands

Linux- Text Search in Terminal

Linux- File Permission [Chmod Calculator]

Linux- Check Free Memory in Ubuntu

Linux- Find Total Size of the Directory

Linux- Mount/Umount USB Drive

Linux- Change VNC Password

Linux- Get Serial Number (dmidecode)

Linux- Execute Shell Script

Linux Tools

5 Free Linux screenshot tools

Vim Editor Tricks

Vim- Setting Vim of Programming

Vim- 6 Commands to Edit File

Vim- Case-Sensitive Search

Vim- How to Create Function?

© 2022 – CSEstack.org. All Rights Reserved.

  • Home
  • Subscribe
  • Contribute Us
    • Share Your Interview Experience
  • Contact Us
  • About
    • About CSEstack
    • Campus Ambassador
  • Forum & Discus
  • Tools for Geek
  • LeaderBoard