• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

yum

Yum Version Lock

February 21, 2023

How to lock a package or software in RedHat.

# For RHEL 5
yum install yum-versionlock
# For RHEL 6 and 7
yum install yum-plugin-versionlock
# For RHEL 8 and 9
yum install python3-dnf-plugin-versionlock

# For RHEL 5 yum install yum-versionlock # For RHEL 6 and 7 yum install yum-plugin-versionlock # For RHEL 8 and 9 yum install python3-dnf-plugin-versionlock

Locking a package

yum versionlock gcc-*

yum versionlock gcc-*

List locked packages

yum versionlock list

yum versionlock list

Filed Under: Linux Tagged With: install, lock, package, redhat, versionlock, yum

Yum Cache Corruption

February 4, 2022

If you’re getting a “HTTP Error 404 – Not Found” error when trying to run yum update, it could be a corrupted cache. Clear the cache on the system by running the following.

yum clean all
rm -rf /var/cache/yum/*

yum clean all rm -rf /var/cache/yum/*

Run yum update again. The errors should be gone.

Filed Under: Linux Tagged With: 404, cache, clear, corrupted, error, http, update, yum

Lock a Package in Linux

January 7, 2022

Here’s how to lockdown a package to a specific version.

Search for the current package.

$ sudo rpm -qa |  grep sdk
google-cloud-sdk-365.0.1-1.x86_64

$ sudo rpm -qa | grep sdk google-cloud-sdk-365.0.1-1.x86_64

Install versionlock.

yum install yum-plugin-versionlock

yum install yum-plugin-versionlock

Lock a package.

yum versionlock google-cloud-sdk-365.0.1-1.x86_64

yum versionlock google-cloud-sdk-365.0.1-1.x86_64

Display all locked versions.

yum versionlock list

yum versionlock list

Unlock and clear.

yum versionlock clear

yum versionlock clear

Filed Under: Linux Tagged With: lock, redhat, versionlock, yum

Create Local Yum Repo

November 7, 2021

Here’s how to create a local yum repo.

Install Apache.

sudo yum install httpd
sudo systemctl start httpd
sudo systemctl enable httpd
sudo systemctl status httpd

sudo yum install httpd sudo systemctl start httpd sudo systemctl enable httpd sudo systemctl status httpd

Install the repo packages.

sudo yum install createrepo yum-utils

sudo yum install createrepo yum-utils

Create repo directories.

sudo mkdir /var/www/html/{baseos,extras,appstream,epel}

sudo mkdir /var/www/html/{baseos,extras,appstream,epel}

Sync the repos.

sudo yum reposync -p=/var/www/html --repoid=baseos --download-metadata
sudo yum reposync -p=/var/www/html --repoid=extras --download-metadata
sudo yum reposync -p=/var/www/html --repoid=appstream --download-metadata
sudo yum reposync -p=/var/www/html --repoid=epel --download-metadata

sudo yum reposync -p=/var/www/html --repoid=baseos --download-metadata sudo yum reposync -p=/var/www/html --repoid=extras --download-metadata sudo yum reposync -p=/var/www/html --repoid=appstream --download-metadata sudo yum reposync -p=/var/www/html --repoid=epel --download-metadata

Create a new repo.

sudo createrepo /var/www/html/

sudo createrepo /var/www/html/

Setup a local repo.

sudo nano /etc/yum.repos.d/local.repo

sudo nano /etc/yum.repos.d/local.repo

Contents of local.repo.

local-base]
name=Yum Local Base
baseurl=http://10.10.0.20:80/base
enabled=1
gpgcheck=0
[local-extras]
name=Yum Local Extras
baseurl=http://10.10.0.20:80/extras
enabled=1
gpgcheck=0
[local-appstream]
name=Yum Local Appstream
baseurl=http://10.10.0.20:80/appstream
enabled=1
gpgcheck=0
[local-epel]
name=Yum Local Epel
baseurl=http://10.10.0.20:80/epel
enabled=1
gpgcheck=0

local-base] name=Yum Local Base baseurl=http://10.10.0.20:80/base enabled=1 gpgcheck=0 [local-extras] name=Yum Local Extras baseurl=http://10.10.0.20:80/extras enabled=1 gpgcheck=0 [local-appstream] name=Yum Local Appstream baseurl=http://10.10.0.20:80/appstream enabled=1 gpgcheck=0 [local-epel] name=Yum Local Epel baseurl=http://10.10.0.20:80/epel enabled=1 gpgcheck=0

Confirm new repo is in the repolist.

sudo yum repolist

sudo yum repolist

Filed Under: Linux Tagged With: apache, create, repo, yum

Database Clients on Linux

November 4, 2021

You can run database clients on your Linux distro by installing them.

MySQL

$ yum install mysql
$ apt install mysql

$ yum install mysql $ apt install mysql

Postgress

$ yum install postgresql postgresql-client
$ apt install postgresql postgresql-client

$ yum install postgresql postgresql-client $ apt install postgresql postgresql-client

MSSQL

$ yum install mysql-tools
$ apt install mssql-tools

$ yum install mysql-tools $ apt install mssql-tools

Filed Under: Linux Tagged With: apt, client, install, mssql, mysql, postgres, yum

Yum Check Update

July 9, 2021

To check which packages are available for an update.

yum check-update

yum check-update

Filed Under: Linux Tagged With: check, packages, update, yum

rpmdb open failed

May 22, 2021

If you get this error, something happened to the rpm database. To fix.

rm -f /var/lib/rpm/__db*
db_verify /var/lib/rpm/Packages
rpm --rebuilddb
yum clean all

rm -f /var/lib/rpm/__db* db_verify /var/lib/rpm/Packages rpm --rebuilddb yum clean all

Run yum again.

Filed Under: Linux Tagged With: failed, open, rebuild, rpmdb, yum

Checking Yum Transaction Logs

February 1, 2021

Check if package is on the system.

rpm -q httpd
httpd-2.4.6-97.el7.centos.x86_64

rpm -q httpd httpd-2.4.6-97.el7.centos.x86_64

Check the history logs.

yum history list
Loaded plugins: fastestmirror
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
   115 | System <unset>           | 2021-02-01 03:40 | Update         |    1
   114 | System <unset>           | 2021-02-01 02:03 | I, U           |   10
   113 | System <unset>           | 2021-01-29 19:54 | Update         |    1
   112 | System <unset>           | 2021-01-21 14:41 | Update         |    1

yum history list Loaded plugins: fastestmirror ID | Login user | Date and time | Action(s) | Altered ------------------------------------------------------------------------------- 115 | System <unset> | 2021-02-01 03:40 | Update | 1 114 | System <unset> | 2021-02-01 02:03 | I, U | 10 113 | System <unset> | 2021-01-29 19:54 | Update | 1 112 | System <unset> | 2021-01-21 14:41 | Update | 1

Check detail transaction id.

yum history info 114 | grep python 
    Updated python-perf-3.10.0-1160.6.1.el7.x86_64          @updates
    Updated python-sss-1.16.5-10.el7_9.5.x86_64             @your-repo
    Updated python-sssdconfig-1.16.5-10.el7_9.5.noarch      @your-repo

yum history info 114 | grep python Updated python-perf-3.10.0-1160.6.1.el7.x86_64 @updates Updated python-sss-1.16.5-10.el7_9.5.x86_64 @your-repo Updated python-sssdconfig-1.16.5-10.el7_9.5.noarch @your-repo

It looks like python was updated in transaction id #114.

Filed Under: Linux Tagged With: history, logs, rpm, yum

  • Go to page 1
  • Go to page 2
  • Go to Next Page »
  • Home
  • About
  • Archives

Copyright © 2023