LM18

Linux Mint 18.3 Installation Instructions (2/8/2019)

(0-X) Preamble:  

This guide will give you access to the latest drivers available for LM 18.

Commands are valid for all Ubuntu 16.04 derivatives.

If you wish to only use official Linux Mint drivers, do not follow this guide.

Tools to use: 

 

Windows = Rufus or Etcher

https://rufus.akeo.ie/

https://etcher.io/

Linux = Gnome Disks/USB Image Writer/Etcher/GParted

https://etcher.io/

http://gparted.org/download.php

(1-X) Before you install Linux Mint 18:

1.  Update your Motherboard BIOS & Firmware.  This isn’t a nice to have.  You are building a house.  You need a stable foundation, and Linux sees all.  Read your manual & do it.  Get this done in Windows, before migrating to Linux.  OS agnostic BIOS tools are shit for most vendors.  Do not tempt fate.

2.  Set the BIOS to defaults(factory reset) or rip out the motherboard battery for 10 minutes and reinsert it.  Unplug your computer while you are doing the latter.  This removes stale conflicting BIOS entries.  

3.  Use your USB 2.0 compatible port to install the OS.  If you are riddled with 3.0 ports, look through your BIOS and manual and make/find the down-throttled USB 2.0 port.  There is always one there.

4.  Disable Secure Boot & Fast Boot & Thunderbolt Security & TPM in the BIOS.  Secure Boot is Microsoft’s way of saying FU.  Get rid of it or you’re DOA.  And Fast Boot can blow through GRUB2(Your Bootloader).  Thunderbolt encryption and TPM encryption do not function in Linux at this time.  Some BIOS’s require a Supervisor Password set to change settings.

5.  If you are Dual Booting, leave the BIOS at whatever Mode it’s in(typically UEFI).  You must match modes.  You can not change BIOS modes between multiple resident OS’s.  Your boot loader(GRUB2) won’t function.

6.  If you are Just running Linux, set the BIOS to Legacy(Windows 7)/CSM ON Mode rather than UEFI.  It’s simpler, more direct access, and more stable.

7.  If you are dual booting with Windows on the same drive, create space on your partition within Windows first.  Linux does not have the ability to defragment your drive and move data around a filled up NTFS partition.  It can only move partitions where there is free space available(and NTFS writes crap everywhere).  

Defrag NTFS & use a tool like Minitool Partition Wizard(Free) to do so and leave a partition empty where you want Linux to go.  Make sure the empty partition it is at least 20 GB’s minimum.  40 GB’s or greater is Optimal.

https://www.partitionwizard.com/free-partition-manager.html

(2-X) During your install of Linux Mint 18:

1.  If you have a graphics card and/or motherboard newer than November 2015, you may see artifacting or a black screen.  If that’s the case, hold the Shift key down at boot.  You will see a GRUB menu.

Highlight your kernel under Advanced Options.  Hit E(edit).

You will see this line for your kernel:

"quiet splash"

Change it to:

"nomodeset quiet splash"

The nomodeset entry is a blanket scorched earth entry.  Should you need more options, the additional options are:

nvidia.modeset=0      (Not usually helpful)

nouveau.modeset=0 (For Newer Nvidia cards)

radeon.modeset=0    (For Newer AMD cards)

i915.modeset=0        (For Newer Intel GPU’s aka Skylake)

r128.modeset=0        (For old ass Radeons)

https://www.linuxmint.com/rel_sonya_cinnamon.php

2. Hit F10 to boot.  Do not save the config.

3.  Install the OS with the icon on the Desktop.  Choose the safe/secure package manager option(middle) later on if you value your life.  Installing everything no matter how beta is a bad idea no matter what OS you use.

4.  Reboot.

5.  You will likely need to repeat the procedure(2-1) above again for your first boot after installation.  Repeat the process.  Don’t save here either.  We are replacing your kernel & proprietary drivers.  You won’t need it again, if it’s done right.

(3-X) Post-Install of Linux Mint 18:

1.  Summary of optimal drivers:

Nvidia – Proprietary Drivers(dkms) + Linux Kernel

AMD  –  Mesa 18.x + LLVM + Firmware + Linux Kernel

Intel   –  Mesa 18.x + Firmware + Linux Kernel

2.  Open a command prompt. Copy & paste the following into a terminal.

