Andrew Fletcher published: 24 August 2020 (updated) 13 January 2021 1 minute read
Whilst updating nodejs and npm on a Centos 6 or 7 server running Apache, I hit a few walls and as a matter of process found some commands that are handy to run before doing a deep dive in Google.
Cleaning the cache
sudo yum clean all rm -rf /var/cache/yum/*
To make the cache
sudo yum clean all; sudo yum makecache
If you want to run several commands use semi-colon as noted above.
Updating
When running an update command run
sudo yum -y update
Related articles
Andrew Fletcher
•
19 Jan 2026
Automatically splitting large files with sed based on file size
When working with large prompt or configuration files (for example data/prompts-master.py), it’s common to copy or inspect the file in chunks using sed. Early on, this is easy to manage manually:sed -n '1,324p' data/prompts-master.py
sed -n '325,647p' data/prompts-master.pyHowever, this approach...
Andrew Fletcher
•
12 Jan 2026
Copying a directory while excluding a specific child directory
When working with Drupal environments, there are times you need to duplicate a directory structure — for example, cloning a site or preparing a new environment without copying certain environment-specific folders.A common case is excluding:sites/default/filesThis directory typically contains:User...
Andrew Fletcher
•
15 Apr 2025
Fine-tuning Fail2Ban to stop Apache bogus FCGI attacks
Building a resilient web server Early in the year, we encountered a number of challenges, one of the most disruptive was a sustained wave of automated attacks hammering several of the web servers we manage. The volume of traffic overwhelmed server resources, slowing websites to a crawl and...