I'm new to Linux and am attempting install the newest luarocks
version. I'm currently running version 2.0.8
(after running sudo apt-get update
) which isn't sufficient for some of my needs. Is there a way to specify the version to install? (Also: I'm running this Linux version through a VM)

- 153
3 Answers
So, you got Luarocks from the previous question, but you want a newer version. I checked the Luarocks homepage, and found their instructions to be pretty good, and did the install on a VM in my home machine - it worked!
Here's the steps:
1) Download the newest version of Luarocks from the download page at http://luarocks.org/releases/. Get the file luarocks-2.2.0.tar.gz
2) In the ~/Downloads
directory, where I am assuming your webbrowser placed the tar.gz
file, you will need to unpack file file.
Open a terminal windows (ctrl+alt+t) and first ensure that you have the tools to build programs:
sudo apt-get update
sudo apt-get install build-essential
Now change to the download directory, extract the Luarocks source files and change to their directory:
cd downloads
tar -xvf luarocks-2.2.0.tar.gz
cd luarocks-2.2.0
Down for the configure, build and update"
./configure
make build
sudo make install
You done! If you enter luarocks
at this point, it will confirm that you are on version 2.2.0

- 21,339
-
Hi Charles, thanks again. Worked perfectly. This should also help in future if I need to install other packages. – Black Dec 01 '14 at 03:14
In this case there is no possibility to specify a Version. But you can use
sudo apt-get upgrade
to update all your packages to the newest Version, luarocks too. And if you dont have luarocks installed yet, you can do it by typing:
sudo apt-get install luarocks
That should installiert the newest Version, which is available in the ubuntu package sources.

- 131
-
If there's no newer version of luarocks available, then
apt-get upgrade
would be useless at best, and could break what's working now at worst. Upgrading things like the kernel could cause problems, and I wouldn't do it for zero gain. – Xen2050 Nov 30 '14 at 09:50
Googling "luarocks ubuntu" brings up the packages.ubuntu.com website, where you can see what versions of programs are on what ubuntu's... Precise has version 2.0.8-2 ( http://packages.ubuntu.com/precise/luarocks ), trusty & utopic have 2.0.9-1, vivid has 2.2.0+dfsg-1 ( http://packages.ubuntu.com/vivid/luarocks ). Each new & older version is (currently) in the top-right "[lucid][precise]..." links on each page, and under the "Download luarocks" heading in the bottom left you can download the .deb files(s)
You might not have enabled the "backport" or "romeo/proposed" packages in the Software Sources, they might enable a newer version. And if there are multiple versions available you can use "=version" with apt-get install package=version
or using Synaptic "Package -> Force Version" and "Lock version" to keep a particular package from being changed.
If you're running linux in a VM anyway it might not be hard to download & run vivid.
Or you could try downloading the newer .deb package file(s) from the websites above, and install from the command line with dpkg -i
though they may require some other upgraded packages that aren't in your current ubuntu, which you may also need to try to download & upgrade manually.

- 8,705