64 bit CPU/Kernel 4.20(stable):

cd Downloads && sudo apt update && sudo apt autoremove -y && sudo apt clean && sudo apt dist-upgrade -y && sudo apt install git -y && git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git && cd linux-firmware && sudo tar cvf /root/firmware_backup.tar /lib/firmware && sudo cp -Rf *.* /lib/firmware && sudo apt-add-repository ppa:graphics-drivers/ppa -y && sudo apt-add-repository ppa:teejee2008/ppa -y && sudo apt-add-repository universe -y && sudo apt-add-repository ppa:ondrej/nginx-mainline -y && sudo apt update && sudo apt dist-upgrade -y && sudo apt install build-essential dkms ukuu iucode-tool lm-sensors fancontrol byobu -y && sudo apt autoremove -y && cd .. && mkdir kernel && cd kernel && wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.20.7/linux-headers-4.20.7-042007_4.20.7-042007.201902061234_all.deb https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.20.7/linux-headers-4.20.7-042007-generic_4.20.7-042007.201902061234_amd64.deb https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.20.7/linux-image-unsigned-4.20.7-042007-generic_4.20.7-042007.201902061234_amd64.deb https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.20.7/linux-modules-4.20.7-042007-generic_4.20.7-042007.201902061234_amd64.deb && sudo dpkg -i *.deb && sudo update-initramfs -u && sudo apt clean && sudo update-grub && sudo updatedb && sudo ldconfig

32 bit CPU/Kernel 4.20(stable):

cd Downloads && sudo apt update && sudo apt autoremove -y && sudo apt clean && sudo apt dist-upgrade -y && sudo apt install git -y && git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git && cd linux-firmware && sudo tar cvf /root/firmware_backup.tar /lib/firmware && sudo cp -Rf *.* /lib/firmware && sudo apt-add-repository ppa:teejee2008/ppa -y && sudo apt-add-repository universe -y && sudo apt-add-repository ppa:ondrej/nginx-mainline -y && sudo apt update && sudo apt dist-upgrade -y && sudo apt install build-essential dkms ukuu iucode-tool lm-sensors fancontrol byobu -y && cd .. && mkdir kernel && cd kernel && wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.20.7/linux-headers-4.20.7-042007_4.20.7-042007.201902061234_all.deb https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.20.7/linux-headers-4.20.7-042007-generic_4.20.7-042007.201902061234_i386.deb https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.20.7/linux-image-4.20.7-042007-generic_4.20.7-042007.201902061234_i386.deb https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.20.7/linux-modules-4.20.7-042007-generic_4.20.7-042007.201902061234_i386.deb && sudo dpkg -i *.deb && sudo update-initramfs -u && sudo apt clean && sudo update-grub && sudo updatedb && sudo ldconfig

3.  If you have an Nvidia or Intel/Nvidia GPU

Open Menu/Administration/Driver Manager.  

On Ubuntu 16.04, open Software & Updates/Additional Drivers

Wait for it to load the new repository.  

Choose Nvidia-415 for the latest driver.

If you are doing Intel/Nvidia GPU(Optimus) switching, use PRIME Sync via the driver itself(Bumblebee is deprecated), for example:

sudo apt install nvidia-415 nvidia-prime nvidia-prime-applet -y

If you would like to restore your /lib/firmware back to the original state, copy/paste to terminal:  sudo tar xvf /root/firmware_backup.tar

4.  REBOOT

(4-x) Troubleshooting:

1.  I got a black screen on reboot you rotten Bastard!

  

Repeat 2.1 and save entry for nomodeset in GRUB.  This shouldn’t happen as the repo driver release via Driver Manager(For Nvidia) disables nouveau by default. Conversely, the Nvidia drivers will not load with ‘nomodeset’ saved in grub.

2.  My wifi doesn’t work!

Some wireless chipsets have proprietary only drivers or unreleased drivers, which essentially amounts to the same thing.  Those firmware/driver sets are installed into /lib/firmware.  /lib/firmware uses the latest module in it’s list of modules to load into your OS.  For example /lib/firmware/rtl8105e-1.fw, where -1 is the revision.  The largest number is the number in use.  Broadcom & Realtek are a particular pain in the ass IRT proprietary drivers.

