• Skip to main content
  • Skip to primary navigation
  • Skip to footer

We use Google Analytics and Microsoft Clarity to see which articles help readers and where pages need work. They set cookies only if you agree. The site works the same either way. Privacy policy

TechLila Logo

TechLila

Bleeding Edge, Always

  • Android on PC

    Android on PC

    Full Android builds, emulators and what runs well on the hardware you have.

    All Android on PC guides

    Start with

    • Best Android OS for PC
    • Android OS for low-end PCs
    • Android OS for laptops
    • Emulators for Android games on PC
    • Run Android apps on a PC

    Also on Android

    • Android versions, with their names
    • Best Android dialer apps
    • Android launchers
    • Best Android ROMs
    • LineageOS review
  • PC Customization

    PC Customization

    Skins, themes, dark modes and sound tweaks that make Windows and your media players your own.

    All customization guides

    Start with

    • VLC skins
    • Windows 11 dark themes
    • Kodi skins
    • Windows 10 sound equalizers
    • Change folder colors in Windows

    Windows and VLC tweaks

    • Windows 11 debloat
    • Windows 10 tips and tricks
    • Free Windows tools
    • Install Windows 11 26H2
    • VLC shortcuts
  • Mac Apps

    Mac Apps

    Launchers, Setapp and the apps worth paying for on a Mac.

    All Mac app guides

    Start with

    • Best Mac apps
    • Raycast vs Spotlight
    • Raycast alternatives
    • Setapp review
    • Best Setapp apps
    • Run Windows apps on a Mac

    Apple in numbers

    • macOS market share
    • Mac gaming
    • Apple services revenue
    • Mac sales
    • macOS developers
  • Topics

    Topics

    Every TechLila guide, sorted by subject.

    All articles, newest first

    Computers

    • Windows
    • Mac
    • Linux
    • All computer guides

    Phones and the web

    • Android
    • iPhone
    • Internet
    • Technology
  • Deals and Offers
  • Contact
TechLila Logo
FacebookPostLinkedInPinShares99
Up Next

Delete Files Older than ‘x’ Days in Linux

Create Repository Step 1

TechLila

How to Create Repository in Linux

Last updated on September 9, 2019 UTC
Avatar of Guest Author Written by Guest Author

Today, we will show you how to create a repository in Linux. We know that we can install packages in Linux by using RPM (Red Hat Package Management) but the disadvantage is that by using RPM we can’t install packages which depend on other packages i.e dependencies. so in order to install packages which depend on other packages, we have to install packages by using YUM (Yellowdog Updater Modified). Actually, YUM is added from RHEL5 onwards. YUM uses a repository for installation. YUM automatically computes dependencies and figure out what things should occur to install packages. YUM can install, remove upgrade or query the packages.

See also
Linux Commands Cheat Sheet: Essential Commands Grouped by Task

How to Create Repository?

Follow these tips to add a local repository in your hard drive, here I am showing how to create repository in RHEL6.

Step 1: Create any folder i.e Directory

# mkdir /var/ftp/pub
Create Repository Step 1

Step 2: Move all RHEL DVD files to this directory /var/ftp/pub

# cd /var/ftp/pub
Create Repository Step 2

Step 3: Append the file localRepo:

# cd /etc/yum.repos.d
Create Repository Step 3

# vi localRepo.repo
Create Repository Step 4

[localRepo]
name=localRepo
baseurl=file:///var/ftp/pub
enabled=1
gpgcheck=0

:wq! (Save and Quit)
Create Repository Step 5

Step 4: Create repository

#cd /var/ftp/pub/Packages
Create Repository Step 6

#rpm -ivh createrepo* --force
Create Repository Step 7

Create Repository Step 8

#createrepo -g /var/ftp/pub/repodata/repomd.xml /var/ftp/pub/Packages
Create Repository Step 9

Create Repository Step 10

Step 5: Run following command

# yum clean all
Create Repository Step 11

To check out the list of installed packages use the following command:

# yum list installed

So this is all about how to create a repository. Actually, we make our system to know where the repository is located i.e index.

Following video is not created by me, this video is created by Tim Tan, so the procedure is bit difference, you can follow any procedure :)

Play video: How to setup a local YUM repository on RHEL6

This is a guest post by Harkesh Kumar He is a senior student of Computer Science and Engineering. He has good experience in Linux environment.

More on TechLila

  • Introduction to the Linux Kernel – Heart of Linux Operating System
  • Delete Files Older than ‘x’ Days in Linux
  • Linux Mint vs Ubuntu – Which Distro Should You Choose?

Sharing is Caring

FacebookPostLinkedInPinShares99
Avatar of Guest Author

Guest Author

    This guest post was written by a guest contributor.

    Category

    • Linux

    Tags

    Linux Commands, Linux Tutorials

    Reader Interactions

    What people are saying

    1. Phoenix

      Nice Post! Worked ya :D
      Anyways this works for every distro ?
      I have Arch Linux Installed and I work on that only :D

      Reply
      • Rajesh Namase

        This method will surely work on Red Hat, not sure about other distros.

        Reply
    2. Hassan

      Thank you for this useful information, i have only one probleme with linux is that a many of my fav software can’t find it with linux version only windows and mac, there is a way to make windows software work with linux? or maybe the company should make a linux version?
      Thank you Rajesh you have such a great website.

      Reply
      • Rajesh Namase

        You can use Wine software to run Windows software on Linux. Also you could ask the company to release Linux version.

        Reply

    Add Your Comment Cancel reply

    Comment (required)

    TechLila Footer Logo TechLila Footer Text Logo

    Footer

    About

    TechLila’s mission is to help you get more out of the computer and phone in front of you. Since September 2010 we have published practical guides, app comparisons and technology statistics for people who use Windows, Mac, Linux, Android and iPhone.

    Site Links

    • About
    • Contact Us
    • Brand Assets
    • Feedback Policy

    Standards

    • Editorial Policy
    • Fact-Check Policy
    • Corrections Policy
    • Ethics Policy
    • Stats Methodology
    • How We Test

    Legal

    • Privacy Policy
    • Terms
    • Disclaimer

    Copyright © 2010–2026 TechLila. All Rights Reserved. · Cookie settings

    Back to top