code-server icon indicating copy to clipboard operation
code-server copied to clipboard

[Bug]: RPM Install Should Include Upgrade Flag

Open shawnweeks opened this issue 3 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS/Web Information

  • Web Browser: All
  • Local OS: MacOS 12.4
  • Remote OS: Rocky 8
  • Remote Architecture: x86 64
  • code-server --version: 4.5.1 97d170331b51ee75c8e4bbdab23c755e3eeaaa8c with Code 1.68.1

The issue from https://github.com/coder/code-server/discussions/2347 has never been resolved. We should update our install script to include the -U option when doing upgrades otherwise every upgrade on an EL distro will require manually re-running the rpm command to apply the update

Steps to Reproduce

  1. Install code-server using curl -fsSL https://code-server.dev/install.sh | sh
  2. Wait for an update to come out
  3. Try an install the upgrade using the same command curl -fsSL https://code-server.dev/install.sh | sh

Expected

Upgrade should apply

Actual

Error messages like these

file /usr/lib/code-server/out/node/wsRouter.js from install of code-server-0:4.5.1-1.x86_64 conflicts with file from package code-server-0:4.4.0-1.x86_64
file /usr/lib/code-server/out/node/wsRouter.js.map from install of code-server-0:4.5.1-1.x86_64 conflicts with file from package code-server-0:4.4.0-1.x86_64
file /usr/lib/code-server/package.json from install of code-server-0:4.5.1-1.x86_64 conflicts with file from package code-server-0:4.4.0-1.x86_64
file /usr/lib/code-server/postinstall.sh from install of code-server-0:4.5.1-1.x86_64 conflicts with file from package code-server-0:4.4.0-1.x86_64
file /usr/lib/code-server/yarn.lock from install of code-server-0:4.5.1-1.x86_64 conflicts with file from package code-server-0:4.4.0-1.x86_64

Logs

No response

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • [X] I cannot reproduce this in VS Code.
  • [X] I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • [X] I am using HTTPS.

Notes

No response

shawnweeks avatar Jul 26 '22 17:07 shawnweeks

The issue from https://github.com/coder/code-server/discussions/2347 has never been resolved. We should update our install script to include the -U option when doing upgrades otherwise every upgrade on an EL distro will require manually re-running the rpm command to apply the update

I'm not as familiar with RPM. Are you suggesting we include the -U in our install script here?

If so, would you be interested in submitting a PR?

jsjoeio avatar Aug 01 '22 19:08 jsjoeio

Yeah, your rpm command should be rpm -U instead of rpm -i at https://github.com/coder/code-server/blob/main/install.sh#L367. The only difference between the two options is -U upgrades the package and removes the previous version if it's already installed otherwise it is the same as -i. This avoids the issue with files from the previous version conflicting with the new version. I'll see if I can workup a PR in the morning.

shawnweeks avatar Aug 01 '22 22:08 shawnweeks

Oh cool! TIL! Thanks for explaining that.

I'll see if I can workup a PR in the morning.

That would be awesome!

jsjoeio avatar Aug 03 '22 19:08 jsjoeio