You can find your driver by finding the name of the chipset in your specs, or by typing:

lspci | grep -i wireless OR Inxi -n OR inxi -F OR lspci -vv -s pcie#.in.front.of.wireless.device

Mint will typically have your wifi drivers listed as an install option within:

Menu/Administration/Driver Manager

You can find alternative drivers on https://launchpad.net/(search for your chipset) if need be, for example: 

sudo add-apt-repository ppa:hanipouspilot/rtlwifi -y && sudo apt update && sudo apt install rtlwifi-dkms-new -y

3.  My new keyboard and mouse don’t work right.

Corsair:

http://forum.corsair.com/v3/showthread.php?t=133929

https://github.com/ckb-next/ckb-next

Prep for git – 

sudo apt install build-essential dkms git libudev-dev qt5-default zlib1g-dev libappindicator-dev -y

git clone https://github.com/ckb-next/ckb-next

Steelseries Apex:

https://github.com/tuxmark5/ApexCtl

sudo apt install ghc libusb-1.0-0-dev cabal-install git pkg-config
cabal update
cabal install usb cmdargs

Steelseries Rival:

https://github.com/andrepl/rivalctl

git clone https://github.com/andrepl/rivalctl.git
sudo python setup.py install

Razer:

Razer Stealth(hardware) modify BIOS:

https://youtu.be/P4MkJXd96Y8

Razer Drivers:

https://openrazer.github.io/#ubuntu

sudo add-apt-repository ppa:openrazer/stable -y

sudo apt update
sudo apt install polychromatic openrazer-meta -y

Roccat:

https://launchpad.net/~berfenger/+archive/ubuntu/roccat

http://roccat.sourceforge.net/

https://sourceforge.net/projects/roccat/files/roccat-tools/

sudo add-apt-repository ppa:berfenger/roccat -y
sudo apt update

sudo apt install roccat-tools

After installing the package "roccat-tools", you have to add every user you want to be able to use the roccat tools to the group "roccat".   It can be done in the system settings menu or by typing in a terminal:

$ sudo adduser username roccat

5.  What’s this Ukuu thing?

Ukuu is a program that can upgrade kernel point(4.16.x) and major build releases(4.X).  If you are upgrading a major build release, you must reinstall your proprietary drivers BEFORE you reboot, ex:

$sudo apt install –reinstall nvidia-410 virtualbox-5.2 -y

If Ukuu-gtk starts throwing errors, do a:

$sudo rm -rf /home/user/.cache/ukuu

6.  How do I find my Damned Kernel?

All of the kernels listed above and on your system currently can be installed simultaneously and you can boot to one or the other at will.   

To do so, when booting, hold down the shift key and that will bring up GRUB.  You can then go into Advanced and choose any of the kernels you have installed that you would like to boot to.  

By default, GRUB will boot to the latest revision of whatever kernels you have installed.  You can alter that in /etc/default/grub, with a number representing a kernel in your list.

  

0 is the first, 1 is the second, 2 is the 3rd, and so on.

Upgrading a kernel does not mean deleting a kernel.  It means you are simply adding an entirely new kernel to your system, and GRUB is then defaulted to boot to that kernel.  Your old bug ridden kernel is still living happily dormant on your computer:   

sudo apt install gedit -y && gksudo gedit /etc/default/grub

Type ‘sudo update-grub’ to lock it in.

To remove these kernels, open Update Manager/View/Linux Kernels.  

That will show you all the shit you have installed, and you can then uninstall whatever kernels you don’t need at will.  You can also do this via sudo apt purge-old-kernels, sudo apt autoremove –purge, ukuu, or synaptic.

7.  “Locale/localization” errors in initramfs at boot?

sudo locale-gen –purge –no-archive && sudo update-initramfs -u -t

8.  How can I update Firmware now that Windows is gone?

An application is in development that will allow you to create a bootable Windows 10 ‘live’ image on a usb stick.  I suggest only using a very fast usb 3.X+ stick for this endeavor, and don’t get creative.  Get in, do your business, and get out.  These live Win OS’s tend to be very unstable.

$sudo add-apt-repository ppa:nilarimogard/webupd8 -y && sudo apt update && sudo apt install woeusb winusb -y

Development link: 

https://github.com/slacka/WoeUSB

