• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How To Clear Apt Cache In Ubuntu – Free Disk Space In Ubuntu

How To Clear Apt Cache In Ubuntu – Free Disk Space In Ubuntu

By Sourabh / November 13, 2019 Category: How To, Ubuntu

How to Linux – Free up disk space by clearing Apt Cache in Ubuntu Systems. Learn how to clean apt cache archives or clean apt lists using apt-cache clean all command.

After a regular user, a lot of space is occupied by /var/cache/apt/ folder. The folder consumes a lot of space and slows the system performance. It is wise to clear the /var/cache/apt/ folder to make the system faster.

What is /var folder?

‘/var’ contains variable data, i.e. files and directories the system must be able to write to during system operation. /var folder contains variable data like system logging files, mail and printer spool directories, and transient and temporary files. Some folders of /var are not shareable between different systems. For example, /var/log, /var/lock, and /var/run.

What is /var/cache folder?

/var/cache folder is a part of /var folder system. /var/cache folder is intended for cached data from applications that are locally generated during I/O operations. These files can be deleted without any data loss as these data remains only valid between invocations of the application and rebooting of the system. When the process gets over the data is no more important.

Clean APT Archive Cache

Ubuntu users can clean Apt archive cache using sudo apt-get clean and sudo apt-get autoclean commands. The apt-get is a APT package handling utility or the command-line tool for handling packages. These commands clears out the local repository. The above autoclean command only removes packages and files that are no longer in use. Ubuntu users can also do the same task from Synaptic package manager. Open Synaptic, go to Settings > Preferences > File tab. Select to delete packages that are no longer in use.

To clean Apt archive cache folder on Ubuntu, run:

sudo apt-get update
sudo apt-get clean
sudo apt-get autoclean

Let us know more about the commands we have used:

clean – clean clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.

autoclean – Like clean, autoclean clears out the local repository of retrieved package files. The difference is that it only removes package files that can no longer be downloaded, and are largely useless. This allows a cache to be maintained over a long period without it growing out of control. The configuration option APT::Clean-Installed will prevent installed packages from being erased if it is set to off.

Primary Sidebar

Latest Posts

Delete Directory And Contents Recursively Without Prompt On Linux

Check User Login History In Ubuntu Linux Command Line

Use Locate Command To Find File In Linux Terminal By Name

How To Change Terminal Color In Ubuntu Command Line

How To Run Fsck Manually In Linux To Fix Unexpected Inconsistency

How To Fix Broken Packages On Ubuntu From Terminal

Re Execute The Previous Command In Linux Ubuntu Command Line

How Much RAM Is Needed For Ubuntu PC

How To Find Large Files And Directories In Linux Command Line

How To Use Clear Command History In Linux Terminal

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap