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.


Monday, August 1, 2022

How to install OCI CLI in windows and push backup to object storage

 How to install OCI CLI in windows and push backup to object storage

Documentation link : https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#InstallingCLI__windows

OCI provides CLI to mange your cloud account. You can do almost all the task which you are doing using console can be done using CLI.

Here, we are going to install CLI on a windows 2019 server and push the backup files to Object Storage.

Login to your windows VM


Right click on “Windows PowerShell” and open as administrator.


Issue the following commands


Set-ExecutionPolicy RemoteSigned


Invoke-WebRequest https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.ps1 -OutFile install.ps1

iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.ps1'))


This will install Python automatically. OCI CLI is build on Python






Now you can see the oci cli installation is good. 

# oci --version will return the cli version.

Next step is to setup the cli configuration. We need to authorise the configuration to perform actions. This is based on the user permissions.

# oci setup config

Enter the location of your config [C:\Users\opc\.config] :

Enter user OCID : 

 

Tenancy OCID :


Chose your DC Region :


Do you want to generate API key : Y


Enter directory for your keys to created [C:\Users\opc\.oci]


Enter a name for your key [oci_api_key] :


Passphrase :


Now we need to upload your public key




After this step, you should able to interact with your oracle cloud account using oci cli.

For testing, issue this command

# oci os ns get ( This will return back the namespace of our account)


This means we are good !

How to copy backup files from this windows VM to object storage.


# oci os object put [options]

-bn = bucket name
--file = filename

# oci os object put -bn my-upload-bucket --file mssql-july31.sql

In this example, the backup file is mssql-july31.sql and this should be in the path or you need to add the full path and the bucket name is my-upload-bucket.