When i was trying to update my Linux on Windows 10, i always got this error message:
W: GPG-Error: http://security.ubuntu.com trusty-security InRelease: »gpgv« wasn’t able to execute for checking signature (is gpgv installed?)
W: GPG-Error: http://archive.ubuntu.com trusty-updates InRelease: »gpgv« wasn’t able to execute for checking signature (is gpgv installed?)
E: Couldn’t create temporary file to work with /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_trusty_Release – mkstemp (2: File or Folder not found)
dpkg: Error: Updates-Folder »/var/lib/dpkg/updates/« can’t be read: File or Folder not found
W: /etc/apt/preferences.d/ can’t be read. – DirectoryExists (2: File or Folder not found)
E: Sub-process /usr/bin/dpkg returned an error code (2)
No matter what tip i tried to use, nothing really helped, until i found a fix for it that resolved any error and did let me update the system normally again.
Here is what i did to fix it:
mkdir /tmp
mkdir /etc/apt/preferences.d
mkdir /var/lib/dpkg/updates
After this, everything ran fine again and no errors on apt-get update , apt-get dist-upgrade or apt-get upgrade.