Ubuntu: sudo sh -c ‘echo “deb http://archive.canonical.com/ubuntu trusty partner” >> /etc/apt/sources.list.d/canonical_partner.list’ not woking


I'm trying to skype on ubuntu 14.04, but when I type:

sudo sh -c ‘echo “deb http://archive.canonical.com/ubuntu trusty partner” >> /etc/apt/sources.list.d/canonical_partner.list’  

It says "Permission denied."

Please help, or tell me another way to get Skype.


The problem here has nothing to do with redirection, it's that you've copied curly quote characters. They are not the same as straight quotes (which the terminal understands as special characters) so the command does not mean the same thing at all.

This is largely the fault of the website you've copy-pasted the commands from (you should let them know).

To fix, simply replace the curly version with their straight counterparts:

sudo sh -c 'echo "deb http://archive.canonical.com/ubuntu trusty partner" >> /etc/apt/sources.list.d/canonical_partner.list'  

Yes, tee might look nicer but there's nothing wrong with redirection.

There was some question about whether this really was the cause. It is, but I'll prove it. The redirect in the original command is being interpreted first. Bash attempts to open a write handle (as the current user) on the output file first and fails.

$ sudo afoijaf2 > /rawr  -bash: /rawr: Permission denied  

That's why we don't see a command not found. afoijaf2 here is clearly non-existent and ‘echo is also clearly an invalid command. Neither are being executed â€"sudo hasn't even runâ€" because Bash failed to get a write handle. That errors out first.


You can not redirect with sudo, use tee

echo foo | sudo tee -a file  

There are other ways as well


Install Skype with GUI

for Skype you should go to download_skype, you probably need multiarch_version but I can't know that in advanced. It is something based on your ubuntu version.

Long story short when the .deb file is down on your system , open and install with ubuntu software center and basically that was it !

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »