Step2: Go to the end of the file
Type in the following
Make sure the cd/dvd media is mounted on /media/cdrom
This tells yum to check /media/cdrom for the repository.
Note: If your cd/dvd media was auto-mounted. It’s likely at somewhere like:
/run/media/pier/”CentOS 7 x86_64″
Thus you should modify the line baseurl accordingly.
baseurl=file:///run/media/pier/"CentOS 7 x86_64"
Step 3: For the other repositories in the file, add
to disable all the other repositories. This is important particularly if you do not have internet connection. Else when yum tries to access the web-based repositories, yum update will fail.
You should be able to install stuff from the repository now. ie.
yum -y install vim