I have used the following command to copy folder containing JPEG and PNG images:

sudo cp -r ~/Downloads/wallpap/ /usr/share/backgrounds/

However the JPEG images turn black while the PNG images are just fine. How do I avoid it?

  • Does this happen if you copy the files elsewhere (using cp and something else), or use the cp command directly on a file? (e.g. sudo cp ~/Downloads/wallpap/file.jpg /usr/share/backgrounds/ ). Also what version of ubuntu are u using? – Wilf Mar 9 '15 at 7:14
  • It happens only when the destination is outside my home directory. I am using ubuntu 14.04 LTS – Palash Sarkar Mar 9 '15 at 10:55

Maybe the files permissions are not correctly set. Run the following to reset permissions to default (644 for files and 755 for directories):

sudo find /usr/share/backgrounds/ -type f -exec chmod 644 {} +
sudo find /usr/share/backgrounds/ -type d -exec chmod 755 {} +

if you are copying as the root user (sudo cp -r ~/Downloads/wallpap/ /usr/share/backgrounds/)

then you'll have to change the permissions:

 sudo chown -R username /usr/share/backgrounds/wallpap/

Hope this'll help you

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.