How to mount the CD to find the rpm package under Linux

How to mount the CD to find the rpm package under Linux

Written in front

Sometimes you need to install software when using Linux. Of course, you can install it online through the yum command, or you can install it by downloading the rpm package. However, the rpm installation requires you to find the rpm package that the installation software depends on. Let’s try it today.

System environment CentOS 7.5

[root@localhost /]# cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core)

1. Find the full path of the CD

[root@localhost /]# ls -l /dev | grep cdrom
lrwxrwxrwx 1 root root 3 March 3 09:32 cdrom -> sr0
crw-rw---- 1 root cdrom 21, 1 March 3 09:32 sg1
brw-rw---- 1 root cdrom 11, 0 March 3 09:32 sr0

This command knows that the name of the CD is: cdrom, so the path of the CD is /dev/cdrom

2. Mount the CD

[root@localhost /]# mount /dev/cdrom /mnt

mount: /dev/sr0 is write-protected and will be mounted read-only

This command loads the contents of the directory /dev/cdrom into the directory /mnt, which means that the contents of the directory /dev/cdrom can be accessed from the directory /mnt. If the following content appears, the mount is successful.

[root@localhost /]# cd /mnt/
[root@localhost mnt]# ls
CentOS_BuildTag EULA images LiveOS repodata RPM-GPG-KEY-CentOS-Testing-77EFI GPL isolinux Packages RPM-GPG-KEY-CentOS-7 TRANS.TBL

3. Copy the target rpm package

Enter the Packages directory and find the target rpm package. Here we take the "telnet client" as an example.

[root@localhost mnt]# cd Packages/
[root@localhost Packages]# ls -l | grep telnet
-rw-rw-r-- 2 root root 65632 August 11, 2017 telnet-0.17-64.el7.x86_64.rpm
-rw-rw-r-- 2 root root 41804 August 11, 2017 telnet-server-0.17-64.el7.x86_64.rpm

There are 2 options here, but you can see from the names that the first one is the client and the other one is the server. Just select the first one here, and then copy it to /root. If the following result appears, it is successful.

[root@localhost Packages]# cp telnet-0.17-64.el7.x86_64.rpm /root/
[root@localhost Packages]# ls -l /root
Total dosage 72
-rw-------. 1 root root 1569 June 3, 2018 anaconda-ks.cfg
-rw-r--r-- 1 root root 65632 Mar 3 10:08 telnet-0.17-64.el7.x86_64.rpm
-rw-r--r--. 1 root root 0 June 30, 2018 ????.txt

4. Unmount the disc

After knowing the target rpm package, remember to uninstall the CD! (First cut out the directory /mnt)

[root@localhost Packages]# cd /
[root@localhost /]# umount /mnt/
[root@localhost /]# ls -l /mnt/
Total usage 0

5. Install the copied rpm package

[root@localhost /]# cd root/
[root@localhost ~]# rpm -ivh telnet-0.17-64.el7.x86_64.rpm 
Preparing... ################################# [100%]
    Package telnet-1:0.17-64.el7.x86_64 has been installed [root@localhost ~]# telnet
telnet>

The above content indicates that the telnet client has been installed successfully. Isn’t it simple?

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to build a local yum repository in Linux by mounting the system CD

<<:  Implementing parameter jump function in Vue project

>>:  Decompression, installation, backup and restore of MySQL under Windows environment

Recommend

How to allow external network access to mysql and modify mysql account password

The root account of mysql, I usually use localhos...

Mysql tree-structured database table design

Table of contents Preface 1. Basic Data 2. Inheri...

Handwriting implementation of new in JS

Table of contents 1 Introduction to the new opera...

How to insert a link in html

Each web page has an address, identified by a URL...

Element sample code to implement dynamic table

Table of contents 【Code background】 【Code Impleme...

How to view image information in Docker

In this article, we will need to learn how to vie...

About the overlap of margin value and vertical margin in CSS

Margin of parallel boxes (overlap of double margi...

MySQL UNION operator basic knowledge points

MySQL UNION Operator This tutorial introduces the...

Detailed Explanation of JavaScript Framework Design Patterns

Table of contents mvc mvp mvvm The source of Vue ...

A brief discussion on the role of HTML empty links

Empty link: That is, there is no link with a targ...

js canvas realizes circular water animation

This article example shares the specific code of ...

Introduction to MySQL statement comments

MySQL supports three types of comments: 1. From t...

Various methods to restart Mysql under CentOS (recommended)

1. MySQL installed via rpm package service mysqld...