dnf and yum: can not find package

62,868

Solution 1

yum repolist will display the active repo list, I suspect the packages your looking for are not in the base/update/extras repositories and you may need to add additional repositories.

A good way to find out is to google search the package your looking for to get an idea of repository you need to have setup or install.

A lot of repositories do have a RPM file that will install the repository for your or a "how to" for adding the repository.


Examples below

Red Hat has made the documentation free to read
9.5.2. Setting [repository] Options

IUS repo setup
IUS Getting Started

yum repolist example:

Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
 * base: mirror.its.sfu.ca
 * extras: mirror.it.ubc.ca
 * updates: centos.mirror.rafal.ca
base                                                                                                                                                                                                                  | 3.6 kB  00:00:00     
extras                                                                                                                                                                                                                | 3.4 kB  00:00:00     
updates                                                                                                                                                                                                               | 3.4 kB  00:00:00     
(1/4): base/7/x86_64/group_gz                                                                                                                                                                                         | 166 kB  00:00:00     
(2/4): extras/7/x86_64/primary_db                                                                                                                                                                                     | 150 kB  00:00:00     
(3/4): updates/7/x86_64/primary_db                                                                                                                                                                                    | 3.6 MB  00:00:00     
(4/4): base/7/x86_64/primary_db                                                                                                                                                                                       | 5.9 MB  00:00:01     
repo id                                                                                                           repo name                                                                                                            status
base/7/x86_64                                                                                                     CentOS-7 - Base                                                                                                      9911
extras/7/x86_64                                                                                                   CentOS-7 - Extras                                                                                                     314
updates/7/x86_64                                                                                                  CentOS-7 - Updates                                                                                                    946
repolist: 11171

Solution 2

Have you tried yum search packageName ?

I have seen similar behavior from two other causes, DNS is not working or the cache is corrupted.

On that machine can you ping a host by name? i.e. ping google.com ?

If that works, try a yum clean all and then try to install your package when it is done.

Solution 3

I also encountered this issue and observed the following instructions after installing node:

curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo dnf install yarn

Check installation with

yarn -v
Share:
62,868

Related videos on Youtube

Faramarz
Author by

Faramarz

As a Back-End Developer and MSc student of Software Engineering, having 4+ years of experience with web application development using different tools and technologies including Laravel, MySQL, Vue.js, etc and specialization in developing scalable, maintainable, testable, clean coded and well documented applications.

Updated on September 18, 2022

Comments

  • Faramarz
    Faramarz almost 2 years

    As i run these commands to install any packages with yum or dnf:

    > sudo -c 'yum(or dnf) install [package name]'    
    > sudo yum(or dnf) install [package name]    
    

    I get this error:

    Last metadata expiration check: 0:01:34 ago on Thu 05 Jul 2018 12:27:36 AM +0430.    
    No match for argument: [package name]    
    Error: Unable to find a match
    

    Any solution?

    • thebtm
      thebtm almost 6 years
      what repositories do you have enabled? is it a package from epel?
    • Faramarz
      Faramarz almost 6 years
      @thebtm i don't know.i haven't touch anything but i'm sure the packages are available.
    • thebtm
      thebtm almost 6 years
      yum repolist will display the active repo list, I suspect the packages your looking for are not in the base/update/extras repositories and you may need to add additional repositories.
  • Faramarz
    Faramarz almost 6 years
    yes, actually i didn't know fedoras repositories does not support some packages which ubuntu does. searched and found that there's a RPM Fusion which support those packages (like MPV or Mocp) and need to be installed.