One of Quill’s functions is that it lets you list the third-party libraries you need, and it goes out and fetches them for you. It fetches them from ActiveState‘s “teapot repository”, using a program called “teacup” which is delivered with ActiveTcl. And therein lies the problem.
When you install ActiveTcl, it naturally wants to be installed for all users on the machine. On Windows you just need “admin” privileges, and then there’s no problem. (And if you’re a working programmer, and you’re forced to use a Windows machine on which you don’t have admin privileges, why aren’t you looking for a new job?)
But on Linux or Mac OSX, “admin” privileges mostly give you access to the ever dreaded, much to be feared “sudo” command.
See, on Un*x-family systems, there are really only two levels of privilege: either you’re a normal users, and there are some things you just can’t do, or you are the “root” user, and you can do anything you like—including going to the root of the file system and entering “rm -rf *” on the command line. (Note for the Un*x-impaired: this deletes all of the files on your disk, and is generally considered to be a bad idea.)
It used to be that Un*x system administrators would spend most of their time as normal users, logging into the “root” account only when necessary, and then logging out again. These days, though, the humble “sudo” command is the tool of choice: it lets you execute a single command as “root”. The “root” account is also called the “super-user” because of its super powers; and so “sudo” is literally “super-user do”.
No, folks, it doesn’t rhyme with “pseudo”. Sorry.
So if you have admin privileges these days, that usually means that you’re allowed to use the “sudo” command. Happy happy, joy joy!
So you want to install ActiveTcl, and it wants to be installed for all users, in “/opt/” or “/usr/local/”, and that’s probably wise; so you use “sudo” with a command like this:
$ sudo ./install.sh
And that pops up a GUI, and you install ActiveTcl, and all is good.
Well. Except that all of the files created during installation are now owned by “root”. And that includes the local teapot repository, where the library packages delivered with ActiveTcl live.
And so then you decide to install another package, and blessed innocent that you are, you simply type,
$ teacup install snit 2.3
And instead of installing the most excellent Snit 2.3 package, it outputs error messages because it cannot write to the teapot repository because the teapot repository is owned by the super-user and You Ain’t Him.
So you have to use “sudo”. So, blessed innocent that you are, you simply type,
$ sudo teacup install snit 2.3
If you’re lucky, it will go ahead and install Snit, and there will be great rejoicing. But more typically, “sudo” is set up to forget all about your local environment, and so it doesn’t know how to find the “teacup” command.
Sometimes, if you’re not a blessed innocent, and you know what you’re doing, you can try this:
$ sudo -E teacup install snit 2.3
This tells “sudo” to retain your environment, include your “PATH”, which indicates where all of the commands are, and it will find “teacup” and happily install everything for you.
Except, alas, when it doesn’t, as it doesn’t on the latest version of Ubuntu which a friend installed for me in a virtual machine so that I can test Quill on Linux. So then you have to do this:
$ sudo `which teacup` install snit 2.3
The “`which teacup`” tells the command shell to find the “teacup” program, and insert its full path with all the directories right where the `which teacup` was. That way, “sudo” won’t need to go looking for it. And then everything works.
But this is not simple; and this is not easy; and this is a pain in the neck; and it’s something that Quill is trying to save you from. I’ll have something about Quill’s solution next week.