Yum Add Repo Manually

Add a yum repo manually by adding a configuration file in /etc/yum.repo.d/ directory.

cd /etc/yum.repos.d/
vi newrepo

Add the following.

name=New Repo for RHEL/ CentOS $releasever - $basearch

You may need to import the key.

rpm --import http://newrepo.domain.com/RPM-GPG-KEY.txt

Finally, test the new repo by running the following.

yum update -y
yum install new-package

Amazon Linux Docker Install

Here’s the installation of Docker for the original Amazon Linux.

# To install docker
sudo yum install docker
sudo service docker start
# Validate it's working
docker --version
docker run hello-world
docker ps -a
docker image ls

Local RPM Install

Steps for creating a local RPM package installation.

# download plugin
yum install yum-plugin-downloadonly
# download package and dependencies
yum install --downloadonly reiserfs
# download package and dependencies to a specific directory
yum install --downloadonly --downloaddir=/home/ec2-user package
# download multiple packages
yum install --downloadonly --downloaddir=/root/mypackages/ package1 package2
# finally install package
rpm -ivh -r /home/ec2-user package.rpm