How to install a package using a repository

Package installation command

There are two ways to install the package on the server. One is the method using the yum command, and the other is the method using the rpm command. ① Use yum yum installs the package via the repository in .repo.

# yum install [package name]

② Use rpm

# rpm -ivh [package name] 
* When installing a new ivh while watching the progress of the package
# rpm -Uvh [package name]
* Uvh is when upgrading the package

What is a repository?

It's used when installing packages and is like a box. The mechanism for installing with yum is described below, so please refer.

Reference link: Learn with yum install! How yum works

https://tech-blog.rakus.co.jp/entry/2017/12/14/105052

When you want to create and install a repository

I usually install the package with the above mechanism, but If you cannot connect externally or the repository does not exist, you cannot install it with yum, so you need to create it from the repository. Below is how to create a repository.

Specific repository creation procedure

① Create a mount location as cdrom

# mkdir -p /mnt/cdrom

② Mount

# mount /dev/cdrom /mnt/cdrom

③ Create a .repo file

# vi /etc/yum.repo.d/local_dvd.repo

[local_dvd]
name=RHEL7 test
baseurl=file:///mnt/cdrom/
enabled=1
gpgcheck=0
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-RHEL7

④ Confirm that .repo is registered

# yum repolist all

⑤ Mount the repository

# mount -t iso9660 /dev/cdrom /media

⑥ Install the package with yum

# yum install [package name]

The above is the flow at the time of installation. The ones that I have referred to are listed below. Thank you for watching until the end!

Quote

Registered as a yum repository such as local media

https://shimi-dai.com/register-yum-with-localmedia/

Recommended Posts

How to install a package using a repository
How to make a Python package using VS Code
How to install python using anaconda
How to create a Conda package
How to add a package with PyCharm
How to draw a graph using Matplotlib
How to create a repository from media
How to install Python
How to install pip
How to install archlinux
How to install python
How to install BayesOpt
How to install Nbextensions
How to install Prover9
How to code a drone using image recognition
How to make a QGIS plugin (package generation)
How to upload to a shared drive using pydrive
How to uninstall a module installed using setup.py
How to install python package in local environment as a general user
[2020.8 latest] How to install Python
How to install Python [Windows]
How to write a GUI using the maya command
How to set up a Python environment using pyenv
Tabpy 1.0 (2020-01 version) How to install
How to hold a hands-on seminar using Jupyter using docker
How to hack a terminal
How to install mkl numpy
I want to install a package of Php Redis
How to create a local repository for Linux OS
How to install Pelican blog
How to execute a command using subprocess in Python
How to use pip, a package management system that is indispensable for using Python
How to install NPI + send a message to line with python
How to transpose a 2D array using only python [Note]
Steps to install a Git cloned package locally with pip
How to make a Python package (written for an intern)
How to generate a query using the IN operator in Django
How to register a package on PyPI (as of September 2017)
I want to install a package from requirements.txt with poetry
How to make a Japanese-English translation
How to write a Python class
How to put a symbolic link
How to install and use Tesseract-OCR
How to install python-pip with ubuntu20.04LTS
How to make a slack bot
How to install VMware-Tools on Linux
How to install pycrypto on Windows
How to make a crawler --Advanced
How to make a recursive function
How to create a virtual bridge
How to install OpenCV on Mac
How to install MBDyn (Linux Ubuntu)
How to install PyPy on CentOS
How to use Nix package manager
How to install TensorFlow on CentOS 7
How to install and configure blackbird
How to install CUDA and nvidia-driver
How to install and use Graphviz
How to make a deadman's switch
How to create a Dockerfile (basic)
[Blender] How to make a Blender plugin