How do I free up space on CentOS?

How do I free up space on CentOS?

Clear disk space on CentOS/RHEL 6, 7, 8

  1. Trim log files.
  2. Cleanup YUM cache.
  3. Remove orphan packages.
  4. Remove WP CLI cached WordPress downloads.
  5. Remove old kernels.
  6. Remove Composer cache.
  7. Remove core dumps.
  8. Remove error_log files (cPanel)

How do I free up space on my Linux root?

Freeing disk space on your Linux server

  1. Get to the root of your machine by running cd /
  2. Run sudo du -h –max-depth=1.
  3. Note which directories are using a lot of disk space.
  4. cd into one of the big directories.
  5. Run ls -l to see which files are using a lot of space. Delete any you don’t need.
  6. Repeat steps 2 to 5.

How do I clean up CentOS?

Clear disk space on CentOS 6 / 7

  1. Trim log files. find /var -name “*.log” \( \( -size +50M -mtime +7 \) -o -mtime +30 \) -exec truncate {} –size 0 \;
  2. Cleanup YUM cache. Simple command to cleanup yum caches:
  3. Remove orphan packages.
  4. Remove WP CLI cached WordPress downloads.
  5. Remove old kernels.
  6. Remove Composer cache.

How do I free up memory on CentOS 7?

Every Linux System has three options to clear cache without interrupting any processes or services.

  1. Clear PageCache only. # sync; echo 1 > /proc/sys/vm/drop_caches.
  2. Clear dentries and inodes. # sync; echo 2 > /proc/sys/vm/drop_caches.
  3. Clear pagecache, dentries, and inodes.
  4. sync will flush the file system buffer.

How to clear disk space on CentOS 6, 7, 8?

Clear disk space on CentOS/RHEL 6, 7, 8 1. Trim log files. This will truncate any *.log files on the volume /var that are either older than 7 days and greater… 2. Cleanup YUM cache. Note that the above command will not remove everything related to yum. For instance, metadata for… 3. Remove

Why do I need to free up disk space for Yum?

For instance, metadata for disabled repositories will not be affected. You may want to free up space taken by orphaned data from disabled or removed repositories: Also, when you accidentally run yum through a regular user (forgot sudo ), yum will create user-cache.

How to clear up space in the Yum cache?

Cleanup YUM cache The simple command to cleanup yum caches: Note that the above command will not remove everything related to yum. For instance, metadata for disabled repositories will not be affected. You may want to free up space taken by orphaned data from disabled or removed repositories:

How to remove old kernels from CentOS server?

Before removing old kernels, you might want to simply reboot first in order to boot up from the latest kernel. The following commands will keep just 2 latest kernels installed: Note that with some VPS providers (Linode for example), servers use provider’s built kernels by default and not the ones on the server itself.