Creating Local Repository in CentOS Stream 9

I’m using CentOS-Stream-9 for my Linux VM.

/ is the directory I have my localrepo(which includes everything I have copied from my CentOS dvd.

Now, I want to create a local repository as thus

[root@MyFirstLinuxOS yum.repos.d]# vi local.repo

[centos-stream-9]
name=CentOS-Stream-9
baseurl=file:///localrepo/
enabled=1
gpgcheck=0

However, I get the errror
bash: createrepo: command not found ….
Failed to search for file: reposdata local was not complete: Cannot open /localrepo/repdata/repomd.xml: No such file or directory

What do I need to do to create the local repository, please?

Read more here: Source link