Scoop: Scoop update fails after install - Windows 7 & 10

Created on 6 May 2018  路  5Comments  路  Source: lukesampson/scoop

After a successful install in powershell, able to install 7zip and git too.

Then the update fails scoop update. I get error,

Move-Item : Access to the path 'C:\Users\user2\scoop\apps\scoop\new' is
denied.
At C:\Users\user2\scoop\apps\scoop\current\libexec\scoop-update.ps1:75
char:9
+         Move-Item $newdir $currentdir
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Users\user2\scoop\apps\scoop\
   new:DirectoryInfo) [Move-Item], IOException
    + FullyQualifiedErrorId : MoveDirectoryItemIOError,Microsoft.PowerShell.Co
   mmands.MoveItemCommand

Can't shim 'scoop.ps1': couldn't find 'C:\Users\user2\scoop\apps\scoop\curren
t\bin\scoop.ps1'.

when I try to install in Windows 10, it works fine, but fails in Windows 7. I tried in couple of Windows 7 machine. Any help is appreciated.

bug

Most helpful comment

It looks like the script .\scoop\apps\scoop\current\bin\scoop.ps1 is trying to move .\scoop\apps\scoop\new to .\scoop\apps\scoop\current. After this fails, the .\scoop\apps\scoop\current directory is missing (presumably it gets removed) which leaves scoop in a non-working state.

Manually renaming the new directory to current gets things going again (and scoop is now up-to-date).

All 5 comments

I can reproduce on Windows 10 also. A fresh install of Scoop followed by scoop update command produces the following:

PS C:\Users\rs\scoop> iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
Initializing...
Downloading...
Extracting...
Creating shim...
Scoop was installed successfully!
Type 'scoop help' for instructions.
PS C:\Users\rs\scoop> scoop update
Updating Scoop...
Move-Item : Access to the path 'C:\Users\rs\scoop\apps\scoop\new' is denied.
At C:\Users\rs\scoop\apps\scoop\current\libexec\scoop-update.ps1:75 char:9
        Move-Item $newdir $currentdir
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo          : WriteError: (C:\Users\rs\scoop\apps\scoop\new:DirectoryInfo) [Move-Item], IOException
FullyQualifiedErrorId : MoveDirectoryItemIOError,Microsoft.PowerShell.Commands.MoveItemCommand

Seems the default Scoop installation is in "\scoop\apps\scoopcurrent\".
During update process the updated app will reside in "\scoop\apps\scoopnew\".
At some point the "current" folder is deleted and the shim (shims\scoop.ps1) refers to non-existent location "..\apps\scoopcurrent\bin\scoop.ps1".

I can finish the update by renaming "\scoop\apps\scoopnew\" to "\scoop\apps\scoopcurrent\" and then running scoop update again. After this I have no idea if the installation is valid anymore. Shouldn't Scoop use versioning of directories as it does for other apps?

This is happening to me as well.

```PS C:\Users\joshlsullivan> scoop update *
Latest versions for all apps are installed! For more information try 'scoop status'
PS C:\Users\joshlsullivan> scoop status
WARN Scoop is out of date. Run 'scoop update' to get the latest changes.
PS C:\Users\joshlsullivan> scoop update
Updating Scoop...
Move-Item : Access to the path 'C:\Users\joshlsullivan\scoop\apps\scoopnew' is denied.
At C:\Users\joshlsullivan\scoop\apps\scoopcurrent\libexec\scoop-update.ps1:78 char:9

  • Move-Item $newdir $currentdir
  • ~~~~~~~~~

    • CategoryInfo : WriteError: (C:\Users\joshls...\apps\scoopnew:DirectoryInfo) [Move-Item], IOException

    • FullyQualifiedErrorId : MoveDirectoryItemIOError,Microsoft.PowerShell.Commands.MoveItemCommand

Can't shim 'scoop.ps1': couldn't find 'C:\Users\joshlsullivan\scoop\apps\scoopcurrent\bin\scoop.ps1'.```

Here is it trying to update before installing a package:

```PS C:\Users\joshlsullivan> scoop install postman
Updating Scoop...
Move-Item : Access to the path 'C:\Users\joshlsullivan\scoop\apps\scoopnew' is denied.
At C:\Users\joshlsullivan\scoop\apps\scoopcurrent\libexec\scoop-update.ps1:78 char:9

  • Move-Item $newdir $currentdir
  • ~~~~~~~~~

    • CategoryInfo : WriteError: (C:\Users\joshls...\apps\scoopnew:DirectoryInfo) [Move-Item], IOException

    • FullyQualifiedErrorId : MoveDirectoryItemIOError,Microsoft.PowerShell.Commands.MoveItemCommand

Can't shim 'scoop.ps1': couldn't find 'C:\Users\joshlsullivan\scoop\apps\scoopcurrent\bin\scoop.ps1'.
You cannot call a method on a null-valued expression.
At C:\Users\joshlsullivan\scoop\apps\scoopcurrent\lib\depends.ps1:27 char:12

  • if(!(buckets).Contains($bucket)) {
  • ~~~~~~~~

    • CategoryInfo : InvalidOperation: (:) [], RuntimeException

    • FullyQualifiedErrorId : InvokeMethodOnNull

Couldn't find manifest for 'postman'.
PS C:\Users\joshlsullivan> scoop
& : The term 'C:\Users\joshlsullivan\scoop\shims..\apps\scoopcurrent\bin\scoop.ps1' is not recognized as the name of
a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At C:\Users\joshlsullivan\scoop\shims\scoop.ps1:2 char:71

  • ... on.expectingInput) { $input | & $path @args } else { & $path @args ...
  • ~

    • CategoryInfo : ObjectNotFound: (C:\Users\joshls...t\bin\scoop.ps1:String) [], CommandNotFoundException

    • FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\joshlsullivan> scoop help
& : The term 'C:\Users\joshlsullivan\scoop\shims..\apps\scoopcurrent\bin\scoop.ps1' is not recognized as the name of
a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At C:\Users\joshlsullivan\scoop\shims\scoop.ps1:2 char:71

  • ... on.expectingInput) { $input | & $path @args } else { & $path @args ...
  • ~

    • CategoryInfo : ObjectNotFound: (C:\Users\joshls...t\bin\scoop.ps1:String) [], CommandNotFoundException

    • FullyQualifiedErrorId : CommandNotFoundException

      ```

It looks like the script .\scoop\apps\scoop\current\bin\scoop.ps1 is trying to move .\scoop\apps\scoop\new to .\scoop\apps\scoop\current. After this fails, the .\scoop\apps\scoop\current directory is missing (presumably it gets removed) which leaves scoop in a non-working state.

Manually renaming the new directory to current gets things going again (and scoop is now up-to-date).

Just a note this is still an issue as of a fresh first time install today.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jpoehls picture jpoehls  路  3Comments

SinisterBlade picture SinisterBlade  路  3Comments

muhlpachr picture muhlpachr  路  3Comments

bernstein82 picture bernstein82  路  3Comments

quantuumsnot picture quantuumsnot  路  3Comments