Question: How to find the package with a missing file in the system using YUM? This how-to is also applicable when the file is not missing and is already installed, but for some reason, it is required to know the package that provides it. The YUM package manager tool uses repositories to retrieve information and […]
Archives for July 2019
How to Access Docker Container’s Network Namespace from Host
This post is to illustrate how to access the docker container’s network namespace. 1. Identify the docker container id you want to access and run below command as root on host. # docker ps 2. Get docker container’s PID: # pid=$(docker inspect -f ‘{{.State.Pid}}’ ${container_id}) 3. Create netns directory: # mkdir -p /var/run/netns/ 4. Create […]
How To Change The Time Zone For A Docker Container
The goal of this post is to set up the timezone on the container to match the same timezone on the Docker server, this will allow users to see the same time in both instances (Docker Server and Container). Most of the time Containers do not use the same time as the Docker server, this […]
XFS Filesystem Gets Mounted As Readonly (CentOS/RHEL)
The Problem Command ‘df’ shows statistics but ‘ls -ld’ fails below: # df … /dev/mapper/vgapp-appsvol 419221508 15095588 404125920 4% /lapps/app # ls -l /lapps/apps ls: cannot access /lapps/app: Input/output error The Solution Disk failure cases input/output operation stopped, so filesystem is re-mounted as read-only. This is an expected behavior of the kernel to mount a […]
Yum Fails with “Error: database disk image is malformed” in /var/log/messages
The Problem Unable to execute any command related to yum and below error messages found in /var/log/messages file. For example: # yum update Loaded plugins: aliases, changelog, downloadonly, kabi, presto, refresh-packagekit, security, tmprepo, verify, versionlock Loading support for kernel ABI Setting up Install Process Ol6_latest | 3.0 kB 00:00 Ol6_latest/primary_db | 78 MB 00:10 [Errno […]
How to Re-Create the Yum Cache and/or Force a Fetch of the Package List of the Enabled Repositories
This post briefly outlines how it possible to re-create the yum cache, or said in another way, force a fetch of the cache data from the enabled yum repositories. The enabled yum repositories are the ones in the following file /etc/yum.conf or in the following folder /etc/yum.repos.d that have their “enabled” setting to “1”, e.g. […]
How to Mirror Swap, Boot and Root Partions in CentOS/RHEL 7 Using mdadm Utility
This is required when there is no RAID controller card available for the server and the only solution is software RAID. This post makes changes to partitions, so if there is any existing data on any disks being used for this purpose, it should be backed up prior to creating the RAID array as per […]
How to Verify a Lun is in Active/Optimized Mode when ALUA Is Configured on Storage
If the Linux server has device-mapper-multipath configured, you can run ‘multipath -ll’ to list how disks are grouped together. For ALUA mode, you can check if a disk is in the Active/Optimized or non-optimized group. This post, however, is to discuss how to use sg_rtpg command to check the target port group asymmetric access state […]
How to Create Yum Repository For System Packages Installation in CentOS/RHEL
A yum repository holds the rpms and metadata about the rpms. A yum repository must be configured in order to use yum on any yum based Linux system. This post provides steps to configure a yum repository for installing packages on CentOS/RHEL systems. Configuring yum repository server 1. Create a directory for you local repository, […]
Getting “parsing errors” When Running ‘yum repolist’
The Problem When adding an extra repository of the public yum into existing yum repository configuration file, the following errors are shown: # yum repolist Loaded plugins: langpacks, ulninfo File contains parsing errors: file:///etc/yum.repos.d/public-yum-ol7.repo [line 91]: name=Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux 7Server (x86_64) [line 92]: baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/UEKR4/x86_64/ [line 93]: gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle [line 94]: […]