How to install Docker

One way to install Docker is to add its repository and then install it from it. There are a lot of steps that need to be done for this, as seen here.

Since I do not really update packages so often, I prefer downloading the DEB file and installing it manually.

$ sudo dpkg -i your_docker_file.deb
  • Remember to add your username to the docker group:
$ sudo adduser joe docker
  • You will need to logout and login for the group assignment to take effect. If you find that logout-login to be painful, try this trick.

  • Try Docker and see if it works:

$ docker run hello-world

Tried with: Docker 17.09 and Ubuntu 16.04

Advertisements

How to install ASCIIDoctor

From Ubuntu repositories

This is easy, but the ASCIIDoctor version and the default theme it uses is ancient:

$ sudo apt install asciidoctor

$ aptitude show asciidoctor
Package: asciidoctor
Version: 0.1.4-1

From Ruby Gems

This is a more updated version with an updated theme:

$ sudo gem install asciidoctor

$ gem list asciidoctor

*** LOCAL GEMS ***

asciidoctor (1.5.2)

How to make startup disk from ISO using Startup Disk Creator

You need a startup disk or USB flash drive loaded with Ubuntu to install it on a new computer. Ubuntu can be downloaded as an ISO file. The Startup Disk Creator tool can be used to create such a startup disk from a ISO file.

Install

Startup Disk Creator will be present on a Ubuntu computer. If by chance you do not have it, it can be installed easily:

$ sudo apt install usb-creator-gtk

Use

  1. Download the Ubuntu (or any other) ISO file you need to make a startup disk from.

  2. Insert the USB stick or drive that you want to use as the startup disk. Note that it needs to be in FAT or FAT32 format! (Otherwise Startup Disk Creator will not show this drive.)

  3. Start the Startup Disk Creator from the Dash or usb-creator-gtk from the shell.

  4. Choose the source disk image (the downloaded ISO file) and the disk to use and click Make Startup Disk.

Once it is done, you can use this USB flash drive to install Ubuntu on other computers by booting from this drive! 😃

Note: An alternative to Startup Disk Creator is UNetBootIn, which can be used as described here. I have faced problems using it for making startup USB flash drives of Ubuntu 14.10.

Tried with: Startup Disk Creator 0.2.56 and Ubuntu 14.04

How to uninstall a make install

Many libraries can only be installed by building from source and installing using make install. Removing these installations can be quite painful.

In some rare cases, these Makefiles are written to support uninstall. In that case, you can go the same directory from where you did make install and try make uninstall. The only library I’ve seen supporting this is OpenCV.

For other installs which do not support uninstall, I highly recommend installing using checkinstall as described here.

Tried with: Ubuntu 14.04

Pip install error with PyCUDA

Problem

  • I tried to install PyCUDA using pip:
$ sudo pip install pycuda
  • The installation tries to compile a few C++ files and it failed on the very first file with this error:
In file included from src/cpp/cuda.cpp:1:0:
src/cpp/cuda.hpp:14:18: fatal error: cuda.h: No such file or directory
#include <cuda.h>
                ^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Investigation

  • This error was strange because I had set CUDA_ROOT and had added the bin path of CUDA installation to PATH environment variable. So, the installer should have found cuda.h which I could see was present in $CUDA_ROOT/include

  • To see what was happening, I tried the same command with verbosity:

$ sudo pip -vvv install pycuda
  • Now I could see that it was failing to find nvcc.

  • On downloading the source code of PyCUDA and checking setup.py, I saw that the check for nvcc was used to figure out the CUDA_ROOT and CUDA_INC_DIR.

  • The reason nvcc was not visible was that CUDA_ROOT was set for my user, but this PATH is not visible when a command is run under sudo, as described here. The solution was to make the CUDA bin path visible to sudo.

Solution

To make the $CUDA_ROOT/bin available in PATH for sudo, we can follow the steps described here. For example, on my system with CUDA 7.0 I followed these steps:

  • Created a new file /etc/profile.d/cuda.sh and added this line:
