distributions: RHEL/CentOS packages don't update from node 6 to 8 properly (easy fix)

A RHEL/CentOS system with node 6 installed won’t upgrade properly to node 8.

  1. Install node 6 per https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora
  2. Later, install node 8 per https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora

What happens:

yum -y install nodejs still fetches the 6.x version

What should happen

yum -y install nodejs should install node 8

Fix

The scripts should add a yum clean all as the final step. After this, yum -y install nodejs will install node 8

This has happened on each of our main app nodes so we’re pretty confident it can be replicated easily.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 11
  • Comments: 22 (1 by maintainers)

Most upvoted comments

It did not work for me either. The last command I tried was rm -rf /var/cache/yum as root and that seemed to have done the trick. This was after doing this: (I can’t remember the exact order or which commands were significant):

/bin/rm -rf /var/cache/yum
/usr/bin/yum remove -y nodejs
/bin/rm /etc/yum.repos.d/nodesource*
/usr/bin/yum clean all
/usr/bin/curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -

Had to remove the /etc/yum.repos.d/nodesource-el.repo since the script is creating /etc/yum.repos.d/nodesource-el6.repo

It did not work for me either. The last command I tried was rm -rf /var/cache/yum as root and that seemed to have done the trick. This was after doing this: (I can’t remember the exact order or which commands were significant):

/bin/rm -rf /var/cache/yum
/usr/bin/yum remove -y nodejs
/bin/rm /etc/yum.repos.d/nodesource*
/usr/bin/yum clean all
/usr/bin/curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -

Thanks alot. This solved my issue.

Was this closed because it’s fixed? Happened to me in CentOS…

simply running yum remove -y nodejs was sufficient in my case.

For me, it works after using “/bin/rm /etc/yum.repos.d/nodesource*”

@chrislea Looks like this issue is not resolved… I think this issue should be reopened (don’t know why it was closed)

It did not work for me either. The last command I tried was rm -rf /var/cache/yum as root and that seemed to have done the trick. This was after doing this: (I can’t remember the exact order or which commands were significant):

/bin/rm -rf /var/cache/yum
/usr/bin/yum remove -y nodejs
/bin/rm /etc/yum.repos.d/nodesource*
/usr/bin/yum clean all
/usr/bin/curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -

Thank you @tedeh It was solved this way.