Using, working with or contributing to a H/FOSS project will invariably require you to install some additional software on your computer. There are three primary ways of accomplishing this on linux. There are graphical software managers, like the Ubuntu Software Center, that allow you to browse and install available software in a GUI. There are also tools, like APT, dkpg and yum, that install software from the command line. Finally, it is also possible to download, build and install software from its source code. The exercises below will guide you through the process of installing some software onto Ubuntu using the graphical Software Manager and also the APT command line tool. We'll build and install a program from source in another exercise later.
Prerequisites
Before starting watch the video tutorial below, which will introduce you to the basic system administration tools for installing software on linux:
Exercises
Complete each of the following exercises:
java
on the command line. Note that when you do, Ubuntu will tell you that java is not installed and make some suggestions as to which packages you might install (using apt) to get it. Those suggestions will install the OpenJDK and we will need to install the Oracle JDK instead. So don't follow those suggestions, go onto the next step...
java -version
to verify it. The output should include something similar to "Java(TM) SE Runtime Environment ... (build ...)", the exact build number will differ but should correspond to the latest JDK. Also run javac -version
to verify that the Java compiler is also present in addition to the runtime environment.
eclipse
on the command line to verify that it is not installed. Note, that as with the java
command above, Ubuntu is quite helpful here and tells you what package to install to get eclipse.
Use apt from the command line to install eclipse.
Notice that when you run apt to install eclipse it lists a large number of other packages to install or upgrade. One of the great features of package managers such as apt is that they will not only install the package you ask it to, but also any other packages that it needs to run (i.e. on which it depends). So in this case, installing eclipse also installed a wide range of other packages on which eclipse depends, saving you a lot of work!
Try to run eclipse from the command line.
You'll notice that it does not work! Apt attempted to install eclipse 3.8.1 which has an incompatibility with some of the installed libraries. This is something you will encounter fairly regularly in the Linux world.
Also run java -version
again. You'll notice that apt switched the the default version from the Sun Java to the Open JDK that was installed as a dependency of eclipse. You'll also need to be careful of things such as this when doing system administration tasks in linux. We could attempt to fix this issue by doing installs of different libraries and dependencies and we may eventually get eclipse to run. But it turns out there is a newer version of eclipse that can be installed with the snap command which will function properly.
Shut down your virtual machine and restore to the snapshot from before you attempted to install eclipse. Confirm that you have rolled back by trying to launch eclipse from the command line. You should again see the messages about using snap or apt to install eclipse.
Like git, we won't be using Meld today, but let's go ahead and install it so its ready when we need it. Figure out how to install Meld. Once you have it installed you can verify that it works by typing meld
on the command line. If everything is good then the GUI tool should appear.