9  Installing Linux

9.1 Install OS

https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview

9.2 Install key support apps

  • sudo apt install git
  • sudo apt install vim

9.3 R

Following this website

  • sudo apt-get update
  • wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
  • to verify key type: gpg –show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
  • sudo apt-get update
  • sudo apt-get install r-base r-base-core r-recommended r-base-dev
  • sudo apt install libcurl4-openssl-dev
  • sudo apt install libfontconfig1-dev
  • sudo apt install libxml2-dev
  • sudo apt install libharfbuzz-dev libfribidi-dev
  • sudo apt install libssl-dev
  • sudo apt install libtiff5-dev
  • sudo apt install libfreetype6-dev
  • sudo apt install libpng-dev
  • libjpeg-dev

Then install RStudio by getting current deb file from their website

Then install key packages

  • devtools
  • tidyverse

For more info if problems

  • https://www.r-bloggers.com/2022/08/installation-of-r-4-2-on-ubuntu-22-04-1-lts-and-tips-for-spatial-packages/

  • https://www.digitalocean.com/community/tutorials/how-to-install-r-on-ubuntu-22-04

  • https://computingforgeeks.com/how-to-install-r-and-rstudio-on-ubuntu-debian-mint/

and for updates of R version, see https://docs.posit.co/resources/install-r

9.4 Quarto

  • Download latest version of Quarto

  • install using sudo apt install <package path> or sudo dpkg -i <package path>

https://docs.posit.co/resources/install-quarto/

https://www.cyberciti.biz/faq/how-to-install-curl-command-on-a-ubuntu-linux/

9.5 Zotero

  • sudo apt update
  • sudo apt upgrade
  • sudo snap install zotero-snap

After zotero is installed, you can synch to the Addiction Research Lab library. Go to menu edit:preferences:synch. Username is jjccurtin. Ask John or Susan for the password.

9.6 Slack

Slack is easily installed from the Ubuntu Software Center. Open up the software center. Search for Slack. Install. Done.

9.6.1 pdfs

  • sudo snap install evince for viewing pdfs

  • sudo apt-get install qpdf for manipulating pdfs (e.g., extract pages)

9.7 Global Protect

9.8 Meld Merge for file diffs

  • install from terminal: sudo apt install meld
  • or download and install meld merge
  • add the following to your .gitconfig file
[diff]
    tool = meld
[difftool]
    prompt = false
[difftool "meld"]
cmd = meld "$LOCAL" "$REMOTE"

# The order of the Meld GUI window panes can be controlled by the order of $LOCAL and $REMOTE in cmd

9.9 CSV

https://www.tadviewer.com/

https://www.moderncsv.com/

9.10 Mount Shares

  • sudo apt-get install cifs-utils

  • create directories within ~/mnt/ for each share.

  • credential files are already saved in ~/github/linux/config

  • aliases for mounts are already saved in ~/github/linux/config/.bash_aliases

9.11 Set up SSH Client and Server

https://ubuntu.com/server/docs/service-openssh

9.12 Creating SSH passkeys

You can create an ssh key to ssh without the need to provide username and password. In our lab, these are useful to ssh to CHTC or for git shh to GitHub.

To create the key

  1. Open a terminal and type ssh-keygen -t ed25519.

  2. Accept the defaults by repeatedly pressing enter and this will create a key with defauult names .ssh/id_ed25519, and .ssh/id_ed25519.pub.

  3. After creating the keys, you may need to change their permissions.

  • chmod 644 id_ed25519.pub
  • chmod 600 id_ed25519

To use this key with CHTC

  1. Create or edit personal CHTC configuration file at ~/.ssh/config. Run the following at the terminal:
# Let's create (or add to) our SSH client configuration file. 
echo "
Host *.chtc.wisc.edu
  # Turn ControlMaster on
  ControlMaster auto
  # ControlMaster connection will persist
  # for 2 hours of idleness, after which
  # it will disconnect
  ControlPersist 2h
  # Where to store files that represent
  # the ControlMaster persistent connections
  ControlPath ~/.ssh/connections/%r@%h:%p" >> ~/.ssh/config
  1. In the same ~/.ssh/config directory, make a folder called connections

mkdir -p ~/.ssh/connections

  1. Open the public key file (id_25519.pub) and copy the content.

  2. SSH to CTHC

ssh netid@submit-1.chtc.wisc.edu

  1. Create or edit .ssh/authorized_keys

  2. Paste your public key info at the end of this file.

To use this key with Github

  1. Go to your settings (point at your profile picture and select settings.

  2. Select SSH and GPG Keys

  3. Click New SSH Key, give it a title, and paste the public key info into Key box.

For more info

  • https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

  • https://github.com/settings/keys

  • https://www.beyondtrust.com/blog/entry/ssh-key-management-overview-6-best-practices

9.13 Sound mixer settings

install pavucontrol to get mic on zoom to work

alsamixer from terminal may help

9.14 VNC for Remote Access

https://kb.wisc.edu/biochem/it/page.php?id=127360

9.15 SSH to office computer

https://linuxhint.com/enable-use-ssh-ubuntu/

use username for hostname

9.15.1 X11 forwarding

X11 forwarding is used in SSH to display GUI for app (e.g., rstudio) on remote computer (e.g., office computer). To enable X11 forwarding, need to edit /etc/ssh/sshd_config on remote computer to indicate: - X11Forwarding yes

May also want to set - X11DisplayOffset 10 - X11UseLocalhost yes - TCPKeepAlive yes

May need to install xauth on remote computer.

Need to use -X flag with ssh from local computer. Can then open GUI for remote app (e.g.. rstudio)

9.15.2 VNC

  • Documentation on how to install tightvnc on host.

  • Start vncserver on host with specific resolution: vncserver -geometry 2560x1080 -depth 24

  • On client, can use Remmina with SSH.

9.16 Customize CLI prompt

This will set up a green prompt with relative path for current directory.

PS1=“$ (https://git-scm.com/download/win).

This is NOT needed if you are installing Linux as your OS.

9.17 Vim anywhere

https://github.com/cknadler/vim-anywhere