i can't install sudo [on hold]











up vote
0
down vote

favorite












I want to install sudo so I typed command apt-get update then it shows the following error:



reading packages lists...done
W: chmod 0700 of directory /var/lib/apt/lists/partial failed -
E: could not open lock file /var/lib/apt/lists/lock - open (13:permission denied)
E: unable to lock directory /var/lib/apt/lists/
W: problem unlocking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13:permission denied)
W: problem unlocking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13:permission denied)









share|improve this question















put on hold as unclear what you're asking by muru, N0rbert, Eric Carvalho, pomsky, karel 1 hour ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 1




    Which distribution/flavor are you using?
    – Kulfy
    Nov 27 at 2:59






  • 5




    Understanding exactly and completely what you did that caused the seeming damage to your system will help us to advise you better.
    – user535733
    Nov 27 at 3:25















up vote
0
down vote

favorite












I want to install sudo so I typed command apt-get update then it shows the following error:



reading packages lists...done
W: chmod 0700 of directory /var/lib/apt/lists/partial failed -
E: could not open lock file /var/lib/apt/lists/lock - open (13:permission denied)
E: unable to lock directory /var/lib/apt/lists/
W: problem unlocking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13:permission denied)
W: problem unlocking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13:permission denied)









share|improve this question















put on hold as unclear what you're asking by muru, N0rbert, Eric Carvalho, pomsky, karel 1 hour ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 1




    Which distribution/flavor are you using?
    – Kulfy
    Nov 27 at 2:59






  • 5




    Understanding exactly and completely what you did that caused the seeming damage to your system will help us to advise you better.
    – user535733
    Nov 27 at 3:25













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I want to install sudo so I typed command apt-get update then it shows the following error:



reading packages lists...done
W: chmod 0700 of directory /var/lib/apt/lists/partial failed -
E: could not open lock file /var/lib/apt/lists/lock - open (13:permission denied)
E: unable to lock directory /var/lib/apt/lists/
W: problem unlocking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13:permission denied)
W: problem unlocking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13:permission denied)









share|improve this question















I want to install sudo so I typed command apt-get update then it shows the following error:



reading packages lists...done
W: chmod 0700 of directory /var/lib/apt/lists/partial failed -
E: could not open lock file /var/lib/apt/lists/lock - open (13:permission denied)
E: unable to lock directory /var/lib/apt/lists/
W: problem unlocking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13:permission denied)
W: problem unlocking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13:permission denied)






apt permissions dpkg sudo update-manager






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 at 2:58









Kulfy

2,47521033




2,47521033










asked Nov 27 at 2:55









siddhesh joshi

1




1




put on hold as unclear what you're asking by muru, N0rbert, Eric Carvalho, pomsky, karel 1 hour ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






put on hold as unclear what you're asking by muru, N0rbert, Eric Carvalho, pomsky, karel 1 hour ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 1




    Which distribution/flavor are you using?
    – Kulfy
    Nov 27 at 2:59






  • 5




    Understanding exactly and completely what you did that caused the seeming damage to your system will help us to advise you better.
    – user535733
    Nov 27 at 3:25














  • 1




    Which distribution/flavor are you using?
    – Kulfy
    Nov 27 at 2:59






  • 5




    Understanding exactly and completely what you did that caused the seeming damage to your system will help us to advise you better.
    – user535733
    Nov 27 at 3:25








1




1




Which distribution/flavor are you using?
– Kulfy
Nov 27 at 2:59




Which distribution/flavor are you using?
– Kulfy
Nov 27 at 2:59




5




5




Understanding exactly and completely what you did that caused the seeming damage to your system will help us to advise you better.
– user535733
Nov 27 at 3:25




Understanding exactly and completely what you did that caused the seeming damage to your system will help us to advise you better.
– user535733
Nov 27 at 3:25










1 Answer
1






active

oldest

votes

















up vote
1
down vote













I'm assuming you deleted sudo? If the root account has a password set you can login as root user or use su -c "apt-get install sudo"



If the root user has no password which is most likely the case, you can edit the /etc/shadow file by mounting your hard drive with a live cd.
The first line will contain the entry for root user, something like this:
root:!:17828:0:99999:7:::
! is where the hash of your wanted password should go.



Create a backup of this file, then just copy the hash from your normal user to the root user. It should look something like: $6$bxwJfzor$MUhUWO0MUgdkWfPPEydqgZpm.YtPMI/gaM4lVqhP21LFNWmSJ821kvJnIyoODYtBh.SF9aR7ciQBRCcw5bgjX0
Copy this to the place of the ! sign, save and reboot. You should be able to login to root user using your normal users password. Install sudo and then restore the copy you created to make sure root has no password again. There might be more efficient ways of doing this but this is what came to my mind.






