LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-27-2021, 02:27 AM   #1
nselx
LQ Newbie
 
Registered: Feb 2021
Posts: 23

Rep: Reputation: 0
local repo issue on Virtual BOX


Hi,

I have tried to create a local repository of Centos8 on virtual machine. I went through couple of articles and some youtube but it did not resolve the issue to make the repository for BaseOS and Appstream.After installation of centos8/rhel8 on VM, the drive /dev/sr0 does not show any iso file installed on it , running by command # df -h.
I tried to connect the image again on VM but the storage setting is gray out and am not able to connect the image. Please advice.
Oops: Do we really need to have a local repository of BaseOS and AppStrean while there is lack of space in our machine? In my case, I should be able to install packages from local repository with no internet access. Thanks!
 
Old 03-27-2021, 06:45 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I am not sure what your question is.

A few points that are unclear to me:
Why do you expect to see an ISO file on /dev/sr0? How can you use the df command to check for the presence of a file?
Which image did you try to connect, and precisely what is grayed out?
No, you don't need a local repository. Why do you want to create one? Why do you want to create one although you don't have enough space?

Rather than paraphrasing what you did, show the precise commands and their results.
 
Old 03-27-2021, 08:18 AM   #3
nselx
LQ Newbie
 
Registered: Feb 2021
Posts: 23

Original Poster
Rep: Reputation: 0
Thank you for your reply.

we need to install packages from (local?) repository since there is no internet access at the exam (redhat exam) so I managed to create a local repository BaseOS and Appstream/RHEL by manually adding an iso image to VM! The "df -h" command refuse to give any out on /dev/sr0 or /dev/cdrom-/media neither lsblk.
It appears at command "#yum repolist" that the repo has successfully been created.

So there are two questions at this point:
1-Can not still install yet the packages (i.e yum install zsh) the error standing for not being able to downalod meta data and to recognize hostname. Do we need to change /resolv.conf configuration file to be able to install packages from local repo? It seems that "install" command yet relying on the internet.
ps: Cleaning dnf cache did not help (#rm -r /var/cache/dnf neither yum clean all)

2- Is there any other alternative to install packages with no internet access at the exam? in case of no enough space.

Last edited by nselx; 03-27-2021 at 08:26 AM.
 
Old 03-27-2021, 10:35 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
If you have no space, you can't create a local repo.

Still waiting for the commands you use, and their output. df only lists mounted filesystems.
 
Old 03-27-2021, 05:31 PM   #5
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by nselx View Post
Is there any other alternative to install packages with no internet access at the exam? in case of no enough space.
Yum/dnf will always try to refresh metadata by default and does all the dependency resolving thus installing multiple latest available packages without much effort/input on your end.
You can disable all internet based repositories and only enable your local repo with commands:
Code:
dnf config-manager --set-disabled \*
dnf config-manager --set-enabled mylocalrepo
Theoretically now when you go to install a package with dnf, providing all dependencies are also in the local cache, it will only update metadata of your local repo and install the packages.

Another thing to consider, is to add the line below to /etc/dnf/dnf.conf to avoid updating metadata altogether:
Code:
metadata_expire=never
You can add that to /etc/yum.conf if you are using yum.

You can install local packages using rpm commands, the typical command structure to install an .rpm packaged is:
Code:
rpm -ivh package-name.rpm
If there are unmet dependencies that need to be installed first, it will come back and tell you what else needs to be installed. You will then use the same rpm -ivh command to install those needed packages first, then when you go to install the original package you want to install, it may install without issues or come back and tell you something else needs to be installed, to which you install it and eventually all dependencies will be installed and you can then successfully install the original intended package. But keep note of the version number of the packages it tells you need be installed, it can't be a different version.
 
Old 03-27-2021, 08:10 PM   #6
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by nselx View Post
Thank you for your reply.

we need to install packages from (local?) repository since there is no internet access at the exam (redhat exam) so I managed to create a local repository BaseOS and Appstream/RHEL by manually adding an iso image to VM! The "df -h" command refuse to give any out on /dev/sr0 or /dev/cdrom-/media neither lsblk.
It appears at command "#yum repolist" that the repo has successfully been created.

So there are two questions at this point:
1-Can not still install yet the packages (i.e yum install zsh) the error standing for not being able to downalod meta data and to recognize hostname. Do we need to change /resolv.conf configuration file to be able to install packages from local repo? It seems that "install" command yet relying on the internet.
ps: Cleaning dnf cache did not help (#rm -r /var/cache/dnf neither yum clean all)

2- Is there any other alternative to install packages with no internet access at the exam? in case of no enough space.
You need to setup a .repo file under /etc/yum.repos.d, and mount the dvd for a dvd iso repo, like the following steps:

https://www.itzgeek.com/how-tos/linu...using-dvd.html

or

https://www.linuxtechi.com/setup-loc...sitory-rhel-8/

Remember run the following dnf commands to confirm.

Code:
dnf clean all 

dnf repolist all
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual box repo is an html file Conotor Linux - Newbie 7 09-21-2017 08:14 AM
[SOLVED] Issues trying to install Virtual Box Guest Additions on RHEL v6.5 in Virtual Box JockVSJock Linux - Virtualization and Cloud 4 07-13-2015 09:14 PM
Slackware 13.37 and Virtual Box 4.1 / Virtual Box 4.012 chris_kzn Slackware 4 07-29-2011 01:51 AM
Running virtual pc files in a virtual machine in linux ... preferably virtual box biharibong Linux - Software 4 01-21-2009 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration