Skip to content

Latest commit

 

History

History
1182 lines (958 loc) · 45 KB

INSTALL_Buster-testing.org

File metadata and controls

1182 lines (958 loc) · 45 KB

Debian Testing (Buster) install

This is a complete tutorial to install Debian Testing (Buster). Most of the instructions are general enough to be applied on any computer. Keep in mind, however, that:

  • Keyboard layout is based on QWERTY, and adds extra key combinations to enable French characters and accents.
  • The installation is geared towards an academic work, primarily based on the use of Emacs, R and PostGIS (see Office and R, QGIS and PostGIS sections).

Table of contents

Installing Debian with the base Gnome desktop

Download the installer

The Debian way

Start by downloading an image of the Debian Installer for Debian Testing (Stretch), according to the platform of the computer. A good choice is the Network install (netinst), which will fetch all system packages directly on-line when installing. In this case, the file to download is the netinst daily snapshot for amd64 (debian-testing-amd64-netinst.iso, 300 MB). Then check MD5 sums to guarantee the integrity of the file:

cd ~/Downloads
wget https://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/amd64/iso-cd/debian-testing-amd64-netinst.iso
md5sum debian-testing-amd64-netinst.iso 
0eb811e33027672839445c418d6fde1e  debian-testing-amd64-netinst.iso

The next step is to copy the ISO on a USB flash drive. First check on which device the flash drive is mounted:

df -h
Filesystem                    Size  Used Avail Use% Mounted on
udev                          3.7G     0  3.7G   0% /dev
...
/dev/sda1                      59G  9.0G   50G  16% /media/<user>/<FLASH>

