16.04 - Could not open lock file /var/lib/dpkg/lock-frontend - open (2: No such file or directory) - Ask Ubuntu (https://cdn.sstatic.net/Sites/askubuntu/Img/apple-touch-icon.png?v=e16e1315edd6) (Ask Ubuntu) (https://askubuntu.com/opensearch.xml) (https://askubuntu.com/questions/1141719/could-not-open-lock-file-var-lib-dpkg-lock-frontend-open-2-no-such-file-or) (site logo) Join Ask Ubuntu By clicking “Sign up”, you agree to our (https://askubuntu.com/legal/terms-of-service/public) terms of service and acknowledge you have read our (https://askubuntu.com/legal/privacy-policy) privacy policy . Sign up with Google OR Email Password (8+ characters (at least 1 letter & 1 number)) Sign up Already have an account? (https://askubuntu.com/users/login) Log in Skip to main content (Search on Ask Ubuntu…) (https://askubuntu.com/help) (Help Center and other resources) (https://stackexchange.com/) (A list of all 183 Stack Exchange sites) (Click to show search) (https://askubuntu.com/users/login?ssrc=head&returnurl=https%3a%2f%2faskubuntu.com%2fquestions%2f1141719%2fcould-not-open-lock-file-var-lib-dpkg-lock-frontend-open-2-no-such-file-or) Log in (https://askubuntu.com/users/signup?ssrc=head&returnurl=https%3a%2f%2faskubuntu.com%2fquestions%2f1141719%2fcould-not-open-lock-file-var-lib-dpkg-lock-frontend-open-2-no-such-file-or) Sign up (https://askubuntu.com/) (Ask Ubuntu) (https://askubuntu.com/) Home (https://askubuntu.com/questions) Questions (https://askubuntu.com/unanswered) Unanswered (https://stackoverflow.ai/) AI Assist Labs (https://askubuntu.com/tags) Tags (https://chat.stackexchange.com/rooms/158962/stack-exchange-lobby) Chat (https://askubuntu.com/users) Users (https://stackoverflow.com/jobs/companies?so_medium=askubuntu&so_source=SiteNav) Companies Teams Ask questions, find answers and collaborate at work with Stack Overflow for Teams. (https://stackoverflowteams.com/teams/create/free/?utm_medium=referral&utm_source=askubuntu-community&utm_campaign=side-bar&utm_content=explore-teams) Try Teams for free (https://stackoverflow.co/teams/?utm_medium=referral&utm_source=askubuntu-community&utm_campaign=side-bar&utm_content=explore-teams) Explore Teams (Illustration of upvote icon after it is clicked) Hang on, you can't upvote just yet. You'll need to complete a few actions and gain 15 reputation points before being able to upvote. Upvoting indicates when questions and answers are useful. (https://stackoverflow.com/help/whats-reputation) What's reputation and how do I get it? Instead, you can save this post to reference later. Save this post for later Not now (Illustration of upvote icon after it is clicked) Thanks for your vote! You now have 5 free votes weekly. Free votescount toward the total vote score does not give reputation to the author Continue to help good content that is interesting, well-researched, and useful, rise to the top! To gain full voting privileges, (https://askubuntu.com/help/whats-reputation) earn reputation . Got it! Go to help center to learn more (https://cdn.sstatic.net/Sites/askubuntu/Img/apple-touch-icon.png?v=e16e1315edd6) (https://askubuntu.com/questions/1141719/could-not-open-lock-file-var-lib-dpkg-lock-frontend-open-2-no-such-file-or) Could not open lock file /var/lib/dpkg/lock-frontend - open (2: No such file or directory) [duplicate] (https://askubuntu.com/questions/ask) Ask Question (2019-05-09 07:27:17Z) Asked 6 years, 4 months ago Modified (https://askubuntu.com/questions/1141719/could-not-open-lock-file-var-lib-dpkg-lock-frontend-open-2-no-such-file-or?lastactivity) (2022-07-22 02:08:05Z) 3 years, 2 months ago (Viewed 16,780 times) Viewed 17k times This question shows research effort; it is useful and clear 3 (This question does not show any research effort; it is unclear or not useful) Save this question. (https://askubuntu.com/posts/1141719/timeline) Show activity on this post. This question already has answers here : (https://askubuntu.com/questions/223484/permission-denied-are-you-root) Permission denied, are you root? (7 answers) Closed (2022-07-22 04:41:13Z) 3 years ago . I am trying to run sudo apt-get upgrade but it is showing the below error message: E: Could not open lock file /var/lib/dpkg/lock-frontend - open (2: No such file or directory) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root? Here are the solutions I have tried : I have tried, "sudo apt-get update" I have also tried to delete the locked files using the commands: sudo rm -r /var/lib/dpkg/lock-frontend sudo rm -rf /var/lib/dpkg/lock but it is showing the error that "no so such file or directory". I tried to kill all the running process using the command: ps aux | grep -i apt sudo kill -9 sudo killall apt apt-get How can I solve this issue? (https://askubuntu.com/questions/tagged/16.04) (show questions tagged '16.04') 16.04 (https://askubuntu.com/questions/tagged/apt) (show questions tagged 'apt') apt (https://askubuntu.com/questions/tagged/updates) (show questions tagged 'updates') updates (https://askubuntu.com/questions/tagged/dpkg) (show questions tagged 'dpkg') dpkg (https://askubuntu.com/q/1141719) (Short permalink to this question) Share (https://askubuntu.com/posts/1141719/edit) Improve this question Follow Follow this question to receive notifications (https://askubuntu.com/posts/1141719/revisions) (show all edits to this post) edited (2019-05-09 07:36:36Z) May 9, 2019 at 7:36 (https://askubuntu.com/users/816190/kulfy) (Kulfy's user avatar) (https://askubuntu.com/users/816190/kulfy) Kulfy (reputation score 18,163) 18.2k (26 gold badges) 26 26 gold badges (72 silver badges) 72 72 silver badges (111 bronze badges) 111 111 bronze badges asked (2019-05-09 07:27:17Z) May 9, 2019 at 7:27 (https://askubuntu.com/users/954204/subhanshu-kumar) (Subhanshu Kumar's user avatar) (https://askubuntu.com/users/954204/subhanshu-kumar) Subhanshu Kumar Subhanshu Kumar (reputation score) 31 (1 gold badge) 1 1 gold badge (1 silver badge) 1 1 silver badge (2 bronze badges) 2 2 bronze badges 8 What is the output of ls -l /vat/lib/dpkg/ ? Looks like something is missing. Kulfy – (https://askubuntu.com/users/816190/kulfy) (18,163 reputation) Kulfy 2019-05-09 07:40:58 +00:00 Commented (2019-05-09 07:40:58Z, License: CC BY-SA 4.0) May 9, 2019 at 7:40 it is showing the error message: ls: cannot access '/vat/lib/dpkg/': No such file or directory Subhanshu Kumar – (https://askubuntu.com/users/954204/subhanshu-kumar) (31 reputation) Subhanshu Kumar 2019-05-09 07:47:33 +00:00 Commented (2019-05-09 07:47:33Z, License: CC BY-SA 4.0) May 9, 2019 at 7:47 Oh sorry for the typo. It's ls -l /var/lib/dpkg/ . Kulfy – (https://askubuntu.com/users/816190/kulfy) (18,163 reputation) Kulfy 2019-05-09 07:50:22 +00:00 Commented (2019-05-09 07:50:22Z, License: CC BY-SA 4.0) May 9, 2019 at 7:50 (this comment was edited 1 time) same error message .. : ls: cannot access '/var/lib/dpkg/': No such file or directory Subhanshu Kumar – (https://askubuntu.com/users/954204/subhanshu-kumar) (31 reputation) Subhanshu Kumar 2019-05-09 07:51:49 +00:00 Commented (2019-05-09 07:51:49Z, License: CC BY-SA 4.0) May 9, 2019 at 7:51 (number of 'useful comment' votes received) 2 Try this sudo mkdir -p /var/lib/dpkg/{alternatives,info,parts,triggers,updates}; sudo touch /var/lib/dpkg/status; sudo apt install dpkg Kulfy – (https://askubuntu.com/users/816190/kulfy) (18,163 reputation) Kulfy 2019-05-09 08:56:51 +00:00 Commented (2019-05-09 08:56:51Z, License: CC BY-SA 4.0) May 9, 2019 at 8:56 (Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.) | (Expand to show all comments on this post) Show 3 more comments 2 Answers 2 Sorted by: (https://askubuntu.com/questions/1141719/could-not-open-lock-file-var-lib-dpkg-lock-frontend-open-2-no-such-file-or?answertab=scoredesc#tab-top) Reset to default (scoredesc) Highest score (default) (modifieddesc) Date modified (newest first) (createdasc) Date created (oldest first) This answer is useful 1 (This answer is not useful) Save this answer. (Loading when this answer was accepted…) (https://askubuntu.com/posts/1346009/timeline) Show activity on this post. The right solution is pasted below, run the below commands and it should fix the problem. sudo mkdir -p /var/lib/dpkg/{alternatives,info,parts,triggers,updates} sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status apt-get download dpkg sudo dpkg -i dpkg*.deb apt-get download base-files sudo dpkg -i base-files*.deb sudo apt-get update sudo apt-get check (https://askubuntu.com/a/1346009) (Short permalink to this answer) Share (https://askubuntu.com/posts/1346009/edit) Improve this answer Follow Follow this answer to receive notifications (https://askubuntu.com/posts/1346009/revisions) (show all edits to this post) edited (2021-06-15 10:02:07Z) Jun 15, 2021 at 10:02 (https://askubuntu.com/users/614422/soren-a) (Soren A's user avatar) (https://askubuntu.com/users/614422/soren-a) Soren A (reputation score) 7,190 (2 gold badges) 2 2 gold badges (22 silver badges) 22 22 silver badges (37 bronze badges) 37 37 bronze badges answered (2021-06-15 09:56:50Z) Jun 15, 2021 at 9:56 (https://askubuntu.com/users/1329794/suhas-r) (Suhas R's user avatar) (https://askubuntu.com/users/1329794/suhas-r) Suhas R Suhas R (reputation score) 11 (1 bronze badge) 1 1 bronze badge 1 it worked perfectly, should be an accepted answer Alexander Kozachenko – (https://askubuntu.com/users/1010759/alexander-kozachenko) (133 reputation) Alexander Kozachenko 2024-02-26 19:59:52 +00:00 Commented (2024-02-26 19:59:52Z, License: CC BY-SA 4.0) Feb 26, 2024 at 19:59 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) This answer is useful 0 (This answer is not useful) Save this answer. (Loading when this answer was accepted…) (https://askubuntu.com/posts/1141735/timeline) Show activity on this post. You most likely have another process that is using the package manager. Close any other terminal instances and any GUI package managers. If you are not sure which process/program currently has those privileges, a reboot should fix the problem. (https://askubuntu.com/a/1141735) (Short permalink to this answer) Share (https://askubuntu.com/posts/1141735/edit) Improve this answer Follow Follow this answer to receive notifications answered (2019-05-09 08:12:46Z) May 9, 2019 at 8:12 (https://askubuntu.com/users/953041/caleb) (Caleb's user avatar) (https://askubuntu.com/users/953041/caleb) Caleb Caleb (reputation score) 41 (1 gold badge) 1 1 gold badge (1 silver badge) 1 1 silver badge (4 bronze badges) 4 4 bronze badges 0 (Use comments to ask for more information or suggest improvements. Avoid comments like “+1” or “thanks”.) Add a comment | (Expand to show all comments on this post) Start asking to get answers Find the answer to your question by asking. (https://askubuntu.com/questions/ask) Ask question Explore related questions (https://askubuntu.com/questions/tagged/16.04) (show questions tagged '16.04') 16.04 (https://askubuntu.com/questions/tagged/apt) (show questions tagged 'apt') apt (https://askubuntu.com/questions/tagged/updates) (show questions tagged 'updates') updates (https://askubuntu.com/questions/tagged/dpkg) (show questions tagged 'dpkg') dpkg See similar questions with these tags. The Overflow Blog (https://stackoverflow.blog/2025/09/24/the-history-and-future-of-software-development-part-1/?cb=1) The history and future of software development (part 1) (https://stackoverflow.blog/2025/09/26/getting-backstage-in-front-of-a-shifting-dev-experience/?cb=1) Getting Backstage in front of a shifting dev experience Featured on Meta (Meta Stack Exchange) (https://meta.stackexchange.com/questions/412667/spevacus-has-joined-us-as-a-community-manager?cb=1) Spevacus has joined us as a Community Manager (Meta Stack Exchange) (https://meta.stackexchange.com/questions/412705/introducing-a-new-proactive-anti-spam-measure?cb=1) Introducing a new proactive anti-spam measure Linked (https://askubuntu.com/questions/223484/permission-denied-are-you-root?lq=1) (Question score (upvotes - downvotes)) 143 (https://askubuntu.com/questions/223484/permission-denied-are-you-root?noredirect=1&lq=1) Permission denied, are you root? Related (https://askubuntu.com/questions/1109982/e-could-not-get-lock-var-lib-dpkg-lock-frontend-open-11-resource-temporari?rq=1) (Question score (upvotes - downvotes)) 296 (https://askubuntu.com/questions/1109982/e-could-not-get-lock-var-lib-dpkg-lock-frontend-open-11-resource-temporari?rq=1) E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) (https://askubuntu.com/questions/1114678/what-process-created-the-var-lib-dpkg-lock-frontend-file-in-ubuntu?rq=1) (Question score (upvotes - downvotes)) 22 (https://askubuntu.com/questions/1114678/what-process-created-the-var-lib-dpkg-lock-frontend-file-in-ubuntu?rq=1) What process created the /var/lib/dpkg/lock-frontend file in Ubuntu? (https://askubuntu.com/questions/1163038/could-not-get-lock-var-lib-dpkg-lock-frontend-specific-to-one-single-deb-pac?rq=1) (Question score (upvotes - downvotes)) 2 (https://askubuntu.com/questions/1163038/could-not-get-lock-var-lib-dpkg-lock-frontend-specific-to-one-single-deb-pac?rq=1) Could not get lock /var/lib/dpkg/lock-frontend - specific to one single .deb package (https://askubuntu.com/questions/1236508/cannot-hit-the-ok-button-e-unable-to-acquire-the-dpkg-frontend-lock-softw?rq=1) (Question score (upvotes - downvotes)) 0 (https://askubuntu.com/questions/1236508/cannot-hit-the-ok-button-e-unable-to-acquire-the-dpkg-frontend-lock-softw?rq=1) Cannot hit the 'OK' button - E: Unable to acquire the dpkg frontend lock - Software center probable issue (https://askubuntu.com/questions/1520550/e-could-not-get-lock-var-cache-apt-archives-lock-it-is-held-by-process-36194?rq=1) (Question score (upvotes - downvotes)) 1 (https://askubuntu.com/questions/1520550/e-could-not-get-lock-var-cache-apt-archives-lock-it-is-held-by-process-36194?rq=1) E: Could not get lock /var/cache/apt/archives/lock. It is held by process 36194 (unattended-upgr) (https://stackexchange.com/questions?tab=hot) Hot Network Questions (Science Fiction & Fantasy Stack Exchange) (https://scifi.stackexchange.com/questions/299375/sf-short-story-written-perhaps-30-40-years-ago-about-female-infected-creatures) SF short-story written perhaps 30 - 40 years ago about female-infected creatures who are called males (Mathematics Stack Exchange) (https://math.stackexchange.com/questions/5098269/ian-stewart-definition-for-primitive-root-of-unity) Ian Stewart, Definition for Primitive Root of Unity (Mathematics Stack Exchange) (https://math.stackexchange.com/questions/5098408/a-supplement-to-from-frege-to-g%c3%96del-a-source-book-in-mathematical-logic-1879-1) A supplement to "FROM FREGE TO GÖDEL A Source Book in Mathematical Logic, 1879-1931" for developments on type theory and computation (Biology Stack Exchange) (https://biology.stackexchange.com/questions/117981/how-do-trees-drop-their-leaves) How do trees drop their leaves? (Code Golf Stack Exchange) (https://codegolf.stackexchange.com/questions/283848/verify-a-chinese-id-number) Verify a Chinese ID Number (Puzzling Stack Exchange) (https://puzzling.stackexchange.com/questions/133339/from-honeycombs-to-a-cube) From honeycombs to a cube (Travel Stack Exchange) (https://travel.stackexchange.com/questions/200290/why-would-disembarking-a-few-passengers-delay-a-flight-by-3-hours) Why would disembarking a few passengers delay a flight by 3 hours? (Mi Yodeya) (https://judaism.stackexchange.com/questions/151582/meshech-chochmahs-question-regarding-teshuvah) Meshech Chochmah's question regarding Teshuvah (Arqade) (https://gaming.stackexchange.com/questions/413518/what-does-transform-into-the-character-pulled-into-the-ufo-mean) What does "transform into the character pulled into the UFO" mean? (Ask Ubuntu) (https://askubuntu.com/questions/1556550/removing-temporary-latex-files) Removing temporary LaTeX files (Music: Practice & Theory Stack Exchange) (https://music.stackexchange.com/questions/141466/are-there-any-problems-with-mastering-my-own-music) Are there any problems with mastering my own music? (Movies & TV Stack Exchange) (https://movies.stackexchange.com/questions/128462/identifying-a-movie-where-a-man-relives-the-same-day) Identifying a movie where a man relives the same day (Law Stack Exchange) (https://law.stackexchange.com/questions/111001/reckless-endangerment-of-life-and-property) Reckless endangerment of life and property (TeX - LaTeX Stack Exchange) (https://tex.stackexchange.com/questions/751631/change-the-font-for-the-dagger-symbol-in-math-mode) Change the font for the dagger symbol in math mode (Role-playing Games Stack Exchange) (https://rpg.stackexchange.com/questions/216648/can-monks-use-their-dex-modifier-to-determine-jump-distance) Can Monks use their Dex modifier to determine jump distance? (Mathematica Stack Exchange) (https://mathematica.stackexchange.com/questions/315491/animate-opening-up-a-riemann-sphere-from-0-to-1-until-the-opening-becomes-a-circ) Animate opening up a Riemann sphere from 0 to 1 until the opening becomes a circular hole in the surface (Home Improvement Stack Exchange) (https://diy.stackexchange.com/questions/323251/can-i-salvage-this-drywall-patch-project) Can I salvage this drywall patch project? (Science Fiction & Fantasy Stack Exchange) (https://scifi.stackexchange.com/questions/299373/woman-from-bubble-city-where-all-men-are-infertile-meets-fertile-man-from-anothe) Woman from bubble city where all men are infertile meets fertile man from another city (Board & Card Games Stack Exchange) (https://boardgames.stackexchange.com/questions/63184/what-happens-when-the-jewels-run-out) What happens when the jewels run out? (Database Administrators Stack Exchange) (https://dba.stackexchange.com/questions/347849/best-solution-to-prevent-loop-between-tables-for-granular-relations) Best solution to prevent loop between tables for granular relations (Software Engineering Stack Exchange) (https://softwareengineering.stackexchange.com/questions/459230/rbac-vs-pbac-vs-acl) RBAC vs PBAC vs ACL more hot questions () Why are you flagging this comment? (20) It contains harassment, bigotry or abuse. This comment attacks a person or group. Learn more in our (https://askubuntu.com/conduct/abusive-behavior) Code of Conduct . (40) It's unfriendly or unkind. This comment is rude or condescending. Learn more in our (https://askubuntu.com/conduct/abusive-behavior) Code of Conduct . (39) Not needed. This comment is not relevant to the post. (19) Something else. A problem not listed above. Try to be as specific as possible. Flag comment Cancel You have 0 flags left today (https://askubuntu.com/) Ask Ubuntu (https://askubuntu.com/tour) Tour (https://askubuntu.com/help) Help (https://chat.stackexchange.com/?tab=all&sort=active) Chat (https://askubuntu.com/contact) Contact (https://meta.askubuntu.com/) Feedback (https://stackoverflow.co/) Company (https://stackoverflow.com/) Stack Overflow (https://stackoverflow.co/teams/) Teams (https://stackoverflow.co/advertising/) Advertising (https://stackoverflow.co/advertising/employer-branding/) Talent (https://stackoverflow.co/) About (https://stackoverflow.co/company/press/) Press (https://stackoverflow.com/legal) Legal (https://stackoverflow.com/legal/privacy-policy) Privacy Policy (https://stackoverflow.com/legal/terms-of-service/public) Terms of Service Your Privacy Choices (https://policies.stackoverflow.co/stack-overflow/cookie-policy) Cookie Policy (https://stackexchange.com/) Stack Exchange Network (https://stackexchange.com/sites#technology) Technology (https://stackexchange.com/sites#culturerecreation) Culture & recreation (https://stackexchange.com/sites#lifearts) Life & arts (https://stackexchange.com/sites#science) Science (https://stackexchange.com/sites#professional) Professional (https://stackexchange.com/sites#business) Business (https://api.stackexchange.com/) API (https://data.stackexchange.com/) Data (https://stackoverflow.blog/?blb=1) Blog (https://www.facebook.com/officialstackoverflow/) Facebook (https://twitter.com/stackoverflow) Twitter (https://linkedin.com/company/stack-overflow) LinkedIn (https://www.instagram.com/thestackoverflow) Instagram Site design / logo © 2025 Stack Exchange Inc; user contributions licensed under (https://stackoverflow.com/help/licensing) CC BY-SA . rev 2025.9.26.34533 Ubuntu and the circle of friends logo are trade marks of Canonical Limited and are used under licence. By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our (https://policies.stackoverflow.co/stack-overflow/cookie-policy/) Cookie Policy . Accept all cookies Necessary cookies only Customize settings