Permission denied, are you root?











up vote
62
down vote

favorite
13












I get this error whenever I try to install programs using the terminal:



home@ubuntu:~$ apt-get install myunity
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?


Also I'm unable to install updates using the terminal.










share|improve this question




















  • 4




    This isn't a duplicate, same error, but different reasons.
    – Jorge Castro
    Dec 1 '12 at 18:56






  • 3




    Try sudo apt-get update
    – Avinash Raj
    Feb 28 '14 at 12:21










  • i think your gui update manager is open while you running apt-get update and one thing you must be super user or use sudo before using apt-get update
    – smn_onrocks
    Feb 28 '14 at 12:24












  • @Braiam Oh, okay. Funny all the same..
    – Parto
    Feb 28 '14 at 14:13






  • 1




    See also askubuntu.com/questions/427479/…
    – Avinash Raj
    Mar 10 '14 at 13:34















up vote
62
down vote

favorite
13












I get this error whenever I try to install programs using the terminal:



home@ubuntu:~$ apt-get install myunity
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?


Also I'm unable to install updates using the terminal.










share|improve this question




















  • 4




    This isn't a duplicate, same error, but different reasons.
    – Jorge Castro
    Dec 1 '12 at 18:56






  • 3




    Try sudo apt-get update
    – Avinash Raj
    Feb 28 '14 at 12:21










  • i think your gui update manager is open while you running apt-get update and one thing you must be super user or use sudo before using apt-get update
    – smn_onrocks
    Feb 28 '14 at 12:24












  • @Braiam Oh, okay. Funny all the same..
    – Parto
    Feb 28 '14 at 14:13






  • 1




    See also askubuntu.com/questions/427479/…
    – Avinash Raj
    Mar 10 '14 at 13:34













up vote
62
down vote

favorite
13









up vote
62
down vote

favorite
13






13





I get this error whenever I try to install programs using the terminal:



home@ubuntu:~$ apt-get install myunity
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?


Also I'm unable to install updates using the terminal.










share|improve this question















I get this error whenever I try to install programs using the terminal:



home@ubuntu:~$ apt-get install myunity
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?


Also I'm unable to install updates using the terminal.







apt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 '14 at 4:23









Braiam

50.9k20133217




50.9k20133217










asked Nov 29 '12 at 16:15









Raghav Mittal

461369




461369








  • 4




    This isn't a duplicate, same error, but different reasons.
    – Jorge Castro
    Dec 1 '12 at 18:56






  • 3




    Try sudo apt-get update
    – Avinash Raj
    Feb 28 '14 at 12:21










  • i think your gui update manager is open while you running apt-get update and one thing you must be super user or use sudo before using apt-get update
    – smn_onrocks
    Feb 28 '14 at 12:24












  • @Braiam Oh, okay. Funny all the same..
    – Parto
    Feb 28 '14 at 14:13






  • 1




    See also askubuntu.com/questions/427479/…
    – Avinash Raj
    Mar 10 '14 at 13:34














  • 4




    This isn't a duplicate, same error, but different reasons.
    – Jorge Castro
    Dec 1 '12 at 18:56






  • 3




    Try sudo apt-get update
    – Avinash Raj
    Feb 28 '14 at 12:21










  • i think your gui update manager is open while you running apt-get update and one thing you must be super user or use sudo before using apt-get update
    – smn_onrocks
    Feb 28 '14 at 12:24












  • @Braiam Oh, okay. Funny all the same..
    – Parto
    Feb 28 '14 at 14:13






  • 1




    See also askubuntu.com/questions/427479/…
    – Avinash Raj
    Mar 10 '14 at 13:34








4




4




This isn't a duplicate, same error, but different reasons.
– Jorge Castro
Dec 1 '12 at 18:56




This isn't a duplicate, same error, but different reasons.
– Jorge Castro
Dec 1 '12 at 18:56




3




3




Try sudo apt-get update
– Avinash Raj
Feb 28 '14 at 12:21




Try sudo apt-get update
– Avinash Raj
Feb 28 '14 at 12:21