share|improve this answer

















  • 1




    Recovery mode is probably more efficient
    – wjandrea
    Nov 27 at 4:31


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













I'm assuming you deleted sudo? If the root account has a password set you can login as root user or use su -c "apt-get install sudo"



If the root user has no password which is most likely the case, you can edit the /etc/shadow file by mounting your hard drive with a live cd.
The first line will contain the entry for root user, something like this:
root:!:17828:0:99999:7:::
! is where the hash of your wanted password should go.



Create a backup of this file, then just copy the hash from your normal user to the root user. It should look something like: $6$bxwJfzor$MUhUWO0MUgdkWfPPEydqgZpm.YtPMI/gaM4lVqhP21LFNWmSJ821kvJnIyoODYtBh.SF9aR7ciQBRCcw5bgjX0
Copy this to the place of the ! sign, save and reboot. You should be able to login to root user using your normal users password. Install sudo and then restore the copy you created to make sure root has no password again. There might be more efficient ways of doing this but this is what came to my mind.






share|improve this answer

















  • 1




    Recovery mode is probably more efficient
    – wjandrea
    Nov 27 at 4:31















up vote
1
down vote













I'm assuming you deleted sudo? If the root account has a password set you can login as root user or use su -c "apt-get install sudo"



If the root user has no password which is most likely the case, you can edit the /etc/shadow file by mounting your hard drive with a live cd.
The first line will contain the entry for root user, something like this:
root:!:17828:0:99999:7:::
! is where the hash of your wanted password should go.



Create a backup of this file, then just copy the hash from your normal user to the root user. It should look something like: $6$bxwJfzor$MUhUWO0MUgdkWfPPEydqgZpm.YtPMI/gaM4lVqhP21LFNWmSJ821kvJnIyoODYtBh.SF9aR7ciQBRCcw5bgjX0
Copy this to the place of the ! sign, save and reboot. You should be able to login to root user using your normal users password. Install sudo and then restore the copy you created to make sure root has no password again. There might be more efficient ways of doing this but this is what came to my mind.






share|improve this answer

















  • 1




    Recovery mode is probably more efficient
    – wjandrea
    Nov 27 at 4:31













up vote
1
down vote










up vote
1
down vote









I'm assuming you deleted sudo? If the root account has a password set you can login as root user or use su -c "apt-get install sudo"



If the root user has no password which is most likely the case, you can edit the /etc/shadow file by mounting your hard drive with a live cd.
The first line will contain the entry for root user, something like this:
root:!:17828:0:99999:7:::
! is where the hash of your wanted password should go.



Create a backup of this file, then just copy the hash from your normal user to the root user. It should look something like: $6$bxwJfzor$MUhUWO0MUgdkWfPPEydqgZpm.YtPMI/gaM4lVqhP21LFNWmSJ821kvJnIyoODYtBh.SF9aR7ciQBRCcw5bgjX0
Copy this to the place of the ! sign, save and reboot. You should be able to login to root user using your normal users password. Install sudo and then restore the copy you created to make sure root has no password again. There might be more efficient ways of doing this but this is what came to my mind.






share|improve this answer












I'm assuming you deleted sudo? If the root account has a password set you can login as root user or use su -c "apt-get install sudo"



If the root user has no password which is most likely the case, you can edit the /etc/shadow file by mounting your hard drive with a live cd.
The first line will contain the entry for root user, something like this:
root:!:17828:0:99999:7:::
! is where the hash of your wanted password should go.



Create a backup of this file, then just copy the hash from your normal user to the root user. It should look something like: $6$bxwJfzor$MUhUWO0MUgdkWfPPEydqgZpm.YtPMI/gaM4lVqhP21LFNWmSJ821kvJnIyoODYtBh.SF9aR7ciQBRCcw5bgjX0
Copy this to the place of the ! sign, save and reboot. You should be able to login to root user using your normal users password. Install sudo and then restore the copy you created to make sure root has no password again. There might be more efficient ways of doing this but this is what came to my mind.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 27 at 3:11









ataalik

216




216








  • 1




    Recovery mode is probably more efficient
    – wjandrea
    Nov 27 at 4:31














  • 1




    Recovery mode is probably more efficient
    – wjandrea
    Nov 27 at 4:31








1




1




Recovery mode is probably more efficient
– wjandrea
Nov 27 at 4:31




Recovery mode is probably more efficient
– wjandrea
Nov 27 at 4:31



Popular posts from this blog

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?