2

How to install and update packages from DVD which I mounted? What I do so far is to mount the DVD.

#mount -r -t iso9660 /dev/sr0 /mnt/DVD

So now is there a way to update it automatic all packets or I must do one by one? For example:

yum --disablerepo=\* --enablerepo=DVD install ....

UPDATE: This is content of /etc/yum.repos.d/local.repo

[DVDRepo]
name=Local DVD Repository
baseurl=file:///mnt/DVD
enabled=1
gpgcheck=1
S.I.
  • 198
  • 3
  • 14

1 Answers1

4

first you have to create a repo file for your new repo (the dvd) For example a file called /etc/yum.repos.d/dvd.repo

[dvd]
name=Local DVD Repository
baseurl=file:///mnt/DVD
enabled=1
gpgcheck=1

Then you should disable your other repos and update, and you'll be able to run a yum update from there.

Pierre-Alain TORET
  • 1,254
  • 8
  • 14
  • Sorry for my late comment and thanks for your answer. I have updated my question with content of the repo file. When I run `yum update` I got this: `Loaded plugins: fastestmirror` and `file:///mnt/DVD/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for DVDRepo: Damaged repomd.xml file` – S.I. Dec 14 '15 at 08:45
  • my bad I used my knowledge about old RedHat dvd to write the answer, I've tried with a new CentOS 7 DVD and updated my answer. – Pierre-Alain TORET Dec 14 '15 at 09:15
  • I have name `name=Local DVD Repository` – S.I. Dec 14 '15 at 09:27
  • ah right, I will edit my answer. – Pierre-Alain TORET Dec 14 '15 at 09:28
  • So you mean that I must remove `gpgcheck=1` from my file? – S.I. Dec 14 '15 at 09:35
  • no you should keep it, I will edit again – Pierre-Alain TORET Dec 14 '15 at 09:39
  • Yes, that's the content of my file. Yet, now when I do `yum update` I got the error: `Loaded plugins: fastestmirror` and `file:///mnt/DVD/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for DVDRepo: Damaged repomd.xml file` – S.I. Dec 14 '15 at 09:40
  • which version of CentOS and what DVD file do you have ? – Pierre-Alain TORET Dec 14 '15 at 09:41
  • `CentOS Linux release 7.0.1406 (Core)` and DVD inserted is `Everything.iso` which contain rpm's which I want to install/update – S.I. Dec 14 '15 at 09:45
  • okay I used the regular DVD Iso, let me time to download the everything iso and I'll update – Pierre-Alain TORET Dec 14 '15 at 09:50
  • Okay the iso has exactly the same behaviour as the other one, are you sure your iso is valid ? Did you md5 it ? Also could you list it's content ? it should have a repodata directory in the /mnt/DVD once mounted. – Pierre-Alain TORET Dec 14 '15 at 10:10
  • I can navigate to the dvd. Also I can `ls` it. Also I can see and go in directory `repodata` ... But I don't know exactly what you mean by `Did you md5 it ?` How can I do this? – S.I. Dec 14 '15 at 10:13
  • the repodata is where the database of packages is stored, so that's what yum is trying to gather to offer you the list of packages to install. In your case it seems that dir is corrupted. md5 is a checksum, it's used to make sure that your dvd file is not corrupted while transfered over networks. the provider of the iso gives you what he gets being sure it's not corrupted and you can verify yours by typing `md5sum Everything.iso` the problem with your iso is that we can't really know which version it is, so it's hard to find the appropriate md5sum to compare to. – Pierre-Alain TORET Dec 14 '15 at 10:18
  • is there a specific need for using that iso and not the internet repository ? you might try a `yum clean all` and then `yum makecache` again – Pierre-Alain TORET Dec 14 '15 at 10:18
  • `is there a specific need for using that iso and not the internet repository ?` Yes, because the machine doesn't have internet... – S.I. Dec 14 '15 at 11:21
  • okay, then maybe you should try re-downloading this iso again, as it might be corrupted. – Pierre-Alain TORET Dec 14 '15 at 12:18
  • CentOS 7.2 is out already! It's not really "updating" if you're 18 months behind! – Michael Hampton Dec 14 '15 at 12:37
  • Thank's but is not the question the version. I mean since I use 7 and going this hard way to update it.. may be I have some reasons for that. – S.I. Dec 14 '15 at 12:48
  • what did you change ? – Pierre-Alain TORET Dec 14 '15 at 14:47