Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Linux » Linux Error 13: Permission denied – Are you root
  • ADO Self hosted agent
    How to Create Self-Hosted Agent for Azure DevOps Pipelines Automation
  • MBAM report errors
    Understanding MBAM compliance state and error status Windows
  • RDP
    Fix Windows 11 Remote Desktop Connectivity Error code 0x204 Windows
  • Featured image 2
    Find and remove Malware with Microsoft Defender Offline Anti-Virus Solution
  • Featured image batch file.
    Retrieve Recent Windows Update: How to create batch script files Scripts
  • WSUS Analysis and Initial Assessment
    Preliminary Guide for WSUS Analysis and Initial Assessment Windows Server
  • Norton RDP
    Can’t connect via RDP upon installing Norton 360 Anti-Virus Solution
  • trip wire feature
    How to install and configure Tripwire on Ubuntu Linux

Linux Error 13: Permission denied – Are you root

Posted on 29/05/201621/01/2026 Christian By Christian No Comments on Linux Error 13: Permission denied – Are you root
Linux error

Linux Error 13: Permission denied – Are you root? signals that a process lacks the necessary privileges to access a file, directory, or resource, often prompting elevation to root. This errno 13 stems from Linux’s strict permission model, designed to enhance security by restricting operations on system-critical areas. Please, see how to Configure failover for ManageEngine Password Manager Pro, how to setup and configure Jitsi as SoftPhone, and Access EC2 Linux Instance via the Password.

What Causes It?

The encountered error message, “E: Could not open lock file /var/lib/dpkg/lock – open (13: Permission denied),” typically occurs when trying to perform package management tasks in Linux without the necessary root privileges. This issue, often denoted as “Linux Error 13,” indicates that the system is preventing access to the essential dpkg lock file, which is crucial for managing software packages.

Apt and dpkg require exclusive write access to directories like /var/lib/dpkg/ to manage package databases and locks, which non-root users cannot touch due to 644/755 permissions owned by root. Running as a normal user triggers errno 13 on open(), blocking the operation. This is common in fresh installs or when forgetting sudo after prior commands

This Linux Error 13 error simply means you are not the root user.

me@linuxbox ~#apt-get update
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Please, see How to fix unable to create a new VM on HyperV, how to Deny Execute Access: Restrict Access to USB Drives on Windows [Part 1], and how to Import certificates into Trusted Root and Personal certificate store.

Solution

Simply install it using the sudo to install any package as a root user. This occurs because you are using a normal user account. Therefore, prefix with sudo for temporary root escalation: sudo apt-get update && sudo apt-get upgrade refreshes lists and upgrades packages safely. If sudo prompts for a password and fails, verify your user is in the sudoers group via groups or add with usermod -aG sudo username (as root).

To reiterate, ensure that you have superuser privileges by using the “sudo” command before the package management operation. For instance, you can employ the following command: “sudo apt-get update” to refresh the package list. By appending “sudo” to your package management commands, you gain the necessary authorization to access system files and overcome the permission denied obstacle.

Please, see Install Minimal Container Templates on Proxmox Server, SimpleSAMLphp Setup on Windows Server [Part 1], and how to apply Windows Updates from WSUS to AWS Instances.

Prevention Tips for “Linux Error 13: Permission denied – Are you root”

Remember, maintaining proper permissions is vital for a secure and stable Linux system. So, whenever you encounter “Linux Error 13,” simply prepend “sudo” to your package management commands to ensure successful execution.

  • That is, always chain sudo for apt workflows: sudo apt update && sudo apt upgrade -y to avoid repetition.​
  • Check for stuck locks first: sudo rm /var/lib/dpkg/lock-frontend if another process hung (rare, but verify with ps aux | grep apt)
CommandPurposePrivilege Needed
apt-get updateFails with Error 13​sudo
sudo apt-get updateSucceeds, refreshes reposUser in sudoers
apt-get upgradeUpdates packagessudo

Sudo logs all commands in /var/log/auth.log for auditing, unlike full su shells. Ideal for business environments handling infrastructure. Avoid default root logins; configure sudo for least-privilege access to maintain stability and cybersecurity.

I hope you found this blogpost on “Linux Error 13: Permission denied – Are you root” very useful. Please, feel free to leave a comment below.

5/5 - (1 vote)

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Pocket (Opens in new window) Pocket
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Linux Tags:errno 13, errors, Linux distro, Linux Error 13, Permission, Permission denied - Are you root

Post navigation

Previous Post: How to extend Proxmox Local Container Storage
Next Post: How to remove Recent vSphere Client Connections

Related Posts

  • whois4578uh
    How to get Domain information using WHOIS Command in Linux Linux
  • zoom feature
    How to install Zoom video conference software on Linux System Linux
  • Screenshot 2021 02 14 at 00.35.50
    How to manage automatic login on Ubuntu Linux Linux
  • dns
    How to setup a cache-only DNS server Linux
  • mailx
    [MAILX ERROR: STATUS=BOUNCED] Fixing Mailx error when sending emails from Command line Linux
  • FEATURE IMAGE BASE URL 1
    How to solve cannot find a valid base URL for repo: base/7/x86_64 Linux

More Related Articles

whois4578uh How to get Domain information using WHOIS Command in Linux Linux
zoom feature How to install Zoom video conference software on Linux System Linux
Screenshot 2021 02 14 at 00.35.50 How to manage automatic login on Ubuntu Linux Linux
dns How to setup a cache-only DNS server Linux
mailx [MAILX ERROR: STATUS=BOUNCED] Fixing Mailx error when sending emails from Command line Linux
FEATURE IMAGE BASE URL 1 How to solve cannot find a valid base URL for repo: base/7/x86_64 Linux

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • ADO Self hosted agent
    How to Create Self-Hosted Agent for Azure DevOps Pipelines Automation
  • MBAM report errors
    Understanding MBAM compliance state and error status Windows
  • RDP
    Fix Windows 11 Remote Desktop Connectivity Error code 0x204 Windows
  • Featured image 2
    Find and remove Malware with Microsoft Defender Offline Anti-Virus Solution
  • Featured image batch file.
    Retrieve Recent Windows Update: How to create batch script files Scripts
  • WSUS Analysis and Initial Assessment
    Preliminary Guide for WSUS Analysis and Initial Assessment Windows Server
  • Norton RDP
    Can’t connect via RDP upon installing Norton 360 Anti-Virus Solution
  • trip wire feature
    How to install and configure Tripwire on Ubuntu Linux

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,832 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.