Repo link: https://launchpad.net/~nilarimogard/+archive/ubuntu/webupd8?field.series_filter=xenial

9. PPA’s/Repositories to keep in mind:

Kernel:

http://kernel.ubuntu.com/~kernel-ppa/mainline

Nvidia:  

https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa

Mesa (18.2) for 16.04:

https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers?field.series_filter=xenial

Mesa AMD Control Panel(user profiling)

https://github.com/GPUOpen-Tools/Radeon-GPUProfiler

LibSSL1.1 for 16.04(how you can install a kernel past 4.17):

https://launchpad.net/~ondrej/+archive/ubuntu/nginx-mainline?field.series_filter=xenial

Linux kernel 0-day firmware(/lib/firmware):

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

Ukuu Kernel Update Utility:

https://github.com/teejee2008/ukuu

IT87(Ryzen) sensors archive:

[sudo make dkms]

/etc/default/grub, GRUB…DEFAULT=”acpi_enforce_resources=lax”

https://yadi.sk/d/h-01t0lG3ZXoYW

10.  Know Thyself.

Before posting your random issue to https://www.reddit.com/r/linuxmint, copy/paste this command to terminal and post the output to the forum via pastebin.com

inxi -F && dmesg | grep -i error 

This will list the current specs of your computer and whatever error affects it.

This document is subject to alteration as future drivers/kernels/IQ become available.

Send corrections and insults to https://www.reddit.com/user/HeidiH0/

This document has been mirrored here:

https://yadi.sk/i/nP9AqsIS3LJL57

https://yadi.sk/i/hXtgxY7d3LJKzq

Changelog:

2/8/2019

Kernel 4.20.7 updated.  Ukuu still functional, albeit frozen.  Will update kernel upgrade script shortly for ukuu replacement.

2/2/2019

Kernel 4.20.6 update.  Ukuu has gone with a proprietary fork.  Will integrate this instead for next update:

https://github.com/pimlie/ubuntu-mainline-kernel.sh

1/17/2018

Kernel 4.20.3 updated.  Mesa repo removed due to deprecation.

12/29/2018

Kernel 4.20 updated.  It works.  Less slowdown for AMD cpu’s, due to a spectre patch dodge.

12/19/2018

Kernel 4.19.11 updated.  LM 19.1 Final released.  Still in testing.

Once the 18.04.1/LM 19.1 regressions have been unfucked, I’ll rework this doc in total for 19.1.  Impetus is not because 19.1 is better.  It’s because Mesa has dropped 16.04/LM 18.3 support across the board.  Gimp mode is better than nothing.  18.04.1 is still a broke dick regression slide.

https://www.linuxmint.com/rel_tessa_cinnamon.php

Miscellaneous:

Security

Disable the Intel/NSA Management Engine:

Pre-Skylake:

https://github.com/corna/me_cleaner/wiki/How-to-apply-me_cleaner

Post-Skylake:

https://github.com/ptresearch/unME11

http://blog.ptsecurity.com/2017/08/disabling-intel-me.html

Check for virii/rootkits:

Install

sudo apt update && sudo apt dist-upgrade -y && sudo apt autoremove -y && sudo apt clean && sudo apt install chkrootkit rkhunter -y && sudo rkhunter –update

Execute

sudo chkrootkit

sudo rkhunter –check

System Tweak Utility Control Panel:

sudo add-apt-repository ppa:adgellida/ubunsys -y && sudo apt update && sudo apt install ubunsys -y

http://imgur.com/a/Fsere

  •  Mr. Robot – 3×02 – eps3.1_undo.gz

  • Mr. Robot – 3×08 – eps3.7_dont-delete-me.ko

PS-  One last troubleshooting tip.  Never underestimate how much your UEFI can screw over your system.  If you are throwing strange errors with ACPI with date/timestamps and missing table errors.  That’s your UEFI sucking.  

There is nothing you can do about it besides update it and hope for the best, or convert to BIOS/legacy mode and hope they didn’t screw that up too.  

MSI gaming laptops and cheap shit touchscreen devices have particularly crap BIOS’s.  Just keep this in mind- It’s not the OS’s fault that your hardware vendor sucks ass.

So do the best you can and have fun doing it.  

Now, get going.

giphy.gif
giphy.gif

Leave a Comment

Your email address will not be published. Required fields are marked *