Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save preetampvp/891c28b9100f3c70160308aafa24c912 to your computer and use it in GitHub Desktop.
Save preetampvp/891c28b9100f3c70160308aafa24c912 to your computer and use it in GitHub Desktop.
Installing Ubuntu 16.04 on Dell XPS 15 (9560)

Installing Ubuntu 18.04 on Dell XPS 15 (9560)

Booting and Installing

Find a reference for creating a bootable Ubuntu 18.04 USB. You’ll need to follow one of the references below to make BIOS changes for the disk, secure boot, and legacy boot options.

Grub command line

Hit F12 while booting, and select the USB UEFI device corresponding to your USB key. Unless you alter the Grub command line, Ubuntu Live will hang initializing the NVIDIA card. When the Grub screen comes up, hit ‘e’ to edit, and add at least the ‘nomodeset acpi_rev_override=1’.

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=none acpi_osi=! acpi_osi=\"Windows 2009\" nvidia-drm.modeset=1 acpi_rev_override=1"

At this point, you should be able to partition as you wish, or just follow the simple path through the installer GUI. After booting for the first time, you’ll need to make this GRUB line permanent.

sudo update-grub

References

https://askubuntu.com/questions/716957/what-do-the-nomodeset-quiet-and-splash-kernel-parameters-mean

References

Installing

https://github.com/rcasero/doc/wiki/Ubuntu-linux-on-Dell-XPS-15-(9560)

https://bbs.archlinux.org/viewtopic.php?id=223056

Dual Booting

https://www.nicchan.me/blog/dual-booting-ubuntu-with-windows-10-on-a-dell-xps-15/

In case you need to resize a Linux encrypted partition

https://wiki.archlinux.org/index.php/Resizing_LVM-on-LUKS

https://help.ubuntu.com/community/ResizeEncryptedPartitions

Remove white dots from login screen (if using lightdm instead of gdm3)

https://ubuntuforums.org/showthread.php?t=2368752

gksudo gedit /usr/share/glib-2.0/schemas/10_unity_greeter_background.gschema.override

Insert text

[com.canonical.unity-greeter]
draw-grid=false

Then

sudo glib-compile-schemas /usr/share/glib-2.0/schemas

NVIDIA driver

After install, open software settings, go to drivers and install NVDIA proprietary driver The version number of the driver may vary. The first time I installed, it was 384. It’s in the 440’s now.

In /etc/modprobe.d/nvidia-graphics-drivers.conf, add

options nvidia_440_drm modeset=1

Then exit to terminal and do

sudo update-initramfs -u

https://linuxconfig.org/how-to-disable-nouveau-nvidia-driver-on-ubuntu-18-04-bionic-beaver-linux

$ sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
$ sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"

$ cat /etc/modprobe.d/blacklist-nvidia-nouveau.conf
blacklist nouveau
options nouveau modeset=0

$ sudo update-initramfs -u

Also

https://devtalk.nvidia.com/default/topic/1029916/linux/video-tearing-with-geforce-gtx-1050/

https://askubuntu.com/questions/1046263/dell-xps-15-9570-2018-disable-nvidia-gpu

https://pandasauce.org/post/ubuntu-on-xps-15-9560/

https://www.phoronix.com/scan.php?page=article&item=nouveau-summer-2018&num=1

https://medium.com/@agathver/nvidia-gpu-optimus-prime-and-ubuntu-18-04-woes-f52e7f850f3d

Monitors and Modelines

https://askubuntu.com/questions/1007960/display-resolution-not-being-recognized

https://bbs.archlinux.org/viewtopic.php?id=181248

http://www.planar.com/products/desktop-touch-screen-monitors/24-inch/pxl2780mw/

https://wiki.ubuntu.com/X/Config/Resolution

https://askubuntu.com/questions/611784/how-to-debug-xrandr-not-setting-up-the-desired-resolution

https://superuser.com/questions/679923/ubuntus-max-resolution-is-1024x768-unknown-monitor

Touchpad

The touchpad uses the synaptics driver by default. libinput is better at this point, and much less sensitive and finicky. Install one, and uninstall the other.

sudo apt-get install xserver-xorg-input-libinput xorg-input-abi-22 xserver-xorg-core
sudo apt-get remove --purge xserver-xorg-input-synaptics

Then edit your libinput conf to speed up pointer tracking a bit.

gksudo gedit /usr/share/X11/xorg.conf.d/90-libinput.conf

Edit, but be super careful. This can result in X not starting and you are left with a blank screen. If that happens, hit Ctrl-Alt-F<something else>, open another text-based vty and remove the offending line.

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Option "AccelSpeed" "1.0"
        Option "Natural Scrolling Enabled" "1"
        MatchDriver "libinput"
EndSection

Can also put these in .bashrc. You need to check your libinput device number though. Mine was 16. If you get this wrong, it won’t break anything; it just won’t work. It looks like you can also use the full name of the device in quotes, instead of the number.

xinput set-prop 16 "libinput Accel Speed" +1
xinput set-prop 16 "libinput Natural Scrolling Enabled" 1

Backlight

