8
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?
snoop
  • 4,030
  • 8
  • 39
  • 58
Md Taufique
  • 81
  • 1
  • 1
  • 2

2 Answers2

9

For the missing partial:

sudo mkdir -p /var/lib/apt/lists/partial
Andrea Ligios
  • 113
  • 2
  • 16
Vishnu N K
  • 595
  • 5
  • 22
0

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

Promise Preston
  • 253
  • 1
  • 3
  • 9