I updated a server from 14.04 to 16.04. Now apt-get update does not work anymore. I get the following errors:

0% [2 InRelease gpgv 11.5 kB] [Connecting to archive.ubuntu.com (]
dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied
/usr/bin/apt-key: 316: /usr/bin/apt-key: cannot create /dev/null: Permission denied
gpgv: Signature made Thu Apr 28 20:16:42 2016 CEST using DSA key ID 437D05B5
gpgv: Can't check signature: public key not found

I can see that some child-processes of apt-get are running as user _apt, but I don’t know how to check apt-key and dpkg.

scp from a remote host also doesn’t work anymore with a similar error message:

Couldn't open /dev/null: Permission denied

Currently ls -alh /dev/null gives

crw------- 1 root root 1, 3 Apr 26 12:51 /dev/null

How can I fix the permissions? Maybe somebody with a fresh 16.04 install can give a comparison.


/dev/null should have 0666 permissions and that is what /etc/udev/rules.d/device-permissions.rules says:

KERNEL=="null|zero|full|random|urandom", MODE="0666"

But unfortunately this is a virtual server. So the kernel has not been updated:

# uname -a
Linux memocamp 2.6.32-042stab063.2 #1 SMP Tue Oct 23 16:24:09 MSK 2012 x86_64 x86_64 x86_64 GNU/Linux

A temporary fix is to manually set the permissions:

chmod go+rw /dev/null

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.