Close Menu
    Facebook X (Twitter) Instagram
    • Articles
    • How it Works
    • Our Story
    • Contact Us
    Facebook X (Twitter) Instagram Pinterest Vimeo
    IT Beginner
    • Home
    • Blog
      • Happiness
      • Productivity
      • Leadership
    • About us
    • Contact us
    IT Beginner
    Tips – Tricks

    How to fix could not get lock error in ubuntu

    19/07/2017No Comments2 Mins Read

    If you try to get ubuntu update by apt-get update command and you get these errors could not get lock /var/lib/apt/lists/lock or Could not get lock /var/lib/dpkg/lock. I will show you how to fix this problem in this article. Could not get lock error happens when you try to run or execute an apt command but forget to use “sudo”, or something has locked the apt database after install or remove software. These Ubuntu programs may be make the problem

    • Apt command
    • Ubuntu Software Center
    • Update Manager

    You will likely to see these errors

    $ sudo apt-get update 
    Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) 
    Unable to lock directory /var/lib/apt/lists/

    or

    E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
    E: Unable to lock the administration directory (/var/lib/dpkg/)

    You can fix that problem by simply remove all of the temporary list in /var/lib/apt/lists/ and lock file in the cache directory in /var/cache/apt/archives/lock

    $ sudo rm /var/lib/apt/lists/*
    $ sudo rm /var/lib/dpkg/lock
    $ sudo rm /var/cache/apt/archives/lock

    Now we should force package to reconfig

    $ sudo dpkg --configure -a

    Now you can try to update your Ubuntu system or run Synaptic without “could not get lock” error.

    could not get lock error
    Previous ArticleHow to secure wordpress website
    Next Article How to install and configure Varnish with Apache on Centos 6

    Related Posts

    Tips – Tricks

    How to fix nginx an upstream response is buffered to a temporary file error

    05/08/2017
    Tips – Tricks

    Optimize WordPress with Nginx

    04/08/2017
    Security

    How to secure Apache HTTP Web Server

    29/07/2017
    Subscribe
    Notify of
    guest

    guest

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    0 Comments
    Oldest
    Newest Most Voted
    Inline Feedbacks
    View all comments
    • Productivity
    • Leadership

    No posts

    No posts

    Subscribe to Newsletter
    Our Socials
    • Instagram
    • Facebook
    • Twitter
    • YouTube
    • LinkedIn

    Archives

    • April 2025
    • May 2024
    • March 2023
    • July 2022
    • March 2022
    • July 2020
    • January 2019
    • August 2018
    • July 2018
    • August 2017
    • July 2017
    • September 2016

    Categories

    • Business
    • CCNA 1 Instructor Materials
    • CentOS
    • Database
    • Debian
    • Fedora
    • Firefox
    • Happiness
    • Hardware
    • ICND1 Labs
    • ICND2 Labs
    • Leadership
    • Linux Essentials
    • Linux Mint
    • Marketing
    • My SQL
    • Netflix
    • Networking
    • Productivity
    • Resources
    • Security
    • SEO
    • Server
    • Social Media
    • Software
    • Tips – Tricks
    • Ubuntu
    • Uncategorized
    • User Experience
    • WordPress
    • Xubuntu

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna accumsan in scelerisque.

    Facebook X (Twitter) Instagram Pinterest

    Type above and press Enter to search. Press Esc to cancel.

    wpDiscuz