sudo apt-get update
sudo: unable to mkdir /var/lib/sudo: No such file or directory
[sudo] password for md:
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (2: No such file or directory)
E: List of files can't be created as '/var/cache/apt/' is not a directory
E: List of files can't be created as '/var/cache/apt/' is not a directory
E: Could not open lock file /var/lib/dpkg/lock - open (2: No such file or directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
Add a comment
|
2 Answers
I had this same issue when trying to install an Typora on Ubuntu 20.04.
Whenever I run the command below:
# add Typora's repository
sudo add-apt-repository 'deb https://typora.io/linux ./'
I was running into the error:
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (2: No such file or directory)
E: List of files can't be created as '/var/cache/apt/' is not a directory
E: List of files can't be created as '/var/cache/apt/' is not a directory
E: Could not open lock file /var/lib/dpkg/lock - open (2: No such file or directory)
Here's how I solved it:
I disconnected and reconnected my network connection, and when I ran the command again, it worked fine.
I think it was an issue with my network connectivity.
That's all.
I hope this helps