How to create a local repository in Linux (RHEL / AlmaLinux)

What is a local repository? A Local Repository is a storage location on a Linux server that contains RPM packages and repository metadata. Why use a Local Repository? Objectives: In this guide, we will: Implementation We will use an internet-connected AlmaLinux 9 server to download PostgreSQL 17 and PostgreSQL 18 packages, then prepare them for … Read more

How to Install PostgreSQL 18 (Online) in Linux (RHEL / AlmaLinux)

Objective This guide explains how to install PostgreSQL 18 on RHEL / AlmaLinux using the official PostgreSQL repository (PGDG). Expected Result PostgreSQL 18 is installed, running as a systemd service, and storing its database files in the selected data directory (/pgdata or the default location). Implementation

How to add Swap Space in Linux

What is Swap? Commands Implementation: Create Swap File Check current memory and swap Shows total, used, and available RAM and swap. free -h Create a 1 GB swap file dd if=/dev/zero of=/docker_swap bs=1M count=1024 if=/dev/zero – uses zero-filled data as input of=/docker_swap – creates the swap file at /docker_swap bs=1M – sets the block size … Read more

How to Delete Swap Space in Linux

Recommendation: Read first: How to add swap space in Linux before proceeding with the steps below. View active swap Displays currently active swap files and partitions swapon –show Deactivate swap Disables the swap file so Linux stops using it swapoff /docker_swap Remove the entry from /etc/fstab (if it exists) vi /etc/fstab Delete the /docker_swap entry … Read more

How to create an LVM Partition

Logical Volume Management(LVM) LVM allows multiple disks or partitions to be combined into a storage pool and divided into logical volumes. LVM Components Key Benefits Add a Disk and Create an LVM Partition Install LVM utilities For RHEL, AlmaLinux, Rocky Linux, or Amazon Linux 2023: dnf install lvm2 -y Verify: pvdisplay –help Check available disks … Read more

Extend disk using LVM in Linux

How to extend disk using LVM in Linux Recommendation: Read first: How to Create an LVM Partition before proceeding with the steps below. Implementation Check filesystem usage Shows filesystem size, used space, and available space. df -h Identify the new disk List disks and partitions. Example: /dev/nvme2n1 (8 GB). fdisk -l lsblk Create an LVM … Read more

How to delete a disk partition in Linux

Purpose We will remove this partition. Steps Open the disk fdisk /dev/nvme0n1 Display existing partitions You’ll see the /dev/nvme0n1p1 Delete the partition Verify the partition table You won’t see the /dev/nvme0n1p1 no more since we deleted it using d Save changes and exit Verify lsblk No more partition! Notes