20

Whenever I want to use command yum install <packagename> I get error:

No package available

For example,

[root@cpanel1 etc]# yum install autossh Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.t-2.net * extras: centos.t-2.net * updates: centos.t-2.net No package autossh available. Error: Nothing to do [root@cpanel1 etc]# 

How do I make it work?

13
  • The package name is correct? if you search it with "yum search autossh" ? Commented Jul 25, 2016 at 10:48
  • 2
    Ok so you have all the repository disabled, for sure base and updates should have "enabled = 1" Commented Jul 25, 2016 at 11:11
  • 1
    @Kunok that's right, please change it and do yum update Commented Jul 25, 2016 at 11:20
  • 1
    I'm curious, why did you disable all your repos? Commented Jul 25, 2016 at 16:22
  • 2
    @Kunok: Hmm, guess someone's trying to lock it down then. It might be worth contacting them and finding out why, before you break everything. :) Commented Jul 25, 2016 at 16:52

6 Answers 6

24

These steps might help you,

  1. yum clean all & yum clean metadata

  2. Check the files in /etc/yum.repos.d and make sure that they don't all have enabled = 0 for each repo (there may be more than one per file).

  3. Finally you would be able to do yum update and search for desired packages.

9

For CentOS/RHEL 7, autossh is no longer available in Repoforge repository. So you will need to build and compile it from the source, here is what you should do:

$ sudo yum install wget gcc make $ wget http://www.harding.motd.ca/autossh/autossh-1.4e.tgz $ tar -xf autossh-1.4e.tgz $ cd autossh-1.4e $ ./configure $ make $ sudo make install 
2
  • 1
    Thanks, this worked well. In the meantime the original question (why yum doesn't install packages) was answered in the comments. Commented Jul 25, 2016 at 12:06
  • 4
    Don't build it from source. autossh.el7 is in EPEL. Install it from there, using yum. Commented Jul 25, 2016 at 16:21
5

First install EPEL(Extra Packages for Enterprise Linux), then install your need packagename

$ yum -y install epel-release $ yum -y install autossh 
1
  • What if epel-release itself shows up as "No package available"? Commented Mar 27 at 19:53
0

autossh is also available with epel repo:

# mkdir /usr/src/epel && cd "$_" # wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm # rpm -ihv epel-release-7-10.noarch.rpm # yum install autossh 
3
  • if rpm -ihv epel-release-7-10.noarch.rpm Preparing... ################################# [100%] package epel-release-7-10.noarch is already installed How reinstall epel-release-7-10.noarch.rpm? Commented Sep 20, 2017 at 10:11
  • If the repo is already existing, then you can try directly yum install autossh, if this is not working you may consider running yum clean all and trying again. Commented Sep 21, 2017 at 14:29
  • 1
    Simpler and more secure to yum install epel-release instead of wgetting a file over plain HTTP. Commented Oct 19, 2017 at 8:22
0

You should also check /etc/yum.conf file or /etc/yum.repos.d/ files to make sure your package is not excluded in yum.

exclude=apache* httpd* mod_* mysql* MySQL* mariadb* da_* *ftp* exim* sendmail* php* bind-chroot* dovecot* 
0

Note that autossh package is available with the "epel" repository. To install it:

# mkdir /usr/src/epel && cd "$_" # wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm # rpm -ihv epel-release-7-10.noarch.rpm # yum install autossh 

This answer may be generalized for other packages in the "epel" distribution.

1
  • Please clarify what this is supposed to do and why it will solve the asker's problem. (Hint: It actually won't) Commented Oct 10, 2017 at 9:55

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.