If you end up switching window managers to i3 or something like it, like I did, you’ll need some backlight and sound control config stuff. You won’t need this if you stick to gnome. (Or at least I don’t now with 18.04. I can’t easily go back to check 16.04 at this point). https://gitlab.com/wavexx/acpilight

chrbrn@u1b863e0b90e952:~/Downloads/acpilight-master$ sudo make
install -vCDt /usr/bin xbacklight
removed '/usr/bin/xbacklight'
'xbacklight' -> '/usr/bin/xbacklight'
install -vCDt /usr/share/man/man1 xbacklight.1
'xbacklight.1' -> '/usr/share/man/man1/xbacklight.1'
install -vCDt /etc/udev/rules.d 90-backlight.rules
'90-backlight.rules' -> '/etc/udev/rules.d/90-backlight.rules'
udevadm trigger -s backlight -c add

sudo chmod aog+rw /sys/class/backlight/intel_backlight/brightness
chrbrn@u1b863e0b90e952:~/Downloads/acpilight-master$ xbacklight -inc 20
chrbrn@u1b863e0b90e952:~/Downloads/acpilight-master$ xbacklight -dec 20

Without changing perms on that file, you’ll get access denied and scripts calling xbacklight will silently fail. That pseudo-file is regenerated at each boot and thus you’ll have to redo that workaround every time.

Or better yet, create udev rules.d for backlight permissions From https://unix.stackexchange.com/questions/481490/no-outputs-have-backlight-property-but-xorg-conf-is-configured-and-xbacklight

cat /etc/udev/rules.d/80-backlight.rules

ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
cat /usr/share/X11/xorg.conf.d/20-intel.conf
Section "Device"
    Identifier  "Intel Graphics"
    Driver      "intel"
    Option      "Backlight"  "intel_backlight"
EndSection

Bluetooth (especially for recent headphones / Apple airpods)

  1. Install ‘blueman’
  2. Run ‘blueman-manager’
  3. Then proceed with discovery & pairing

Bose QC2 35

https://askubuntu.com/questions/833322/pair-bose-quietcomfort-35-with-ubuntu-over-bluetooth

gksudo gedit /etc/bluetooth/main.conf
ControllerMode bredr

Keyboard mods

Swap caps & ctrl

This is mostly for Emacs users..

Edit /etc/default/keyboard

XKBOPTIONS="ctrl:swapcaps"

or

cat /etc/profile.d/keyboard.sh

# shellcheck shell=sh
setxkbmap -option ctrl:swapcaps
setxkbmap -layout dvorak

Dvorak keyboard in boot sequence

https://wiki.debian.org/Keyboard#Set_Keyboard_Layout_in_initramfs

Modify ‘alt’ key in the HUD

This keeps the ‘alt’ key from interfering with Emacs https://askubuntu.com/questions/122209/how-do-i-modify-or-disable-the-huds-use-of-the-alt-key I set it to ‘Alt R’ instead

Window manager (tiling)

i3 or leftWM https://github.com/leftwm/leftwm.git

Lock and Suspend

Install slock from source https://tools.suckless.org/slock/

slock git:(master) ✗ git remote -v
origin	https://git.suckless.org/slock (fetch)
origin	https://git.suckless.org/slock (push)

Create a user /etc/systemd/system/[email protected] unit to automatically lock on suspend https://wiki.archlinux.org/index.php/Slock#Lock_on_suspend

[Unit]
Description=Lock X session using slock for user %i
Before=sleep.target

[Service]
User=%i
Environment=DISPLAY=:0
ExecStartPre=/usr/bin/xset dpms force suspend
ExecStart=/usr/bin/slock

[Install]
WantedBy=sleep.target

Or install i3lock from source for a bit more functionality

git clone https://github.com/i3/i3lock
sudo apt install -y libev-dev libxcb-xinerama0-dev libxcb-xinerama0-dev libxkbcommon-x11-dev \
 libpam0g-dev libxcb-image0-dev libxcb-util-dev libxcb-xrm-dev

Apps

Other stuff I install…

Emacs 25 (or 26 now.. same method, same ppa)

http://ubuntuhandbook.org/index.php/2017/04/install-emacs-25-ppa-ubuntu-16-04-14-04/

VSCode (install Insiders build)

Installing Emacs keybindings on Linux doesn’t work until you change keyboard dispatch from code to keycode

use "keyboard.dispatch": "keyCode" in your settings and restart VS Code.

https://github.com/microsoft/vscode/wiki/Keybinding-Issues

Spacemacs

http://spacemacs.org/

ycmd

chrbrn@u1b863e0b90e952:~/Projects/ycmd$ git clone https://github.com/Valloric/ycmd.git
cd ycmd
git submodule update --init --recursize
python3 build.py

Zeal

clang

https://blog.kowalczyk.info/article/k/how-to-install-latest-clang-6.0-on-ubuntu-16.04-xenial-wsl.html

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main"
sudo apt-get update
sudo apt-get install -y clang-6.0
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.8 100
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 1000
update-alternatives --install /usr/bin/clang++ clang /usr/bin/clang-3.8 100
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.8 100
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 1000
update-alternatives --config clang
update-alternatives --config clang++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment