<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ankur Sharma</title>
    <description>The latest articles on DEV Community by Ankur Sharma (@a4abs).</description>
    <link>https://dev.to/a4abs</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F444333%2Feffdbc2c-0c3d-44eb-beca-9722d31eb6e2.jpeg</url>
      <title>DEV Community: Ankur Sharma</title>
      <link>https://dev.to/a4abs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/a4abs"/>
    <language>en</language>
    <item>
      <title>How to free up space in Ubuntu</title>
      <dc:creator>Ankur Sharma</dc:creator>
      <pubDate>Sat, 21 May 2022 04:32:37 +0000</pubDate>
      <link>https://dev.to/a4abs/how-to-free-up-space-in-ubuntu-29a0</link>
      <guid>https://dev.to/a4abs/how-to-free-up-space-in-ubuntu-29a0</guid>
      <description>&lt;p&gt;Whenever you are running out of disk space on Ubuntu server/desktop , There are several ways to free up space on ubuntu and other linux based systems.&lt;/p&gt;

&lt;p&gt;I have listed down some command line tricks here!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Check disk space&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your will get an output that shows the space&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uXGpnGEm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72gbapj1xvytakx77icf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uXGpnGEm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72gbapj1xvytakx77icf.png" alt="Image description" width="880" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Clear APT Cache&lt;/strong&gt;&lt;br&gt;
Ubuntu keeps a cache of the installed packages which are downloaded or installed earlier even after uninstallation. Cache files in this location &lt;em&gt;/var/cache/apt&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To check the disk space consumed you can use the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo du -csh /var/cache/apt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output will be look like&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y1L8MEJM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92getovd7z2zqwvumcjn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y1L8MEJM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/92getovd7z2zqwvumcjn.png" alt="Image description" width="880" height="35"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can clean this cache using the following command.It will clean up entire cache which frees up more space.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get clean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you wish to clean up only the outdated packages, you can use the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get autoclean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Remove unused packages and Kernels&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can remove the kernels &amp;amp; packages that are no longer needed and that are installed from Ubuntu archive while system updates using the following command.&lt;br&gt;
&lt;em&gt;Note: This command will not remove the kernels that are installed manually.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get autoremove --purge
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>linux</category>
      <category>ubuntu</category>
    </item>
  </channel>
</rss>
