Close Menu
    Facebook X (Twitter) Instagram
    • Download Cisco Packet Tracer
    Facebook X (Twitter) Instagram Pinterest Vimeo
    IT Beginner
    • Home
    • Server
    • WordPress
    IT Beginner
    Home»Tips – Tricks»How to fix could not get lock error in ubuntu
    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
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    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
    Tags
    apache centos Centos 6 cuda Desktop Environment dual boot environment featured gnome GUI hostname hosts intel kernel kill lamp server lemp server life MariaDB netflix nginx nvidia password php-fpm phpmyadmin pids processes s.m.a.r.t Security session solid state drive ssd ssh ssh server tag 1 tag 2 Ubuntu upgrade varnish VirtualBox VNC Server web server window manager wordpress xfce
    Facebook X (Twitter) Instagram Pinterest

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

    wpDiscuz