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

No package available

For example,

bash code
[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]#
[ad type=”banner”]

How do we make it work?

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.

  • 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:
    bash code
    $ 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
    [ad type=”banner”]

Categorized in: