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?

2
  • I downloaded the compiled filed from Telgram's website. I edited my question for clarification. Thank you.
    – ig343
    Oct 31, 2016 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, 2016 at 15:55

2 Answers 2

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.

4
  • Thank you. This makes sense. But the file simply does not exist
    – ig343
    Nov 1, 2016 at 3: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 1, 2016 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 2, 2016 at 5:16
  • waltinator has the correct solution. When i did this Telegram started working for me.
    – Anjaan
    Feb 28, 2017 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

3
  • Ok. Just to learn: why is this?? \
    – ig343
    Oct 31, 2016 at 16:23
  • 1
    That is where executable files go, a user can then run them without sudo, like an installed application.
    – Mark Kirby
    Oct 31, 2016 at 16:28
  • 1
    You could not run it from /usr/local because your user does not have the right to run fiels from that folder.
    – Mark Kirby
    Oct 31, 2016 at 16:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .