Templating: dotnet error : Unable to obtain lock file access on '/tmp/NuGetScratch/lock/...

Created on 15 Jan 2020  路  1Comment  路  Source: dotnet/templating

Steps to reproduce

dotnet build or dotnet run

Expected behavior

Run or Build app

Actual Behavior

Getting ready...
The template "ASP.NET Core with Angular" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /home/limup/Documents/Projetos/Limup/salao/salao.csproj...
/usr/share/dotnet/sdk/3.1.101/NuGet.targets(123,5): error : Unable to obtain lock file access on '/tmp/NuGetScratch/lock/b19d3901039706ea82571abad7c98ec690508d4b' for operations on '/home/limup/Documents/Projetos/Limup/salao/obj/salao.csproj.nuget.cache'. This may mean that a different user or administator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file '/tmp/NuGetScratch/lock/b19d3901039706ea82571abad7c98ec690508d4b' will allow NuGet to continue. [/home/limup/Documents/Projetos/Limup/salao/salao.csproj]

Restore failed.
Post action failed.
Description: Restore NuGet packages required by this project.
Manual instructions: Run 'dotnet restore'

Environment Data

dotnet --info

.NET Core SDK (reflecting any global.json):
Version: 3.1.101
Commit: b377529961

Runtime Environment:
OS Name: fedora
OS Version: 31
OS Platform: Linux
RID: fedora.31-x64
Base Path: /usr/share/dotnet/sdk/3.1.101/

Host (useful for support):
Version: 3.1.1
Commit: a1388f194c

.NET Core SDKs installed:
3.1.101 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

Obs

Tried Fixes put in dotnet restore, but I received the same error.

Did not have this problem with dotnet sdk 2.0.

Most helpful comment

Guys!
I fixed this with commands below:

export TMPDIR=/tmp/NuGetScratch/
mkdir -p ${TMPDIR}

See ya!

>All comments

Guys!
I fixed this with commands below:

export TMPDIR=/tmp/NuGetScratch/
mkdir -p ${TMPDIR}

See ya!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mhutch picture mhutch  路  5Comments

RehanSaeed picture RehanSaeed  路  8Comments

jamiewest picture jamiewest  路  3Comments

divinebovine picture divinebovine  路  4Comments

livarcocc picture livarcocc  路  3Comments