Monday, September 19, 2022

GIT operations in day to day life

 GIT operations

To configure your name and email in your local settings:


# git config --global user.name "Name"

# git config --global user.email "Email"

git config -l


To Clone the git repo:


git clone https://git-url/project.git


To play around the branches :


git branch

git branch -r

git switch <branch-name> 


To push from local repo to git repo:


# git add .

git commit -m "First commit"

git push -u origin <branch-name> 

Wednesday, September 14, 2022

How to upgrade Prometheus from 2.22 to 2.38 on Ubuntu

 How to upgrade Prometheus from 2.22 to 2.38 on Ubuntu

OS : Ubuntu 16.04 LTS

Prometheus version : 2.22

# /usr/local/bin/prometheus --version

prometheus, version 2.22.0 (branch: HEAD, revision: 0a7fdd3b76960808c3a91d92267c3d815c1bc354)


Confirm that prometheus datas are in # ll /var/lib/prometheus

Take a backup of this data to a safe location


Confirm the path of prometheus and promtool # /usr/local/bin/

Take a backup of this data to a safe location


Stop prometheus and grafana services


# systemctl stop prometheus

# systemctl stop grafana-server


Download the latest prometheus. In my case its 2.38 and I downloaded to /mnt folder.


# cd /mnt

wget https://github.com/prometheus/prometheus/releases/download/v2.38.0/prometheus-2.38.0.linux-amd64.tar.gz

# tar -xvf prometheus-2.38.0.linux-amd64.tar.gz

# cd prometheus-2.38.0.linux-amd64

# cp prometheus /usr/local/bin/

# cp promtool /usr/local/bin/

# chown prometheus:prometheus /usr/local/bin/prometheus

# chown prometheus:prometheus /usr/local/bin/promtool

# cp -r consoles /etc/prometheus/

# cp -r console_libraries /etc/prometheus/

# chown -R prometheus:prometheus /etc/prometheus


Start prometheus and grafana services


# systemctl start prometheus

# systemctl start grafana-server


Check the prometheus version

# /usr/local/bin/prometheus --version

prometheus, version 2.38.0 (branch: HEAD, revision: 818d6e60888b2a3ea363aee8a9828c7bafd73699)

Sunday, August 21, 2022

Yum error : Loaded plugins: versionlock

 [opc@dbdemo ~]$ sudo yum install iptables-services

Loaded plugins: versionlock

There are no enabled repos.

 Run "yum repolist all" to see the repos you have.

 To enable custom repositories:

     yum-config-manager --enable <repo>

[opc@dbdemo ~]$

The above is the error getting while issue yum command. My OS is Oracle Linux 7.9

Solution to fix the error:

Login to the server as root

# wget https://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle


# gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle


# vi /etc/yum.repos.d/ol7-temp.repo


[ol7_latest]

name=Oracle Linux $releasever Latest ($basearch)

baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

gpgcheck=1

enabled=1


# yum install oraclelinux-release-el7


# mv /etc/yum.repos.d/ol7-temp.repo /etc/yum.repos.d/ol7-temp.repo.disabled


# yum update -y


Now yum install iptables-services works without any error

References : 

https://yum.oracle.com/faq.html#a10

https://yum.oracle.com/getting-started.html#installing-from-oracle-linux-yum-server


Thursday, August 18, 2022

The GPG keys listed for the "MySQL 5.7 Community Server" repository are already installed but they are not correct for this package. Check that the correct key URLs are configured for this repository.

 OS is Amazon Linux and trying to install Mysql 5.7, I am getting the below error


The GPG keys listed for the "MySQL 5.7 Community Server" repository are already installed but they are not correct for this package. Check that the correct key URLs are configured for this repository.

Fix : 

rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022

Now run, yum install mysql-community-server

It will work for me.