4

I am on Ubuntu 14.04 LTS.

I installed buildozer and it ended up in /usr/local/bin. I can't run it without using sudo or root and that will likely cause problems down the road. Right now trying to run buildozer init will return buildozer: command not found unless I use root. How can I make the programs in /usr/local/bin/ visible without using root?

If that is not possible, is it safe for me to move buildozer to another folder that's in the PATH variable and still have it work without issues?

/usr/local/bin is already in my PATH variable.

Moving buildozer and buildozer-remote to /usr/bin/ and running buildozer init gives:

Traceback (most recent call last):
  File "/usr/bin/buildozer", line 9, in <module>
    load_entry_point('buildozer==0.29', 'console_scripts', 'buildozer')()
  File "/usr/local/lib/python2.7/dist-packages/buildozer/scripts/client.py", line 13, in main
    Buildozer().run_command(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/buildozer/__init__.py", line 971, in run_command
    getattr(self, cmd)(*args)
  File "/usr/local/lib/python2.7/dist-packages/buildozer/__init__.py", line 1015, in cmd_init
    copyfile(join(dirname(__file__), 'default.spec'), 'buildozer.spec')
  File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'buildozer.spec'

EDIT: I changed directories to where am actually doing the Python work and it worked fine. Thanks so much!! :)

muru
  • 207,228
Tan Wang
  • 141

1 Answers1

2

Use ls -l to give you a long list. The result should look something like this:

drwxr--r-- 10 root root 4096 Jul 25 22:17 usr

The fields here show you the access rights to the file, file's number of hard links, the username of the owner, the name of the group that owns the file, size of the file in bytes, date and time of the file's last modification, and name of the file, respectively.

What you are interested in is the access rights to the file and user and group owner of the file. If it says "root root", then you must have root privileges - use sudo command - to write or execute the file.

You can use the chmod chown and chgrp commands to modify the permissions of the file. I would however discourage you from letting users apart from root write or execute files in the /usr/bin directory. It can lead to compromising the security of your system.

Error edited thanks to @Martin Thornton.