export PATH=/usr/local/cuda-7.0/bin:$PATH
  • Opened root shell without resetting PATH and ran the pip installation:
$ sudo su -
$ pip install pycuda

This worked and PyCUDA was installed successfully! 🙂

Tried with: PyCUDA 2015.1.2, CUDA 7.0 and Ubuntu 14.04

Feature transfer error: Access is denied

Problem

A friend of mine was trying to install the EMTrade program on Windows 8.1. He was logged in as a standard user, but when the installer asked for administrator permissions using User Account Control (UAC), he provided the login and password of an administrator account. The installer proceeded to install, but failed while creating the C:\Program Files\Emkay directory, with this error:

Feature transfer error
File: C:Program FilesEmkay
Access is denied

Solution

A few old installers for Windows still struggle with UAC. The EMTrade installer worked fine when I explicitly switched user, logged into an administrator account and installed from inside it.

Tried with: Windows 8.1

How to install Fish

Fish is a modern shell that has user-friendly features like colors and auto-completion and works right out of the box.

Ubuntu already ships Fish, so installing it is easy:

$ sudo apt install fish

The version of Fish that Ubuntu maintains is quite old. Fish is under active development, with lots of new features added regularly. If you want the latest stable version of Fish:

$ sudo apt remove fish
$ sudo add-apt-repository ppa:fish-shell/release-2
$ sudo apt-get update
$ sudo apt install fish

If you want the latest beta version of Fish:

$ sudo apt remove fish
$ sudo add-apt-repository ppa:fish-shell/beta-2
$ sudo apt-get update
$ sudo apt install fish

Tried with: Fish 2.2b1 and Ubuntu 14.04

CUDA installation error of unmet dependencies

I was trying to install CUDA and got this error:

$ sudo apt-get install cuda
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 cuda : Depends: cuda-6-5 (= 6.5-14) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

On searching, a lot of folks had this error. Their errors were solved when they removed old NVIDIA packages they had installed. But, I did not have any NVIDIA package installed!

What were these broken packages I had on the system, I didn’t know! I followed the dependency chain by trying to install cuda-6-5, which complained on another package and so on. In the end, I found that I had a lot of unnecessary packages, all of which had :i386 at the end of their name.

The strangest part was that running sudo apt-get autoremove had no effect on these packages, they were not removed. So, I manually removed all of them using sudo apt-get remove.

When I tried to install CUDA after this, it worked fine! 🙂

Tried with: Ubuntu 14.04

How to install CUDA 6.5 on Ubuntu 14.04

Installing CUDA is becoming increasingly easier on Ubuntu. I think I keep hitting problems because I am usually updating from an older NVIDIA graphics driver or CUDA version. NVIDIA continues to be quite bad at providing error-free upgrades. Anyway, this is what worked for me:

  • Do not try to install any of the NVIDIA drivers or CUDA packages that are in the Ubuntu repositories. I wasted a day with the errors these operations threw up!

  • Uninstall all CUDA packages and NVIDIA drivers you may have on your Ubuntu system.

  • Download the CUDA .deb package for Ubuntu 14.04 from here. For me, it was a cuda-repo-ubuntu1404_6.5-14_amd64.deb file.

  • The .deb file just adds a CUDA repository maintained by NVIDIA. Install this .deb file and update:

$ sudo gdebi cuda-repo-ubuntu1404_6.5-14_amd64.deb
$ sudo apt-get update
  • Installing CUDA now is easy as this:
$ sudo apt-get install cuda

This is a big install, it will install everything including a nvidia-340 driver that actually worked and NVIDIA NSight. After the install, reboot the computer. Your CUDA is ready for work now 🙂

Note: I tried this on two systems. On one, it installed without any problem. On the other, it gave an error of unmet dependencies. I have described here how I solved this problem.

Tried with: NVIDIA GeForce GTS 250 and NVIDIA GTX Titan