5

I don't know why, but I can only run Telegram with sudo. I just downloaded the tar from desktop.telegram.com and extracted its contents in /usr/local/Telegram.

I can now open the program with:

sudo /usr/local/Telegram/Telegram 

but not with

/usr/local/Telegram/Telegram

If I do the second one, I get an error log:

[2016.10.31 12:53:39] Launched version: 10019, alpha: [FALSE], beta: 0, debug mode: [FALSE], test dc: [FALSE]
[2016.10.31 12:53:39] Executable dir: , name: 
[2016.10.31 12:53:39] Initial working dir: /home/iguarna/
[2016.10.31 12:53:39] Working dir: /home/iguarna/.local/share/TelegramDesktop/
[2016.10.31 12:53:39] Arguments: "Telegram"
[2016.10.31 12:53:39] FATAL: Could not open '/home/iguarna/.local/share/TelegramDesktop/log_startXX.txt' for writing log!
[2016.10.31 12:53:39] Connecting local socket to /tmp/95578c71afe4942c16be0fb6f3bfa82f-{87A94AB0-E370-4cde-98D3-ACC110C5967D}...
[2016.10.31 12:53:39] This is the only instance of Telegram, starting server and app...

What could be the reason?

ig343
  • 1,008
  • I downloaded the compiled filed from Telgram's website. I edited my question for clarification. Thank you. – ig343 Oct 31 '16 at 15:46
  • Thanks, but that's not it. It is still the same. If I a reboot my system and try to run the app again, it throws an error log. It looks as if for some reason Telegram is expecting admin privileges. – ig343 Oct 31 '16 at 15:55

2 Answers2

3

The error message FATAL: Could not open '/home/iguarna/.local/share/TelegramDesktop/log_startXX.txt' for writing log! shows that you did run telegram as root, and it created the log file (as root), now, the regular user cannot write to the root-owned log file. Fix this by:

sudo chown $(id -u):$(id -g) /home/iguarna/.local/share/TelegramDesktop/log_startXX.txt  

Where you run a program from is immaterial. Who you run a program as is important.

waltinator
  • 36,399
  • Thank you. This makes sense. But the file simply does not exist – ig343 Nov 01 '16 at 03:54
  • 2
    Then the problem is directory ownership. Fix it with sudo chown -R $(id -u:$(id -g) /home/iguarna/.local/ and don't run graphics tools as root. – waltinator Nov 01 '16 at 22:42
  • That was it. Thank you very much. You missed one parenthesis. It should be sudo chown -R $(id -u):$(id -g) /home/iguarna/.local/ . I am accepting your answer. – ig343 Nov 02 '16 at 05:16
  • waltinator has the correct solution. When i did this Telegram started working for me. – Anjaan Feb 28 '17 at 18:26
1

Put your file in /usr/bin not /usr/local and not the whole folder JUST the telegram executable and then run

Telegram

It starts up for me on 16.04 this way, also, keep that updater script somewhere safe for later.

enter image description here

Mark Kirby
  • 18,529
  • 19
  • 78
  • 114