CentOS: Install Packages Via yum Command Using DVD / CD as Repo

www.lautt‮moc.iru‬
CentOS: Install Packages Via yum Command Using DVD / CD as Repo

To install packages on CentOS using the yum package manager and a DVD or CD as the repository, you can use the following steps:

  1. Insert the DVD or CD into your system's optical drive.

  2. Create a file called /etc/yum.repos.d/dvd.repo with the following contents:

[dvd]
name=DVD Repository
baseurl=file:///media/cdrom
gpgcheck=0
enabled=1

Replace /media/cdrom with the mount point of your optical drive. You can use the df -h command to list the available mount points.

  1. Update the yum package cache by running the following command:
sudo yum makecache

This will create a local cache of the packages on the DVD or CD.

  1. You can now use the yum package manager to install packages from the DVD or CD repository. For example, to install the foo package:
sudo yum install foo

This will install the foo package from the DVD or CD repository.

Note: The steps and syntax for installing packages from a DVD or CD repository may vary depending on your specific system. Consult the documentation for your system for more information.

Using a DVD or CD as a repository can be useful in situations where you don't have access to a network repository, or if you want to install packages from a specific source. However, it's generally more convenient to use a network repository, as it allows you to install packages more easily and quickly.

Created Time:2017-10-16 14:38:41  Author:lautturi