Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I need to install qt5 on my system and I can only run it as the normal user. When I try to run it as the "super user" I get this error:

root ~ # ./qt-opensource-linux-x64-5.3.2.run 
No protocol specified
qt-opensource-linux-x64-5.3.2.run: cannot connect to X server :0.0

I've done:

root ~ # export DISPLAY=:0.0
root ~ # echo $DISPLAY
:0.0

Still no luck.

Questions:

Is there a reason why I wouldn't want to install it as root? Doesn't running it as root supposedly install it "system wide"?

How do I run it as root?

EDIT #1

My distribution is Debian Wheezy if it matters.

If I run it with sudo:

~$ sudo ./qt-opensource-linux-x64-5.3.2.run 
No protocol specified
qt-opensource-linux-x64-5.3.2.run: cannot connect to X server :0.0

Same error.

EDIT #2

This script is from here and is the qt5 installer(Qt is a cross-platform application and UI development framework. Using Qt, you can easily port a GUI application to multiple platforms without rewriting application code from scratch.)

EDIT #3

From what I can gather from the directions on this site, the installer should be run as root, they run it with "sudo" in there?

Exerpt from directions:

$ chmod +x qt-linux-opensource-5.2.0-x86-offline.run
$ sudo ./qt-linux-opensource-5.2.0-x86-offline.run 
share|improve this question
    
Does it work if you use sudo? Does it work if you run xhost + as your regular user before switching to root? –  terdon 15 hours ago
    
@terdon I've edited my question. –  somethingSomething 15 hours ago
    
Is there an actual problem? Do you need to run it as root? Remember that we have no idea what this script is (you haven't told us). Whether it is installed system-wide or not is completely dependent on what the script does. Don't run things as root unless necessary. –  terdon 15 hours ago
    
@terdon Yes I think I shuld run it as root, as they do on the site which I was following. I edited my post. –  somethingSomething 15 hours ago
    
OK, so did you try running xhost + as I suggested in my first comment? –  terdon 15 hours ago

2 Answers 2

up vote 1 down vote accepted

This works as expected out of the box on my system. You don't seem to have your sudo configured to allow you to run graphical applications. I haven't encountered this issue in quite a few years but one of these should work:

  1. Switch off access control for X

    xhost +
    sudo ./qt-opensource-linux-x64-1.6.0-5-online.run
    

    Then, activate it again with xhost -.

  2. Export your environment to the sudo session.

    sudo -E ./qt-opensource-linux-x64-1.6.0-5-online.run
    

    I'm not sure how relevant this one is but it's worth a try.

share|improve this answer

No there is normally no reason not to install as root, this is quite common. No "running" as root is not the same as installing as root. You should not run this as root, it is in my experience very seldom that an X client needs to be run as root.

Installing and running are different things. Many items need to be installed as root to get into the directories configured during compilation, but they will be run afterwards as "normal" users.

The installing is the final part of the compilation process. The compilation for many packages can be done as a normal user, e.g. in some subdirectory of your homedirectory. But when it comes to installing, the executable binaries and scripts to /usr/local/bin or /usr/bin, and other files to /usr/lib etc., you need the special rights root has to write there.¹

This is what you typical get with

tar xvf somepackage.tar
cd somepackage
./configure
make
sudo make install

Only the last command in that chain needs to be done "as root"²

After installation every user can use those executables, but, among other things, this prevents them from altering the "global" setup.

¹ There are more reasons to do this as root, e.g. when you need to set some setuid or setgid bits
² Often the last commands are chained with && so install is only tried when the make succeeded

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.