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

Created on 27 Jun 2017  Â·  21Comments  Â·  Source: nodesource/distributions

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.

Most helpful comment

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 -

All 21 comments

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

Thanks for bringing this up and pointing out the fix @lkappeler . I'll need to look into a better fix for this going forward as you shouldn't have to remove that .repo file as an end user. I'm at re:Invent all week, but I'll try look at it as soon as I can (which will probably be early next week).

Was this closed because it's fixed? Happened to me in CentOS...

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 -

@chrislea @IdanAdar I think this issue should be reopened (don't know why it was closed). Happened to me when upgrading from Nodejs 7 to 8 on Centos 7.

@tedeh You you only need sudo yum clean all as a workaround, as was stated by @mikemaccana in his original message.

@vkotovv Running sudo yum clean all was not sufficient unfortunately.

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

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

The way of @tedeh works for me

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.

Even a year and a half after this ticket was opened, I was having this issue as well. Just running rm -rf /var/cache/yum as @tedeh suggested worked for me.

I am also facing same issue for latest version of node in CentOS, The latest version for particular user (In my case, osboxes) is v0.10.30
Whereas for root user, it is working fine, v10.15.0
I am not able to install latest version of node in osboxes user

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.

This helped with my issue. Thank you, Pradip.

On Tue, Feb 19, 2019 at 1:34 PM pradip_shenolkar notifications@github.com
wrote:

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 -

This solved my issue.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/nodesource/distributions/issues/486#issuecomment-465027273,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AUHz5lpfTyR0S_VyvlNeqbl8-KBNlfUwks5vO7AJgaJpZM4OHLXn
.

tedeh's fix worked for me as well

@tedeh My hero!

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

@tedeh thanks for the tip, got stung trying to install node 8.x and still ending-up getting old 4.x, your instructions saved the day.

Thanks for the information,

Regards
Ehtasham ul haq

On Thu, Aug 1, 2019 at 2:26 PM Sylvain Viguier notifications@github.com
wrote:

@tedeh https://github.com/tedeh thanks for the tip, got stung trying to
install node 8.x and still ending-up getting old 4.x, your instructions
saved the day.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/nodesource/distributions/issues/486?email_source=notifications&email_token=AJBTR4CCSIALB6PYJHCMUW3QCKT27A5CNFSM4DQ4WXT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3J6WKQ#issuecomment-517204778,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJBTR4ESSHAZBGX5H53NKDTQCKT27ANCNFSM4DQ4WXTQ
.

Unfortunately, none of the above worked for me to upgrade nodejs from 6.x to 12.x... I tried following and it worked for me on Centos 7:
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo sudo yum install yarn

Was this page helpful?
0 / 5 - 0 ratings