Nikos Baxevanis

Setting up an Ubuntu environment

2018-01-31 | #misc #haskell #fsharp 

Tried on Ubuntu 16.04.3 LTS (Xenial Xerus)

Chrome

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb

If you encounter any errors simply use

sudo apt-get -f install

To run it from terminal use google-chrome or google-chrome --incognito.

I usually run it with

and in the settings I disable

See also:

Back to top

Sublime Text

Install the GPG key:

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -

Ensure APT is set up to work with https sources:

sudo apt-get install apt-transport-https

Use the stable channel:

echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt-get install sublime-text

Type subl to run it from terminal.

See also:

Back to top

To find where Sublime Text (or any other package) is installed:

dpkg -L sublime-text

Git

sudo apt-get install git

If you’re used to git gui on Windows, that’s available too:

sudo apt-get install git-gui

See also:

Back to top

Jekyll

sudo apt-get install ruby ruby-dev
sudo apt-get install build-essential
sudo gem install jekyll jekyll-feed jekyll-gist jekyll-sitemap

Tested with my Jekyll blog, which is extremely minimal. Perhaps you need to install more Jekyll extensions.

Bash on Ubuntu on Windows

Open a new Command Prompt instance, and type the following:

bash

Your Command Prompt instance should now be a Bash instance.

sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby2.3 ruby2.3-dev build-essential dh-autoreconf
sudo gem update
sudo gem install jekyll jekyll-feed jekyll-gist jekyll-sitemap

See also:

Back to top

The Haskell Tool Stack

curl -sSL https://get.haskellstack.org/ | sh
# or
wget -qO- https://get.haskellstack.org/ | sh

See also:

Back to top

hsdev

I use hsdev-0.2.5.1 with SublimeHaskell, and I plan to use hsdev-0.3.* soon. If I do it, I may update this section.

sudo apt-get install libncurses-dev

In .stack.yaml add:

resolver: lts-10.3
extra-deps:
- haddock-api-2.18.1
- haddock-library-1.4.4
- hdocs-0.5.2.1

Then do:

stack build hsdev-0.2.5.1

I usually also do:

stack build stylish-haskell
stack build hlint

Back to top

Intero

I use Intero with Haskero.

sudo apt-get install libncurses-dev
stack build intero

I usually also do:

stack build stylish-haskell
stack build hlint
stack build apply-refact

Back to top

Visual Studio Code

The repository and GPG key can be installed manually with the following script:

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

Then update the package cache and install the package using:

sudo apt-get update
sudo apt-get install code # or code-insiders

See also:

Back to top

Mount Shared Folders (VMware Fusion)

cd ~
mkdir folder_name
vmhgfs-fuse .host:/$(vmware-hgfsclient) ~/folder_name

See also:

Back to top

.NET Core

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update

sudo apt-get install dotnet-sdk-2.1.3

See also:

Back to top

Mono

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-official.list
sudo apt-get update
sudo apt-get install mono-devel

See also:

Back to top

F#

sudo apt-get update
sudo apt-get install fsharp

See also:

Back to top

Dieharder

sudo apt-get install dieharder

See also:

Ration

Quickly resize and position your windows. Similar to Divvy, but for Linux.

sudo apt-get install python-gtk2 python-pip python-keybinder wmctrl
pip install ration

See also:

Back to top

APT maintenance

sudo apt-get check
sudo apt-get -f install
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove

See also:

sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update

See also:

If you get this error while trying to install a package or tool:

E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?

You can delete the lock file with the following command:

sudo rm /var/lib/apt/lists/lock

You may also need to delete the lock file in the cache directory:

sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

See also:

Back to top