1

I am using Ubuntu 16 and today I have installed the telegram desktop as the following link: Unity Dash and Telegram But I could not run telegram from dash. I also have created the telegram.desktop in following path:

/usr/share/applications/

with following content:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name=Telegram
Exec=/opt/telegram/Telegram
Comment=Network taking back our right to privacy.
Icon=/opt/telegram/telegram.svg
Categories=GNOME;GTK;Network;

But this does not change any thing.

I can only run telegram by

sudo /opt/telegram/Telegram

but again it does not work without sudo and I got the following error (screenshot): error screenshot

Rasoul
  • 73
  • Are you sure that you own all the files in your home folder and you have all the permissions needed? If you often run graphical apps with sudo, this might break your system. Use gksudo or configure pkexec to do it! Try to acquire again all the ownerships in your home sudo chown -R rasoul:rasoul /home/rasoul and try again to launch telegram without sudo. – dadexix86 Jan 14 '17 at 11:02

2 Answers2

2

It seems at first clean installation of Telegram, you're accidently running it with sudo privilege, and this is where the problem is occurred. You shouldn't have do that, the convenience way to run graphical program as root is using gksudo command.

If you using sudo command on graphical program (such as Telegram), they may save their configuration files in your home directory and caused the file owned by root (inaccessible when you run it with non-root privilege). This is what happen to your /home/rasoul/.local/share/TelegramDesktop/log_startXX.txt.

To resolve this, you may need to reset the file owner and group setting (chown). Open terminal and type:

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

Source:

What is the difference between "gksudo nautilus" and "sudo nautilus"?

Telegram only runs with sudo

Liso
  • 15,377
  • 3
  • 51
  • 80
  • Telegram is installed with sudo, because users use these commands: sudo apt install software-properties-common; sudo add-apt-repository ppa:atareao/telegram && sudo apt update; sudo apt install telegram – kostyabakay May 19 '18 at 10:44
2

Thanks you guys for kind help. Finally, I cam up with solution. First I tried to change the permission of the

/home/rasoul/.local/share/TelegramDesktop/log_startXX.txt.

but it did not work ( actually I could not change the permission). After that I removed the Telegram Desktop completely, the I removed the following directory:

~/.local/share/TelegramDesktop/log_startXX.txt

by using this command.

sudo rm-R  ~/.local/share/TelegramDesktop

Then, I re-installed the telegram desktop.

Rasoul
  • 73