i think your gui update manager is open while you running apt-get update and one thing you must be super user or use sudo before using apt-get update
– smn_onrocks
Feb 28 '14 at 12:24






i think your gui update manager is open while you running apt-get update and one thing you must be super user or use sudo before using apt-get update
– smn_onrocks
Feb 28 '14 at 12:24














@Braiam Oh, okay. Funny all the same..
– Parto
Feb 28 '14 at 14:13




@Braiam Oh, okay. Funny all the same..
– Parto
Feb 28 '14 at 14:13




1




1




See also askubuntu.com/questions/427479/…
– Avinash Raj
Mar 10 '14 at 13:34




See also askubuntu.com/questions/427479/…
– Avinash Raj
Mar 10 '14 at 13:34










7 Answers
7






active

oldest

votes

















up vote
63
down vote



accepted










The solution is to read the error message: are you root?. Use sudo to run a command with root privileges, like so: sudo apt-get update






share|improve this answer






























    up vote
    21
    down vote













    According to the community documentation about using the terminal,




    sudo: Executing Commands with Elevated Privileges




    1. Most of the following commands will need to be prefaced with the sudo command. This elevates privileges to the root-user administrative level temporarily, which is necessary when working with directories or files not owned by your user account. When using sudo you will be prompted for your password. Only users with sudo (administrative) privileges will be able to use this command. You should never use normal sudo to start graphical applications as Root (Please see RootSudo for more information on using sudo correctly.)




    So, because apt-get installs software and thus affects the system, you need to use the sudo command to give yourself administrator privilages.



    Thus, you command should be sudo apt-get install myunity



    If you want to update your system, run



    sudo apt-get update
    sudo apt-get dist-upgrade


    This will update your system's package database and then install any upgrades.






    share|improve this answer



















    • 4




      This does't help in getting rid of the error: unable to lock the administration directory (/var/lib/dpkg/), are you root?
      – Igor G.
      Jul 24 '16 at 20:59


















    up vote
    9
    down vote













    Before running any administrative task: installing, removing, changing system wide preferences, etc. you need to be root. This is specially true for apt-get. The message itself tells you where the problem is:




    are you root?




    If you are not root, the install command will not work at all.



    The way to fix this is using sudo before the command:



    ➜  ~  apt-get update
    E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
    E: Unable to lock directory /var/lib/apt/lists/
    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?
    ➜ ~ sudo apt-get update
    Fetched 616 kB in 25s (23.9 kB/s)


    As you can notice, it completed without problems when I used sudo. If you have any open (13: Permission denied) it is almost sure that you are not root and need to use sudo.






    share|improve this answer





















    • Thanks for the help gents,as I have not set root I didn't think I'd need to use sudo but for me it's all a learning experience.Just wish you could stipulate updates in terminal
      – Frenchman
      Feb 28 '14 at 21:14


















    up vote
    4
    down vote













    Try with



    sudo apt-get update 


    If u still get lock error try this command
    It will give the process detail



    ps -e | grep -e apt -e adept | grep -v grep


    Then kill the process using process ID
    then execute the update command



    And also u can delete this file your problem will solve



    rm /var/lib/dpkg/lock 





    share|improve this answer



















    • 1




      Remember to close down the Software Center before using apt-get. Or else the updater gets locked.
      – Dan Johansen
      Feb 28 '14 at 12:50






    • 1




      The lock exists to protect your repository configuration files. Killing processes and removing lock files without care can lead to a badly misconfigured system. This answer is really DANGEROUS. Before removing a lock file you have to be triple sure that the process holding it has closed, or crashed, or whatever. The correct answer is @braiam 's one.
      – Rmano
      Mar 10 '14 at 14:02












    • No such file or directory: /var/lib/dpkg/lock
      – Igor G.
      Jul 24 '16 at 21:00










    • The updater held the lock, so I could not run apt-get install. I had to wait until the update finishes (couple of minutes only), then it worked,
      – gaborsch
      Jul 11 '17 at 13:00


















    up vote
    3
    down vote













    just run



    sudo apt-get update



    sudo is for running it as super user






    share|improve this answer




























      up vote
      2
      down vote













      Just read the error output: are you root? because you are not. As a regular user you don't have enough privileges to install packages.



      Prepend sudo to the command to elevate the privileges. Provided that account has sudo privileges that will work.






      share|improve this answer




























        up vote
        0
        down vote













        I had this error and in my case I had to remove
        noexec on /var in /etc/fstab



        which works fine on my CentOS, Fedora and Alpine Linux






        share|improve this answer




















          protected by Braiam Mar 10 '14 at 21:02



          Thank you for your interest in this question.
          Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



          Would you like to answer one of these unanswered questions instead?














          7 Answers
          7






          active

          oldest

          votes








          7 Answers
          7






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          63
          down vote



          accepted










          The solution is to read the error message: are you root?. Use sudo to run a command with root privileges, like so: sudo apt-get update






          share|improve this answer



























            up vote
            63
            down vote



            accepted










            The solution is to read the error message: are you root?. Use sudo to run a command with root privileges, like so: sudo apt-get update






            share|improve this answer

























              up vote
              63
              down vote



              accepted







              up vote
              63
              down vote



              accepted






              The solution is to read the error message: are you root?. Use sudo to run a command with root privileges, like so: sudo apt-get update






              share|improve this answer














              The solution is to read the error message: are you root?. Use sudo to run a command with root privileges, like so: sudo apt-get update







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Mar 15 '14 at 17:49

























              answered Mar 10 '14 at 9:28









              pzkpfw

              3,42952442




              3,42952442
























                  up vote
                  21
                  down vote













                  According to the community documentation about using the terminal,




                  sudo: Executing Commands with Elevated Privileges




                  1. Most of the following commands will need to be prefaced with the sudo command. This elevates privileges to the root-user administrative level temporarily, which is necessary when working with directories or files not owned by your user account. When using sudo you will be prompted for your password. Only users with sudo (administrative) privileges will be able to use this command. You should never use normal sudo to start graphical applications as Root (Please see RootSudo for more information on using sudo correctly.)




                  So, because apt-get installs software and thus affects the system, you need to use the sudo command to give yourself administrator privilages.



                  Thus, you command should be sudo apt-get install myunity



                  If you want to update your system, run



                  sudo apt-get update
                  sudo apt-get dist-upgrade


                  This will update your system's package database and then install any upgrades.






                  share|improve this answer



















                  • 4




                    This does't help in getting rid of the error: unable to lock the administration directory (/var/lib/dpkg/), are you root?
                    – Igor G.
                    Jul 24 '16 at 20:59















                  up vote
                  21
                  down vote













                  According to the community documentation about using the terminal,




                  sudo: Executing Commands with Elevated Privileges




                  1. Most of the following commands will need to be prefaced with the sudo command. This elevates privileges to the root-user administrative level temporarily, which is necessary when working with directories or files not owned by your user account. When using sudo you will be prompted for your password. Only users with sudo (administrative) privileges will be able to use this command. You should never use normal sudo to start graphical applications as Root (Please see RootSudo for more information on using sudo correctly.)




                  So, because apt-get installs software and thus affects the system, you need to use the sudo command to give yourself administrator privilages.



                  Thus, you command should be sudo apt-get install myunity



                  If you want to update your system, run



                  sudo apt-get update
                  sudo apt-get dist-upgrade


                  This will update your system's package database and then install any upgrades.






                  share|improve this answer



















                  • 4




                    This does't help in getting rid of the error: unable to lock the administration directory (/var/lib/dpkg/), are you root?
                    – Igor G.
                    Jul 24 '16 at 20:59













                  up vote
                  21
                  down vote










                  up vote
                  21
                  down vote









                  According to the community documentation about using the terminal,




                  sudo: Executing Commands with Elevated Privileges




                  1. Most of the following commands will need to be prefaced with the sudo command. This elevates privileges to the root-user administrative level temporarily, which is necessary when working with directories or files not owned by your user account. When using sudo you will be prompted for your password. Only users with sudo (administrative) privileges will be able to use this command. You should never use normal sudo to start graphical applications as Root (Please see RootSudo for more information on using sudo correctly.)




                  So, because apt-get installs software and thus affects the system, you need to use the sudo command to give yourself administrator privilages.



                  Thus, you command should be sudo apt-get install myunity



                  If you want to update your system, run



                  sudo apt-get update
                  sudo apt-get dist-upgrade


                  This will update your system's package database and then install any upgrades.






                  share|improve this answer














                  According to the community documentation about using the terminal,




                  sudo: Executing Commands with Elevated Privileges




                  1. Most of the following commands will need to be prefaced with the sudo command. This elevates privileges to the root-user administrative level temporarily, which is necessary when working with directories or files not owned by your user account. When using sudo you will be prompted for your password. Only users with sudo (administrative) privileges will be able to use this command. You should never use normal sudo to start graphical applications as Root (Please see RootSudo for more information on using sudo correctly.)




                  So, because apt-get installs software and thus affects the system, you need to use the sudo command to give yourself administrator privilages.



                  Thus, you command should be sudo apt-get install myunity



                  If you want to update your system, run



                  sudo apt-get update
                  sudo apt-get dist-upgrade


                  This will update your system's package database and then install any upgrades.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 29 '12 at 16:35

























                  answered Nov 29 '12 at 16:25









                  iBelieve

                  4,26932154




                  4,26932154








                  • 4




                    This does't help in getting rid of the error: unable to lock the administration directory (/var/lib/dpkg/), are you root?
                    – Igor G.
                    Jul 24 '16 at 20:59














                  • 4




                    This does't help in getting rid of the error: unable to lock the administration directory (/var/lib/dpkg/), are you root?
                    – Igor G.
                    Jul 24 '16 at 20:59








                  4




                  4




                  This does't help in getting rid of the error: unable to lock the administration directory (/var/lib/dpkg/), are you root?
                  – Igor G.
                  Jul 24 '16 at 20:59




                  This does't help in getting rid of the error: unable to lock the administration directory (/var/lib/dpkg/), are you root?
                  – Igor G.
                  Jul 24 '16 at 20:59










                  up vote
                  9
                  down vote













                  Before running any administrative task: installing, removing, changing system wide preferences, etc. you need to be root. This is specially true for apt-get. The message itself tells you where the problem is:




                  are you root?




                  If you are not root, the install command will not work at all.



                  The way to fix this is using sudo before the command:



                  ➜  ~  apt-get update
                  E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
                  E: Unable to lock directory /var/lib/apt/lists/
                  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?
                  ➜ ~ sudo apt-get update
                  Fetched 616 kB in 25s (23.9 kB/s)


                  As you can notice, it completed without problems when I used sudo. If you have any open (13: Permission denied) it is almost sure that you are not root and need to use sudo.






                  share|improve this answer





















                  • Thanks for the help gents,as I have not set root I didn't think I'd need to use sudo but for me it's all a learning experience.Just wish you could stipulate updates in terminal
                    – Frenchman
                    Feb 28 '14 at 21:14















                  up vote
                  9
                  down vote













                  Before running any administrative task: installing, removing, changing system wide preferences, etc. you need to be root. This is specially true for apt-get. The message itself tells you where the problem is:




                  are you root?




                  If you are not root, the install command will not work at all.



                  The way to fix this is using sudo before the command:



                  ➜  ~  apt-get update
                  E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
                  E: Unable to lock directory /var/lib/apt/lists/
                  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?
                  ➜ ~ sudo apt-get update
                  Fetched 616 kB in 25s (23.9 kB/s)


                  As you can notice, it completed without problems when I used sudo. If you have any open (13: Permission denied) it is almost sure that you are not root and need to use sudo.






                  share|improve this answer





















                  • Thanks for the help gents,as I have not set root I didn't think I'd need to use sudo but for me it's all a learning experience.Just wish you could stipulate updates in terminal
                    – Frenchman
                    Feb 28 '14 at 21:14













                  up vote
                  9
                  down vote










                  up vote
                  9
                  down vote









                  Before running any administrative task: installing, removing, changing system wide preferences, etc. you need to be root. This is specially true for apt-get. The message itself tells you where the problem is:




                  are you root?




                  If you are not root, the install command will not work at all.



                  The way to fix this is using sudo before the command:



                  ➜  ~  apt-get update
                  E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
                  E: Unable to lock directory /var/lib/apt/lists/
                  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?
                  ➜ ~ sudo apt-get update
                  Fetched 616 kB in 25s (23.9 kB/s)


                  As you can notice, it completed without problems when I used sudo. If you have any open (13: Permission denied) it is almost sure that you are not root and need to use sudo.






                  share|improve this answer












                  Before running any administrative task: installing, removing, changing system wide preferences, etc. you need to be root. This is specially true for apt-get. The message itself tells you where the problem is:




                  are you root?




                  If you are not root, the install command will not work at all.



                  The way to fix this is using sudo before the command:



                  ➜  ~  apt-get update
                  E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
                  E: Unable to lock directory /var/lib/apt/lists/
                  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?
                  ➜ ~ sudo apt-get update
                  Fetched 616 kB in 25s (23.9 kB/s)


                  As you can notice, it completed without problems when I used sudo. If you have any open (13: Permission denied) it is almost sure that you are not root and need to use sudo.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 28 '14 at 13:20









                  Braiam

                  50.9k20133217




                  50.9k20133217












                  • Thanks for the help gents,as I have not set root I didn't think I'd need to use sudo but for me it's all a learning experience.Just wish you could stipulate updates in terminal
                    – Frenchman
                    Feb 28 '14 at 21:14


















                  • Thanks for the help gents,as I have not set root I didn't think I'd need to use sudo but for me it's all a learning experience.Just wish you could stipulate updates in terminal
                    – Frenchman
                    Feb 28 '14 at 21:14
















                  Thanks for the help gents,as I have not set root I didn't think I'd need to use sudo but for me it's all a learning experience.Just wish you could stipulate updates in terminal
                  – Frenchman
                  Feb 28 '14 at 21:14




                  Thanks for the help gents,as I have not set root I didn't think I'd need to use sudo but for me it's all a learning experience.Just wish you could stipulate updates in terminal
                  – Frenchman
                  Feb 28 '14 at 21:14










                  up vote
                  4
                  down vote













                  Try with



                  sudo apt-get update 


                  If u still get lock error try this command
                  It will give the process detail



                  ps -e | grep -e apt -e adept | grep -v grep


                  Then kill the process using process ID
                  then execute the update command



                  And also u can delete this file your problem will solve



                  rm /var/lib/dpkg/lock 





                  share|improve this answer



















                  • 1




                    Remember to close down the Software Center before using apt-get. Or else the updater gets locked.
                    – Dan Johansen
                    Feb 28 '14 at 12:50






                  • 1




                    The lock exists to protect your repository configuration files. Killing processes and removing lock files without care can lead to a badly misconfigured system. This answer is really DANGEROUS. Before removing a lock file you have to be triple sure that the process holding it has closed, or crashed, or whatever. The correct answer is @braiam 's one.
                    – Rmano
                    Mar 10 '14 at 14:02












                  • No such file or directory: /var/lib/dpkg/lock
                    – Igor G.
                    Jul 24 '16 at 21:00










                  • The updater held the lock, so I could not run apt-get install. I had to wait until the update finishes (couple of minutes only), then it worked,
                    – gaborsch
                    Jul 11 '17 at 13:00















                  up vote
                  4
                  down vote













                  Try with



                  sudo apt-get update 


                  If u still get lock error try this command
                  It will give the process detail



                  ps -e | grep -e apt -e adept | grep -v grep


                  Then kill the process using process ID
                  then execute the update command



                  And also u can delete this file your problem will solve



                  rm /var/lib/dpkg/lock 





                  share|improve this answer



















                  • 1




                    Remember to close down the Software Center before using apt-get. Or else the updater gets locked.
                    – Dan Johansen
                    Feb 28 '14 at 12:50






                  • 1




                    The lock exists to protect your repository configuration files. Killing processes and removing lock files without care can lead to a badly misconfigured system. This answer is really DANGEROUS. Before removing a lock file you have to be triple sure that the process holding it has closed, or crashed, or whatever. The correct answer is @braiam 's one.
                    – Rmano
                    Mar 10 '14 at 14:02












                  • No such file or directory: /var/lib/dpkg/lock
                    – Igor G.
                    Jul 24 '16 at 21:00










                  • The updater held the lock, so I could not run apt-get install. I had to wait until the update finishes (couple of minutes only), then it worked,
                    – gaborsch
                    Jul 11 '17 at 13:00













                  up vote
                  4
                  down vote










                  up vote
                  4
                  down vote









                  Try with



                  sudo apt-get update 


                  If u still get lock error try this command
                  It will give the process detail



                  ps -e | grep -e apt -e adept | grep -v grep


                  Then kill the process using process ID
                  then execute the update command



                  And also u can delete this file your problem will solve



                  rm /var/lib/dpkg/lock 





                  share|improve this answer














                  Try with



                  sudo apt-get update 


                  If u still get lock error try this command
                  It will give the process detail



                  ps -e | grep -e apt -e adept | grep -v grep


                  Then kill the process using process ID
                  then execute the update command



                  And also u can delete this file your problem will solve



                  rm /var/lib/dpkg/lock 






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 8 '14 at 4:52

























                  answered Feb 28 '14 at 12:45









                  Premkumar

                  310211




                  310211








                  • 1




                    Remember to close down the Software Center before using apt-get. Or else the updater gets locked.
                    – Dan Johansen
                    Feb 28 '14 at 12:50






                  • 1




                    The lock exists to protect your repository configuration files. Killing processes and removing lock files without care can lead to a badly misconfigured system. This answer is really DANGEROUS. Before removing a lock file you have to be triple sure that the process holding it has closed, or crashed, or whatever. The correct answer is @braiam 's one.
                    – Rmano
                    Mar 10 '14 at 14:02












                  • No such file or directory: /var/lib/dpkg/lock
                    – Igor G.
                    Jul 24 '16 at 21:00










                  • The updater held the lock, so I could not run apt-get install. I had to wait until the update finishes (couple of minutes only), then it worked,
                    – gaborsch
                    Jul 11 '17 at 13:00














                  • 1




                    Remember to close down the Software Center before using apt-get. Or else the updater gets locked.
                    – Dan Johansen
                    Feb 28 '14 at 12:50






                  • 1




                    The lock exists to protect your repository configuration files. Killing processes and removing lock files without care can lead to a badly misconfigured system. This answer is really DANGEROUS. Before removing a lock file you have to be triple sure that the process holding it has closed, or crashed, or whatever. The correct answer is @braiam 's one.
                    – Rmano
                    Mar 10 '14 at 14:02












                  • No such file or directory: /var/lib/dpkg/lock
                    – Igor G.
                    Jul 24 '16 at 21:00










                  • The updater held the lock, so I could not run apt-get install. I had to wait until the update finishes (couple of minutes only), then it worked,
                    – gaborsch
                    Jul 11 '17 at 13:00








                  1




                  1




                  Remember to close down the Software Center before using apt-get. Or else the updater gets locked.
                  – Dan Johansen
                  Feb 28 '14 at 12:50




                  Remember to close down the Software Center before using apt-get. Or else the updater gets locked.
                  – Dan Johansen
                  Feb 28 '14 at 12:50




                  1




                  1




                  The lock exists to protect your repository configuration files. Killing processes and removing lock files without care can lead to a badly misconfigured system. This answer is really DANGEROUS. Before removing a lock file you have to be triple sure that the process holding it has closed, or crashed, or whatever. The correct answer is @braiam 's one.
                  – Rmano
                  Mar 10 '14 at 14:02






                  The lock exists to protect your repository configuration files. Killing processes and removing lock files without care can lead to a badly misconfigured system. This answer is really DANGEROUS. Before removing a lock file you have to be triple sure that the process holding it has closed, or crashed, or whatever. The correct answer is @braiam 's one.
                  – Rmano
                  Mar 10 '14 at 14:02














                  No such file or directory: /var/lib/dpkg/lock
                  – Igor G.
                  Jul 24 '16 at 21:00




                  No such file or directory: /var/lib/dpkg/lock
                  – Igor G.
                  Jul 24 '16 at 21:00












                  The updater held the lock, so I could not run apt-get install. I had to wait until the update finishes (couple of minutes only), then it worked,
                  – gaborsch
                  Jul 11 '17 at 13:00




                  The updater held the lock, so I could not run apt-get install. I had to wait until the update finishes (couple of minutes only), then it worked,
                  – gaborsch
                  Jul 11 '17 at 13:00










                  up vote
                  3
                  down vote













                  just run



                  sudo apt-get update



                  sudo is for running it as super user






                  share|improve this answer

























                    up vote
                    3
                    down vote













                    just run



                    sudo apt-get update



                    sudo is for running it as super user






                    share|improve this answer























                      up vote
                      3
                      down vote










                      up vote
                      3
                      down vote









                      just run



                      sudo apt-get update



                      sudo is for running it as super user






                      share|improve this answer












                      just run



                      sudo apt-get update



                      sudo is for running it as super user







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Mar 10 '14 at 7:49









                      Stormvirux

                      3,7281831




                      3,7281831






















                          up vote
                          2
                          down vote













                          Just read the error output: are you root? because you are not. As a regular user you don't have enough privileges to install packages.



                          Prepend sudo to the command to elevate the privileges. Provided that account has sudo privileges that will work.






                          share|improve this answer

























                            up vote
                            2
                            down vote













                            Just read the error output: are you root? because you are not. As a regular user you don't have enough privileges to install packages.



                            Prepend sudo to the command to elevate the privileges. Provided that account has sudo privileges that will work.






                            share|improve this answer























                              up vote
                              2
                              down vote










                              up vote
                              2
                              down vote









                              Just read the error output: are you root? because you are not. As a regular user you don't have enough privileges to install packages.



                              Prepend sudo to the command to elevate the privileges. Provided that account has sudo privileges that will work.






                              share|improve this answer












                              Just read the error output: are you root? because you are not. As a regular user you don't have enough privileges to install packages.



                              Prepend sudo to the command to elevate the privileges. Provided that account has sudo privileges that will work.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Nov 29 '12 at 16:18









                              gertvdijk

                              49.5k18139233




                              49.5k18139233






















                                  up vote
                                  0
                                  down vote













                                  I had this error and in my case I had to remove
                                  noexec on /var in /etc/fstab



                                  which works fine on my CentOS, Fedora and Alpine Linux






                                  share|improve this answer

























                                    up vote
                                    0
                                    down vote













                                    I had this error and in my case I had to remove
                                    noexec on /var in /etc/fstab



                                    which works fine on my CentOS, Fedora and Alpine Linux






                                    share|improve this answer























                                      up vote
                                      0
                                      down vote










                                      up vote
                                      0
                                      down vote









                                      I had this error and in my case I had to remove
                                      noexec on /var in /etc/fstab



                                      which works fine on my CentOS, Fedora and Alpine Linux






                                      share|improve this answer












                                      I had this error and in my case I had to remove
                                      noexec on /var in /etc/fstab



                                      which works fine on my CentOS, Fedora and Alpine Linux







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Apr 13 at 7:30









                                      JOduMonT

                                      194




                                      194

















                                          protected by Braiam Mar 10 '14 at 21:02



                                          Thank you for your interest in this question.
                                          Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                                          Would you like to answer one of these unanswered questions instead?



                                          Popular posts from this blog

                                          flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                                          Mangá

                                           ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