In this case, this shows that the flash drive is associated to sda. We can then use it to overwrite the flash drive with the ISO (WARNING #1: This formats the entire stick! WARNING #2: Change the value of sda accordingly! A flash drive is usually mounted on sdb when sda is used for the internal hard drive):

First unmount the flash drive, and copy the files

sudo umount /dev/sda1 
sudo cp debian-testing-amd64-netinst.iso /dev/sdX
sudo sync

From now on, all other steps will be on the ‘target’ computer.

The easy way

NOTE: If the standard procedure above failed (for instance, the computer does not boot on the Flash drive), an alternative is simply to use Etcher to create the USB bootable image (using the Netinstall 64 bits for Debian testing), check that the boot flag is set on the drive (with GParted), and move directly to the next step.

Install Debian

You can now boot the computer on the USB flash drive (on a modern DELL laptop, that requires to turn off UEFI Security Boot, in favor of Legacy boot) and follow the instructions. General guidelines:

  • Root: Leave the password empty — that way, root permissions are given to the first user using sudo.
  • Partitions: Use Guided - use entire disk and set up (encrypted or not) LVM, with separate /home partition. If encrypted, enter a good passphrase when required to do so (it will be required on every boot, but not when resuming from sleep). The partitioner will allocate 30 GB for the system (which is plenty) and about 8 GB for the swap (equal to RAM amount). Two good modifications are to keep only 3 % of reserved blocks for root (maintenance) on /home, as well as increasing /boot to 512MB.
    • Not encrypted: Use Guided - use entire disk and set up LVM, with separate /home partition.
  • It’s a good idea to participate in the package usage survey (results are encrypted).
  • Chose GNOME for the desktop, and leave print server and standard system utilities.
  • Finally, install the GRUB boot loader to the master boot record on the first hard drive (pick the hard drive, not the USB flash drive!).
  • Time to restart!

Terminal setup

  • Bash configuration:
    nano ~/.bashrc
        
    • Autocompletion: check that following lines are uncommented:
    if ! shopt -oq posix; then
      if [ -f /usr/share/bash-completion/bash_completion ]; then
        . /usr/share/bash-completion/bash_completion
      elif [ -f /etc/bash_completion ]; then
        . /etc/bash_completion
      fi
    fi
          
    • Other: add the following at the end of the file:
    # Manpages with colors
    export MANPAGER="/usr/bin/most -s"
    
    # Alias ls to have colors and directories before files 
    alias ls='ls --color=auto --group-directories-first'
    
    # Alias upgrade & upgrade-full
    alias upgrade='sudo apt update && sudo apt upgrade'
    alias upgrade-full='sudo apt update && sudo apt full-upgrade && sudo apt clean && sudo apt autoclean && sudo apt autoremove'
          

    :

    # Alias to restart Emacs daemon
    alias emacs-restart="systemctl --user restart emacs"
    
    # For Tilix and Powerline
    # https://gnunn1.github.io/tilix-web/manual/vteconfig/
    if [ $TILIX_ID ] || [ $VTE_VERSION ]; then
            source /etc/profile.d/vte.sh
    fi
    if [ -f `which powerline-daemon` ]; then
            powerline-daemon -q
            POWERLINE_BASH_CONTINUATION=1
            POWERLINE_BASH_SELECT=1
            . /usr/share/powerline/bindings/bash/powerline.sh
    fi
          
  • Install Tilix, PowerLine, python-nautilus (for “Open Tilix here” in Nautilus), curl and rsync, and add a missing symlink:
    sudo apt install tilix powerline python-nautilus curl rsync
    sudo ln -s /etc/profile.d/vte-2.91.sh /etc/profile.d/vte.sh
        
  • Tilix configuration (notably Automatically copy text to clipboard when selecting; dark theme variant; no titlebar for the Quake version; of the window; Ctrl+Shift+D+ to add terminal down; =Ctrl+Shift+R to add terminal right):
    gsettings set com.gexperts.Tilix.Settings unsafe-paste-alert false
    gsettings set com.gexperts.Tilix.Settings copy-on-select true
    gsettings set com.gexperts.Tilix.Settings terminal-title-style 'none'
    gsettings set com.gexperts.Tilix.Settings theme-variant 'dark'
    gsettings set com.gexperts.Tilix.Settings quake-hide-headerbar true
    gsettings set com.gexperts.Tilix.Keybindings session-add-down '<Primary><Shift>d'
    gsettings set com.gexperts.Tilix.Keybindings session-add-right '<Primary><Shift>r'
        
    • Copy Nord color theme in the right folder:
    sudo cp Tilix/nord.json /usr/share/tilix/schemes/
        
    • Profile: Default
      • General: Terminal bell: Icon
      • Color: Color scheme: Nord, and add some transparency
    • Shortcuts: in Gnome Settings > Devices > Keyboard, add two Custom shortcuts (at the bottom of the list):
      • Tilix / tilix / Super+T
      • Tilix (Quake mode) / tilix --quake / ` (above Tab)
  • Get insulted on errors for password:
    sudo visudo
        

    Add this line at the beginning of the file:

    Defaults        insults
          

Adjusting the system

System settings

  • Mouse & Touchpad: Activate Tap to Click:
    gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true
        
  • Remove the system beep: Sound > Sound Effects, turn off the Alert volume.
  • Keyboard shortcuts:
    • Disable Hide window and Switch video display (not necessarily available):
    gsettings set org.gnome.desktop.wm.keybindings minimize ['']
    gsettings set org.gnome.settings-daemon.plugins.media-keys video-out ''
        
    • Home folder: Super+H
    • Hide all normal windows: Super+D
    • Record a short screencast: Super+R
    • Save a screenshot of a window to Pictures: Ctrl+Super+P
    • Save a screenshot of an area to Pictures: Shift+Ctrl+Super+P
    • Save a screenshot to Pictures: Super+P
    • Lock screen: Ctrl+Echap
    • Toggle maximization state: Super+Return
    gsettings set org.gnome.settings-daemon.plugins.media-keys home '<Super>h'
    gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d']"
    gsettings set org.gnome.settings-daemon.plugins.media-keys screencast '<Super>r'
    gsettings set org.gnome.settings-daemon.plugins.media-keys screenshot '<Super>p'
    gsettings set org.gnome.settings-daemon.plugins.media-keys window-screenshot '<Primary><Super>p'
    gsettings set org.gnome.settings-daemon.plugins.media-keys area-screenshot '<Primary><Shift><Super>p'
    gsettings set org.gnome.settings-daemon.plugins.media-keys screensaver '<Primary>Escape'
    gsettings set org.gnome.desktop.wm.keybindings toggle-maximized "['<Super>Return']"
        

Others

  • Nautilus: Preferences > Views: Sort folders before files
  • Right-Alt used to access key 3rd level:
    gsettings set org.gnome.desktop.input-sources xkb-options "['lv3:ralt_switch']"
        
  • Date in the top bar with time, and calendar displaying the week number:
    gsettings set org.gnome.desktop.interface clock-show-date true
    gsettings set org.gnome.desktop.calendar show-weekdate true
        

APT and upgrade

  • Copy sources.list and preferences in /etc/apt/:
    sudo rsync -rt sources.list_Buster-testing/ /etc/apt/
    sudo cp preferences_Buster-testing/preferences /etc/apt/
        
  • Avoid downloading translation indexes:
    sudo nano /etc/apt/apt.conf.d/apt.conf
        

    And add:

    Acquire::Languages "none";
          
  • Enable the installation of i386 packages:
    sudo dpkg --add-architecture i386
        
  • Update the indexes and keys:
    sudo apt update
    wget http://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb
    sudo dpkg -i deb-multimedia-keyring_2016.8.1_all.deb
    rm deb-multimedia-keyring_2016.8.1_all.deb
    sudo apt install pkg-mozilla-archive-keyring
    wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key CAEB3DC3BDF7FB45
    sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 379CE192D401AB61
    wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
    curl -L https://repo.skype.com/data/SKYPE-GPG-KEY | sudo apt-key add -
    curl -L https://packagecloud.io/slacktechnologies/slack/gpgkey | sudo apt-key add - 
    sudo apt install apt-listbugs
    sudo apt update
        
  • Check the preferences (no repository should be left at 500):
    apt policy
        
  • First upgrade
    sudo apt upgrade
    sudo apt full-upgrade
    upgrade-full
        

Hardware

  • Laptop stuff (battery, wifi, non-free firmware):
    sudo apt install firmware-linux-free firmware-linux-nonfree firmware-iwlwifi tlp tlp-rdw 
        

    Note: TLP seems like a better alternative to laptop-mode-tools.

  • Information on CPU frequency:
    sudo apt install linux-cpupower
    cpupower frequency-info
        
  • Graphical boot: use Plymouth.
    sudo apt install plymouth plymouth-themes
        
    • Specific Dell XPS 13: Edit /etc/initramfs-tools/modules:
      sudo nano /etc/initramfs-tools/modules
              

      and add the following lines:

      # KMS
      intel_agp
      drm
      i915 modeset=1
                

    Then edit /etc/default/grub:

    sudo nano /etc/default/grub
        

    and add this line (note that preferred resolution is 3200x1800 by default, which is painfully slow; reducing even further to 800x600 or 640x480 can make it slighlty more responsive):

    GRUB_GFXMODE=1024x768
          

    And edit the GRUB_CMDLINE_LINUX_DEFAULT line to read:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
          

    Update Grub to pick up the changes:

    sudo update-grub2
        

    Set the default theme to lines:

    sudo /usr/sbin/plymouth-set-default-theme lines
        

    And finally apply the changes:

    sudo update-initramfs -u
        

Specific Dell Latitude E5430

  • To flash the BIOS, download FreeDos USB Lite, extract it on a USB flash drive (e.g. using Etcher). Download the latest BIOS (latest being A18 non-vPro at the time of writing), and copy it on another USB flash drive. Boot the laptop with both flash drives plugged, type F12 and boot on USB. Then select English, and No, return to DOS. Type D: then the name of the BIOS executable (e.g. 5430A18.exe). The laptop will reboot and install the BIOS — leave both USB flash drives plugged, and keep the laptop on power. After a few minutes, it will reboot again.

Specific Dell XPS 13

  • Optimize SSD:
    • /tmp in RAM:
    sudo cp /usr/share/systemd/tmp.mount /etc/systemd/system/
    sudo systemctl enable tmp.mount
        
  • Use only SWAP when 99% of RAM is used:
    sudo nano /etc/sysctl.conf
        

    Add at the end of the file:

    # SWAP after 99% RAM used 
    vm.swappiness = 1
          
  • WIFI
    sudo apt install firmware-brcm80211 
    sudo modprobe -r brcmsmac ; sudo modprobe brcmsmac
        
  • Missing firmware for module i915 (necessary?):
    wget https://01.org/sites/default/files/downloads/intelr-graphics-linux/sklgucver61.tar.bz2 && \
    tar xvjf sklgucver61.tar.bz2 && cd skl_guc_ver6_1/ && sudo ./install.sh
    cd
    wget https://01.org/sites/default/files/downloads/intelr-graphics-linux/kbldmcver101.tar.bz2 && \
    tar xjvf kbldmcver101.tar.bz2 && cd kbl_dmc_ver1_01/ && sudo ./install.sh 
    cd
    rm -r skl_guc_ver6_1 && rm sklgucver61.tar.bz2 && rm -r kbl_dmc_ver1_01 && rm kbldmcver101.tar.bz2
    sudo update-initramfs -u -k all
        
  • Bios update: As of 2017-11-24, the latest BIOS available is 1.5.1 (updated from 2017-09-28, available here; check new versions here), with signatures:
    md5sum XPS_9350_1.5.1.exe 
    6440b141ad85509b71abf844c07728b7  XPS_9350_1.5.1.exe
    sha1sum XPS_9350_1.5.1.exe 
    03c2a6ecd20d7f76aa624320e4c524f12be04d1b  XPS_9350_1.5.1.exe
    sha256sum XPS_9350_1.5.1.exe 
    9b00614be18245bce72c9df8879cd3519f15a10f5d4c748b697e0cb35a0f03cb  XPS_9350_1.5.1.exe
        

    Download and store on a USB flash drive, reboot, hit F12, check “BIOS Flash update”, and follow instructions. To check current version of BIOS:

    sudo dmidecode | less
        
  • Firmware updates with fwupd (Dell provides firmware updates via Linux Vendor Firmware Service (LVFS)):
    sudo apt install fwupd
    sudo fwupdmgr get-devices
    sudo fwupdmgr refresh
    sudo fwupdmgr get-updates
    sudo fwupdmgr update
        

Internationalization

  • Add French in the list of languages:
    sudo dpkg-reconfigure locales
        

    Select en-CA.UTF-8, en-GB.UTF-8, en-US.UTF-8 (default), fr-CA.UTF-8, fr-FR.UTF-8.

  • Remove unnecessary locales:
    sudo apt install localepurge
    sudo localepurge
        
  • Keyboard layout:
    • The list of characters and functions can be found here: /usr/include/X11/keysymdef.h.
    • Custom keyboard adjusted to Dell XPS 13, including Home/End on PrtScr/Insert, special characters (←→²³€°–©☆§, etc.), math operators (±×÷≠≤≥), French and Spanish letters, accents and quotes (ÆæÀàÉéÈèÑñŒœÙù «» “” ¡¿, etc.), and most Greek letters (αβγδσΔΦΨΣ, etc.):
    sudo mv /usr/share/X11/xkb/symbols/us /usr/share/X11/xkb/symbols/us.bkp
    sudo cp Keyboard/keyboard-DELL-XPS-13-9350_us /usr/share/X11/xkb/symbols/us
        

    Then in Gnome Settings > Region & Language, choose “English (US, international with dead keys)” as Input Source; remove English (US); add “French (alternative, Latin-9 only)” for French; add “Greek (extended)” for Greek alphabet. Note that the Menu button doesn’t seem to work in Nautilus.

Installing a full system

Miscellaneous

sudo apt install autoconf build-essential cmake cmake-curses-gui cowsay debian-goodies detox disper dos2unix elinks espeak etcher-electron flatpak fortune-mod git git-flow gnome-common gparted gtick hibernate libcanberra-gtk3-0:i386 mlocate most ntp privoxy subversion transmission tree units unrar virtualbox wakeonlan

Git to list files in subfolders:

git config --global status.showUntrackedFiles all

Gnome extensions

To be able to install Gnome extensions from Firefox ≥v.52, a Debian package and a Firefox extension are required:

sudo apt install chrome-gnome-shell

List of extensions (✓ Installed; × Installed but not activated):

  • ✓ Alt-Alt+Tab
  • × AlternateTab
  • ✓ Applications Menu
  • ✓ Auto Move Windows
  • ✓ BackSlide
  • ✓ Better Volume Indicator
  • ✓ Disconnect Wifi
  • Focus my window
  • ✓ gTile
  • ✓ Hibernate Status Button
  • × Launch new instance
  • ✓ Media player indicator
  • ✓ Modern Calc
  • × Native Window Placement
  • ✓ Nothing to say Change shortcut to Super+F1:
    dconf write /org/gnome/shell/extensions/nothing-to-say/keybinding-toggle-mute '["<Super>F1"]'
        
  • ✓ OpenWeather
  • × Places Status Indicator
  • ✓ Refresh Wifi Connections
  • × Removable Drive Menu
  • ✓ Remove Dropdown Arrows
  • × Return to Monitor (outdated)
  • × Screenshot Window Sizer
  • ✓ SincroDirs
  • ✓ Sound Input & Output Device Chooser
  • ✓ Super+Tab Launcher
  • ✓ Suspend Button
  • ✓ TopIcons Plus
  • × User Themes
  • × Window List
  • ✓ Window Corner Preview
  • × Workspace Indicator

Web

sudo apt install firefox thunderbird lightning enigmail privoxy torbrowser-launcher chromium iridium-browser mozplugger flashplayer-mozilla flashplayer-chromium

Note 2017-11-10: epiphany-browser is currently not installable due to unmet dependencies to GStreamer.

Firefox

To get a “clean” Firefox profile: Simply connect to Sync with your Firefox account to synchronize Tabs, Bookmarks, Passwords, History, Add-ons and Preferences from old Firefox. Leave Firefox open for some time… After all add-ons are installed, a little bit of tweaking is necessary after:

  • Enable GNOME theme (in Appearance).
  • Add-ons: Some add-ons were not synced and installed: HTTPS Everywhere, Privacy Badger; some options need to be reset (e.g. notifications for Self-Destructing Cookies).
  • Plugins: Need to activate OpenH264 Video Codec provided by Cisco.
  • Open tabs: Open tabs (including permanent tabs) are not synced: Close both old and new Firefox. Check the sessionstore.js file created in old Firefox’s profile when Firefox closes. Copy it in the new profile.
  • Search engines: Copy the search.json.mozlz4 file from old to new profile.
  • Add-on data is not synced: Copy necessary folders in tne new profile (e.g. Scrapbook).
  • Restart new Firefox and customize interface (buttons in the top bar and menu).

Here is the full list of add-ons that I normally install:

And the list of search engines that I keep:

Thunderbird

  • From a previous installation, simply copy the content of the former profile into the default profile folder in ~/.thunderbird.
  • Enigmail (needs version >= 2.07): Then change Gnome settings for the passphrase:
    gsettings list-recursively org.gnome.crypto.cache
        

    Lists relevant settings: the method can be ‘session’ (never expires during the session), ‘idle’ (timer is reset each time there’s activity on the computer) or ‘timeout’ (simple timer since entering the passphrase). We set it to ‘idle’ with 5 minutes of delay:

    gsettings set org.gnome.crypto.cache gpg-cache-method "timeout"
    gsettings set org.gnome.crypto.cache gpg-cache-ttl 300
        

    If it comes from a former installation, copy the .gnupg/ folder in ~/, and ensure permissions are correct:

    chmod -R go-rwx ~/.gnupg
        

    Check that GnuPG is installed with a version >2:

    gpg --version
        

    And finally migrate from old version:

    gpg -K
        

    Note that there is a bug with Enigmail 1.9.6-1 (which doesn’t recognize gpg); fixed in 1.9.6-2:

Here is the full list of add-ons that I normally install:

  • Essential add-ons:
    • CardBook
    • Enigmail
    • HTitle
    • Lightning
    • Show InOut
    • Virtual Identity
  • Appearance:
    • Allow HTML Temp
    • Calendar Tweaks
    • CompactHeader
    • Display Mail User Agent
    • GNOME-Thunderbird (theme Adwaita)
    • GNotifier
    • Manually sort folders
    • QuickFolders
    • Toolbar Buttons
  • Email content and display:
    • LookOut (fix version)
    • Image Zoom
    • Quote Colors
  • Email editing:
    • NestedQuote Remover
    • Send Later
  • Utilies:
    • Copy Folder
    • DKIM Verifier
    • Signature Switch
    • ownCloud for FileLink
    • Provider for Google Calendar
    • Remove Duplicate Messages (Alternate)

Clients for NextCloud and Dropbox

For NextCloud, check the latest version of the client, then install it:

cd Downloads
wget https://download.nextcloud.com/desktop/releases/Linux/Nextcloud-2.3.2-x86_64.AppImage
sudo mkdir /usr/local/lib/nextcloud/
sudo mv Nextcloud-2.3.2-x86_64.AppImage /usr/local/lib/nextcloud/
sudo chmod +x /usr/local/lib/nextcloud/Nextcloud-2.3.2-x86_64.AppImage
sudo ln -s /usr/local/lib/nextcloud/Nextcloud-2.3.2-x86_64.AppImage /usr/local/bin/nextcloud

Then run nextcloud, fill in the proper credentials, choose what to sync and where (in Public seems like a natural choice); in General, “Use Monochrome Icons”. To launch it at startup:

echo -e '[Desktop Entry]\nName=Nextcloud\nGenericName=File Synchronizer\nExec=/usr/local/bin/nextcloud\nTerminal=false\nIcon=nextcloud\nCategories=Network\nType=Application\nStartupNotify=false\nX-GNOME-Autostart-enabled=true\nName[en_US]=nextcloud.desktop' | tee ~/.config/autostart/nextcloud.desktop

For DropBox, install the proprietary daemon:

sudo apt install nautilus-dropbox
dropbox start -i

And follow the instructions (UF has a single sign-in process that works by just adding the UF address without password, with a passcode generated on the web).

Internet admin

sudo apt install cifs-utils dnsutils gftp gvncviewer network-manager-openconnect-gnome network-manager-vpnc-gnome revelation rsync screen unison

Multimedia

  • Pictures
    sudo apt install gimp-gap gimp-gmic gimp-plugin-registry gimp-resynthesizer gthumb hugin imagemagick darktable rawtherapee phatch qtpfsgui 
        
  • Audio/video
    sudo apt install audacity cuetools easytag flac ffmpeg gstreamer1.0-fluendo-mp3 gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly monkeys-audio shntool soundconverter devede gnome-mpv mkvtoolnix pitivi frei0r-plugins gnome-video-effects-frei0r openshot sound-juicer sox subtitleeditor vlc vorbis-tools vorbisgain
        

Install Lollypop from GitHub:

git clone https://github.com/gnumdk/lollypop.git
cd lollypop
sudo apt install meson libglib2.0-dev yelp-tools libgirepository1.0-dev libgtk-3-dev
meson builddir --prefix=/usr
sudo ninja -C builddir install
cd ..
sudo rm -R lollypop
  • Leisure
    sudo apt install chromium-bsu dosbox marble stellarium sweethome3d
        

Office

sudo apt install abiword aspell aspell-fr aspell-en gnote homebank hunspell hunspell-en-ca hunspell-en-us hunspell-fr inkscape jabref libreoffice-gnome libreoffice-gtk3 libreoffice-pdfimport libreoffice-style-breeze libreoffice-style-sifr myspell-en-gb pandoc pandoc-citeproc tesseract-ocr tesseract-ocr-eng tesseract-ocr-fra
  • Need to remove all links to French dictionaries:
    sudo rm /usr/share/hunspell/fr_*
    sudo rm /usr/share/myspell/dicts/fr_*
        

    In case of trouble, just reinstal hunspell-fr.

  • Change Icon style of LibreOffice (Tools > Options > LibreOffice > View) to Breeze, and possibly Show Icons in menus.
  • Preferences for HomeBank are stored in ~/.config/homebank. It’s probably safe to simply copy this folder.

Hugo

Debian does not provide up-to-date Hugo. Check the latest release here, then:

cd Downloads/
wget https://github.com/gohugoio/hugo/releases/download/v0.30.2/hugo_0.30.2_Linux-32bit.deb
sudo dpkg -i hugo_0.30.2_Linux-32bit.deb
hugo version
rm hugo_0.30.2_Linux-32bit.deb

Fonts

sudo apt install fonts-arphic-ukai fonts-arphic-uming fonts-arphic-gkai00mp fonts-arphic-gbsn00lp fonts-arphic-bkai00mp fonts-arphic-bsmi00lp fonts-bebas-neue fonts-crosextra-carlito fonts-crosextra-caladea fonts-firacode fonts-hack-ttf ttf-mscorefonts-installer ttf-baekmuk unifont
  • Use gnome-tweak-tool to change Monospace font to Hack Regular 11.
  • Alternatives for Calibri/Cambria (MS fonts) : Carlito and Caladea. Once installed, in LibreOffice: Options > Fonts, check ‘Apply replacement table’, and add a replacement rule for each (Calibri -> Carlito, Cambria -> Caladea). Leave everything unchecked (Always and screen only).

LaTeX and PDF

sudo apt install gedit-latex-plugin gummi ispell texlive-full bibtex2html rubber latex2rtf xpdf pdftk pdfjam poppler-utils libtext-pdf-perl pdf2svg impressive pdfchain pdfshuffler calibre mupdf pdf2djvu scribus xournal ditaa

Note that biblatex lives in texlive-bibtex-extra, which comes with texlive-full; pdfjam comes with texlive-extra-utils, which comes with texlive-full; pdfmanipulate comes with calibre.

  • Link folder of main BibTeX file to the Tex install. First check with:
    kpsewhich -show-path=.bib
        

    It should include /home/<user>/.texlive2016/texmf-var/bibtex/bib//. The trick is then to create this path as a link to the main bibliographic directory. For instance:

    mkdir -p ~/.texlive2016/texmf-var/bibtex/bib
    ln -s ~/Work/Biblio/ ~/.texlive2016/texmf-var/bibtex/bib
        
  • Install a package (e.g. moderncv)
    sudo nano /etc/texmf/texmf.d/03local.cnf
        
    TEXMFHOME = ~/.texlive2016/texmf
          
    sudo update-texmf
        

    Check with:

    kpsewhich --var-value TEXMFHOME
        

    Copy packages in ~/.texlive2016/texmf/tex/latex/ and complete install when necessary, e.g.:

    latex moderntimeline.ins
    latex moderntimeline.dtx
        
  • Install a font: copy the font in ~/.texlive2016.d/texmf/fonts/truetype/, then update the TeX index:
    sudo texhash
        

Emacs

sudo apt install emacs25 libpoppler-glib-dev

Configuration via Git:

git clone [email protected]:basille/.emacs.d ~/.emacs.d/

And load Emacs, potentially several times until all packages are installed.

JabRef configuration

Debian recently integrated the 3.x series in the official repositories, with JabRef 3.8 now available for Buster (November 2017).

In Options > Preferences:

  • Import preferences (jabref-preferences.xml). Should be enough, but just in case, check the following:
  • In General: check owner name and English as language;
  • In File: check the main file directory (currently /home/mathieu/Work/biblio/PDF/);
  • In Appearance: “Use other look and feel”, and set up the Class name to: com.sun.java.swing.plaf.gtk.GTKLookAndFeel for GTK look & feel;
  • In BibTeX key generator: check the different key patterns;
  • In Advanced: activate “Listen for remote operation on port:” 6050 (for use with JabFox).

Finally, install Zotero and JabFox add-ons for Firefox, and then adjust JabFox preferences:

  • Adjust the path to JabRef launcher, usually /usr/bin/jabref (‘[email protected]’ preference of Firefox);
  • Export format to BibTeX.

Gnote configuration

  • Synchronization using WebDav seems really complicated to set up; one solution is to use ownCloud client to sync a =Gnote= folder localy, and then configure it in Gnote Preferences > Synchronization using Local folder as a service (and check the Automatic sync every 10 minutes).
    • Synchronization seems to cause many crashes of Gnote… Hence simply copying the note folder (~/.local/share/gnote) should be enough.
  • Other preferences:
    • General: Always open notes in new window
    • Plugins: Enable ‘Export to HTML’ and ‘Table of contents’.
  • Using gnome-tweak-tool, add Gnote to the list of Startup Applications.

QGIS, GDAL, GEOS and PROJ.4

sudo apt install qgis gdal-bin libgdal-dev libgeos-dev proj-bin libproj-dev

Then, from inside QGIS, install the following plugins:

  • DB Manager
  • GdalTools
  • GPS Tools
  • OpenLayers Plugins
  • QuickMapServices
  • Time manager

R

sudo apt install r-base-core r-base-dev r-recommended r-cran-cairodevice r-cran-rgtk2 r-cran-rjava r-cran-rodbc r-cran-tkrplot littler jags libatk1.0-dev libcairo2-dev libcurl4-openssl-dev libglib2.0-dev libglu1-mesa-dev libgtk2.0-dev libjq-dev libpango1.0-dev libprotobuf-dev protobuf-compiler libssl-dev libudunits2-dev libxt-dev 

Configuration via Git:

git clone https://github.com/basille/R.git ~/.R-site/
mkdir ~/.R-site/site-library
ln -s ~/.R-site/.Renviron ~/.Renviron

Then in R:

gdal <- TRUE; options(repos = c(CRAN = "http://cran.r-project.org/")); source("~/.R-site/install.selected.R")

And finally link to the R profile:

ln -s ~/.R-site/.Rprofile ~/.Rprofile

RStudio is unfortunately not in the Debian repositories (yet). So the recommanded way to install it is to download the latest installer, which is, on Dec 2 2016, for version 1.0.44 (check here first):

wget https://download1.rstudio.org/rstudio-1.0.44-amd64.deb
sudo dpkg -i rstudio-1.0.44-amd64.deb 
rm rstudio-1.0.44-amd64.deb 

(RStudio has a tendancy to mess a bit with file associations, so it might be necessary to clean that after if RStudio is not supposed to be the default R editor; as a matter of fact, if it is the case, it is the easiest way to associate .R or .Rmd files to any editor, while keeping the association to Gedit for plain text documents)

RStudio is provided with its own version of Pandoc, but it seems to come with potential problems. The easiest way to overcome this is simply to rename the Pandoc executable provided by RStudio (requests will then fallback on the system Pandoc):

sudo mv /usr/lib/rstudio/bin/pandoc/pandoc /usr/lib/rstudio/bin/pandoc/pandoc.bkp

Note that RStudio is not adapted to very high resolution (for instance Retina) and may look very tiny in this case.

Other

Google Stuff

Google provides official repositories for Chrome and Earth (notably). Unfortunately, the installation adds their own repository setting, which is annoying:

sudo apt install google-chrome-stable google-earth-pro-stable
sudo rm /etc/apt/sources.list.d/google-chrome.list

Skype, Slack, WhatsApp, etc.

At last, Microsoft now provides a decent version of Skype for Linux (based on their new web version). Same as Google, the installation adds their own repository setting, which is annoying::

sudo apt install skypeforlinux
sudo rm /etc/apt/sources.list.d/skype-unstable.list

Check Franz for Slack, WhatsApp, etc.

https://meetfranz.com/ https://gist.github.com/jamiesoncj/756728b3ba7c07d7a90f843400af37bb

Rockbox utility

  • Download Rockbox utility
  • Unzip file, and copy RockboxUtility in /usr/local/bin/:
    tar xvjf RockboxUtility-v1.4.0-64bit.tar.bz2
    sudo mv RockboxUtility-v1.4.0-64bit/RockboxUtility /usr/local/bin/rockbox
    sudo chmod 755 /usr/local/bin/rockbox 
    rm -R RockboxUtility-v1.4.0-64bit
        
  • Launch rockbox
  • Install Ambiance theme (activate icons).

iPhone

sudo apt install libimobiledevice6 libimobiledevice-utils libusbmuxd4 ifuse gvfs-fuse 
sudo mkdir /media/iPhone/
sudo chown $USER:$USER /media/iPhone/

Then, connect the phone with an USB cable and pair it:

idevicepair pair

Confirm the pairing by clicking on the dialog box on the phone screen. To mount the iPhone, run:

ifuse /media/iPhone

To unmount, run:

fusermount -u /your/preferred/mountpoint 

or:

fusermount -u /your/preferred/mountpoint 

for lazy unmount.

Final stage

  • Check default applications (Settings > Details > Default Applications).
  • Check applications on startup with gnome-tweak-tool (Startup Applications: icedove, firefox, nautilus, gnote).
  • Final cleaning:
    upgrade-full
        

Admin operations

Backup

The easiest way is to use CRON on a daily basis to backup the entire /home, as well as the databases. To do this, prepare a file home-backup (or any other name), with something like the following:

#!/bin/sh

### Mount operations (needs credentials in ~/.smb)
mount.cifs //XX.YYY.ZZZ/<USER> /mnt/<USER>/ -o credentials=/home/<USER>/.smb,uid=<USER>,gid=<USER>

### Save PostgreSQL databases (full dump):
pg_dumpall | gzip > /mnt/<USER>/home/postgresql/full_`date -I`.sql.gz

### Save file ACLs (permission, ownership)
cd ~
getfacl -R . > /mnt/<USER>/home/<USER>.file-acl
### Restore file ACLs (in the file-acl directory)
# setfacl --restore=<USER>.file-acl

### Entire /home except: 
### Downloads, caches/thumbnails, .extraswap, emacs.d/elpa/,
### .R-site/site-library/, Torbrowser, Trash
###  --modify-window=1 to consider rounded timestamp 
rsync -avz --progress --delete-during --modify-window=1 --exclude=Downloads --exclude=.local/share/torbrowser --exclude=.cache --exclude=.gftp/cache --exclude=.googleearth/Cache/ --exclude=.thumbnails --exclude=.emacs.d/elpa --exclude=.R-site/site-library/ --exclude=.local/share/Trash /home/<USER>/ /mnt/<USER>/home/<USER>/

### Unmount operations
umount /mnt/<USER>/    

Then make the file executable and copy it to /etc/cron.daily:

chmod +x home-backup
sudo cp home-backup /etc/cron.daily/

CRON will run daily at the time setup in /etc/crontab:

grep run-parts /etc/crontab

In this case, every day at 6:25AM. If the computer is not turned on at this time, CRON looks for /etc/anacrontab

less /etc/anacrontab

In this case, every day after a period of 5 minutes since wake-up.

This results in a directory home with

  • The home backup in home/<USER>/
  • The databases backup as a full compressed dump in home/postgresql
  • The file permissions in home/<USER>.file-acl

Recovery

There is currently an important bug with the absence of a root user (due to the use of sudo): recovery mode (from GRUBS) fails to load, arguing that root is locked (it is actually absent). So there is currently no way to load recovery mode directly from the system.

One alternative is to use a Live USB to load a working system, mount the computer file system, and do the necessary modifications from there. A very good candidate is the Tails live OS, which is security and privacy oriented (a good distribution to always have on a flash drive).

To install Tails on a flash drive, follow the Debian way:

sudo apt install tails-installer

Download the Tails ISO image, start the Tails Installer Launcher, and follow the instructions. When the flash drive is ready to use, plug it into the laptop and boot on it. Don’t forget to give a root password on login (check the options).

The key here is to be able to mount an encrypted partition in Tails. It can be all achieved in command line, so first open a terminal. The first step is to identify existing partitions:

sudo lsblk

The interesting part looks like the following:

nvme0n1     … 238.5G … disk
├─nvme0n1p1 …   243M … part	
├─nvme0n1p2 …     1K … part
└─nvme0n1p5 … 238.2G … part
  

Let’s now access the encrypted volume, that we will call crypt from now on:

sudo modprobe dm-crypt
sudo cryptsetup luksOpen /dev/nvme0n1p5 crypt
  

This requires to enter the passphrase AND the root password from Tails.

sudo lsblk
  
nvme0n1     … 238.5G … disk
├─nvme0n1p1 …   243M … part	
├─nvme0n1p2 …     1K … part
└─nvme0n1p5 … 238.2G … part
  └─crypt   … 238.2G … crypt
    

The encrypted volume is now visible. Let’s see what’s inside, and activate the proper volume:

sudo modprobe dm-mod
sudo vgscan
  
Found volume group "mablap2-vg" using metadata type lvm2
    
sudo vgchange -a y mablap2-vg
  
3 logical volume(s) in volume group "mablap2-vg" now active
    

The last step is to look at the partitions inside, and mount what is necessary (here the /root partition):

sudo lvscan
  
ACTIVE  '/dev/mablap2-vg/root' [27.94 GiB] inherit
ACTIVE  '/dev/mablap2-vg/swap' [7.61 GiB] inherit
ACTIVE  '/dev/mablap2-vg/home' [202.68 GiB] inherit
    
sudo mkdir /media/root
sudo mount /dev/mablap-vg/root /media/root
cd /media/root
ls
  
bin boot etc …
    

The system is now ready for any modifications. When it’s done, it’s time to close everything:

sudo umount /media/root
sudo vgchange -a n mablap2-vg 
sudo cryptsetup luksClose crypt
  

Removing old kernels

Kernels tend to accumulate, and eat space in the /boot partition. If /boot is full, it becomes necessary to remove old kernels. First check the current kernel:

uname -r 

and the list of installed kernels:

dpkg --list | egrep -i --color 'linux-image|linux-headers'

then remove unnecessary kernels (it is a good idea to keep current kernel and one older):

sudo apt purge linux-image-XXX-amd64

where XXX stands for the actual version number, and update GRUB:

sudo update-grub2

Useful resources