Skip to content

failed to open lockfile: [13] Permission denied #23360

Closed

Description

@iluuu1994

When trying to build Rust I'm getting the following error:

thread '<unnamed>' panicked at 'failed to open lockfile: [13] Permission denied', /Users/ilijatovilo/Documents/Developer/Clones/rust/src/librustdoc/flock.rs:124
thread '<main>' panicked at 'child thread None panicked', /Users/ilijatovilo/Documents/Developer/Clones/rust/src/libstd/thread.rs:661
make: *** [doc/rustc/index.html] Error 101
make: *** [install] Error 2

This happens on make install, both the ./configure and make work fine.
I've ran the commands with root privileges.

Any idea what going on here? Thanks!

Activity

  1. cad106uk commented on Mar 27, 2015

    @cad106uk

    I am getting this error as well. I am running this on Fedora core 21. Everything is find until I try to run make install. Running this as root does not help

    thread '<unnamed>' panicked at 'failed to open lockfile: Permission denied (os error 13)', /home/ciaran/Documents/rust/rust/src/librustdoc/flock.rs:124 thread '<main>' panicked at 'child thread None panicked', /home/ciaran/Documents/rust/rust/src/libstd/thread/mod.rs:726 /home/ciaran/Documents/rust/rust/mk/docs.mk:261: recipe for target 'doc/libc/index.html' failed make[1]: *** [doc/libc/index.html] Error 101 make[1]: Leaving directory '/home/ciaran/Documents/rust/rust' /home/ciaran/Documents/rust/rust/mk/install.mk:22: recipe for target 'install' failed make: *** [install] Error 2

  2. tomleb commented on Mar 29, 2015

    @tomleb

    Same happened to me, any idea?

  3. cad106uk commented on Mar 30, 2015

    @cad106uk

    This problem is now fixed for me. The sha f002640 on the beta branch now works for me.

    Thanks for the fix.

  4. iluuu1994 commented on Apr 17, 2015

    @iluuu1994
    ContributorAuthor

    The beta branch must've been merged into master but the issue persists for me...

  5. tomleb commented on Apr 24, 2015

    @tomleb

    First running 'make' alone and then running 'sudo make install' solved it for me.

  6. steveklabnik commented on Dec 18, 2015

    @steveklabnik
    Contributor

    Is this still a problem?

  7. iluuu1994 commented on Dec 18, 2015

    @iluuu1994
    ContributorAuthor

    @steveklabnik Let me try

  8. iluuu1994 commented on Dec 19, 2015

    @iluuu1994
    ContributorAuthor

    It's now working with sudo. The error seems to result from lacking privileges to the /usr/local/share/doc/rust/html directory.

    install: WARNING: unable to remove directory /usr/local/share/doc/rust/html
    override rw-r--r--  root/admin for /usr/local/lib/rustlib/manifest-rust-docs? yes
    install: creating uninstall script at /usr/local/lib/rustlib/uninstall.sh
    install: installing component 'rust-docs'
    install: backing up existing file at /usr/local/share/doc/rust/html
    mv: rename /usr/local/share/doc/rust/html to /usr/local/share/doc/rust/html.old: Permission denied
    install: error: failed to back up /usr/local/share/doc/rust/html. see logs at '/usr/local/lib/rustlib/install.log'
    make: *** [install] Error 1
    

    It's fine by me if you close this issue. Not sure if the error above has to do with my broken setup (since I've tried to build rust the first time with sudo which would've lead to the lacking privileges) or if this is an issue for other people as well.

  9. Mark-Simulacrum commented on Apr 29, 2017

    @Mark-Simulacrum
    Member

    I am closing this as an old issue with no actionable steps. If anyone can reproduce this issue, please reopen with concrete steps to reproduce. It seems the primary issue here is that make install didn't/doesn't work without sudo, which seems fine to me, since that's common across many programs AFAIK.

  10. added a commit that references this issue on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions