Ubuntu 22.04 installation - jacobmoroni/ubuntu_hacks GitHub Wiki

Ubuntu 22.04 Install Notes (Specifically on my XPS 9520)


This is the way I set up my ubuntu 22.04 Install last time I did it. In this order for a dell, push F12 during boot to allow booting to bootable drive


BIOS Setup

Do this before installing ubuntu. Or at least before anything else

  • I needed to turn off hard drive encryption in windows in order to enable secure boot
  • disable secure boot in BIOS
  • also in bios it may be necessary to disable hybrid graphics. I currently have hybrid graphics disabled too, but I think with nvidia-prime you can leave this on and actually switch between the nvidia gpu and the integrated intel gpu(much better battery life)

Update and Upgrade everything

Do this before you start trying to figure anything else out because a lot of things wont be set up right yet

sudo apt update
sudo apt upgrade
sudo reboot now

Set up NVIDIA Drivers

On this computer, for some reason, the nvidia drivers were actually installed during the ubuntu install. That was pretty nice

  • you can do this from command line by adding a repo and then apt installing the drivers from there.

  • But it is a little more fool-proof to just go to Software & Updates then click additional-drivers and select the newest nvidia one then wait for it to finish then reboot again.

  • you can verify it is working by going to settings->details and the nvidia GPU should be listed instead of the integrated one. also running nvidia-smi will show gpu usage (this will only work after it is set up)

  • nvidia-settings opens a display menu to customize settings

Optionally, install cuda now

using NVIDIA's installation guide walks you through this pretty well. But I will include some helpful tips that I used

  • this was helpful when trying to install cuda stuff (it broke apt and this recovered it)
sudo apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken
  • also if you get to making the sample cuda stuff and you get an error that says something about "missing nvscibuf.h" there is actually a missing file or something in cuda 10.2 so on the nvidia forum they said they are researching, but for now to just use make -k (to keep going after the error and build the other stuff)

Install Brave (trying it out. We'll see if it sticks)

sudo apt install curl

sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list

# this line is not from their official instructions. But this fixes the broken install
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list

sudo apt update

sudo apt install brave-browser

This is also a good time to install the bitwarden extension and setup the brave sync to get that up and running


Install Some Helpful Packages

sudo apt install htop vim vim-gtk3 curl git ssh git-gui usb-creator-gtk baobab avahi-daemon avahi-utils ipython3 python3-pip
  • the usb-creator-gtk (called startup disk creator) is good for making bootable drives
  • baobab (called disk usage analyzer)
  • the avahi stuff is nice to find hosntames and stuff on a network
  • freeglut3-dev is what enables the visuals in the anansi_ros tests with GLUT

Set up git

git config --global user.email "[email protected]"
git config --global user.name "Jacob Olson"

Set up SSH stuff

  • this will create a public ssh key at ~/.ssh/id_rsa.pub
ssh-keygen -t rsa -b 4096 -C "[email protected]"
  • add the ssh keys at gitlab/github click on profile then settings then ssh-keys then add ssh key and copy it into there

Install ROS2

I just followed the directions from the ROS2 website Install ROS2 Humble


Gnome Extensions

I like to use a few gnome extensions.

NOTE: These will only work on gnome

sudo apt install gnome-tweaks chrome-gnome-shell gnome-shell-extensions
  • then add the gnome extension to chrome here

  • if you want to use GnomeStatsPro or system-monitor extensions you need to run this too

sudo apt install gir1.2-gtop-2.0 gir1.2-nm-1.0 gir1.2-clutter-1.0 gnome-system-monitor
  • I Installed Desktop Icons NG, Frippery move clock, openweather, TopHat, system-monitor-next, gTile, ubuntu dock, ubuntu appindicators, sound input & output device chooser

Addidtional Programs

I use some programs that use config files that I have set up in my ubuntu_hacks repo

sudo apt install zsh terminator guake tmux -y

other programs that I tend to use pretty often

sudo apt install vlc kdenlive inkscape gimp ffmpeg git-lfs gnome-screenshot shotwell

VIM

  • install and setup vim with ./setupvim.sh in repo

ohmyzsh & zshell

  • run the following line to install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  • copy the .zshrc file into the home directory

  • then run to change shells to z shell

chsh -s /bin/zsh $USER
  • you will need to log out for this to take effect

  • also don't forget to change the ros sourced stuff from devel/setup.bash to devel/setup.zsh

terminator

  • follow README instructions to set up terminator

guake

to get guake to work this time, I needed to add it into the "startup applications list" (press windows key and start searching for "startup applications") `` Select startup applications then add one named "guake" and command is guake

NOTE: There is another place to do startup applications in gnome-tweaks. So dont do both

setup guake preferences with (guake.dconf stored in ubuntu hacks)

guake --restore-preferences guake_prefs

to create a new guake.dconf: guake --save-preferences ~/Downloads/guake_prefs



Installing Jetbrains Programs

This guy set up a ppa to get the latest so they just install and update with apt

To use, call this to add the repos

curl -s https://s3.eu-central-1.amazonaws.com/jetbrains-ppa/0xA6E8698A.pub.asc | gpg --dearmor | sudo tee /usr/share/keyrings/jetbrains-ppa-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/jetbrains-ppa-archive-keyring.gpg] http://jetbrains-ppa.s3-website.eu-central-1.amazonaws.com any main" | sudo tee /etc/apt/sources.list.d/jetbrains-ppa.list > /dev/null
sudo apt update
  • then install them
sudo apt install clion intellij-idea-ultimate pycharm-community

then for intellij and pycharm when you set them up add the link to run from command line.

To get the clion.desktop to build with ROS enabled. add this to the ~/.profile

NOTE: This isnt working all the way for me, maybe a zshell thing?
source /opt/ros/noetic/setup.bash
source ~/workspaces/anansi_ros/devel/setup.bash --extend

I think I have settled on these settings to get it to play nice with ros (This still requires opening from command line): settings -> Build, Execution, Depolyment -> CMAKE Generator: Unix Makefiles CMake options: -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DWITH_VISUAL=All -DCATKIN_DEVEL_PREFIX:PATH=/home/jacobolson/workspaces/dronehunter-dev/anansi_ros/devel Build directory: ../build

To get clion to use same clang tidy that we do: go to settings->Languages & Frameworks->Clang-Tidy and check box for Use external Clang-Tidy instead of the built in one then select the .clang-tidy file in anansi-ros

To make the desktop icon source ROS correctly edit the EXEC line of the correct clion.desktop file (mine is in /usr/share/applications/clion.desktop) to say Exec=bash(or zsh) -i -c "/path/to/clion/bin/clion.sh" %f


Install VSCODE

This adds the stable release to apt so it will install and update with apt

sudo apt-get install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg

sudo apt install apt-transport-https
sudo apt update
sudo apt install code

Then I set up VSCODE to work pretty well last time and I used settings sync with the github login


PIP and iPython setup

pip install ipython pyqtgraph

for some reason ipython didnt create an endpoint so i created an alias for python -m IPython
then copy ipython_config.py into ~/.ipython/profile_default to automatically import numpy and matplotlib into ipython


Sophos and VPN

Sohpos (AntiVirus): follow instructions in Employee Technical Guide (search sophos)

VPN (NetExtender): search netextender in Employee Technical Guide and follow instructions

ROS Stuff

needed to downgrade setuptools for ros2. it was causing colcon build errors that were preventing the executables from working pip install setuptools==58.2.0
sudo apt install ros-humble-image-view
sudo apt install python3-colcon-common-extensions

AppImage Stuff

This seems to do what I want with appimages

sudo add-apt-repository ppa:appimagelauncher-team/stable
sudo apt-get update
sudo apt-get install appimagelauncher

This will default to move all appimages to ~/Applications it will automatically set up desktop stuff for it so the applications menu can find it. It has a wiki that is sort of confusing but probably good to know about. By default, this will prompt and set it up the first time it is run

Disable caps lock

follow instructions for this in Helpful-ubuntu-tips

⚠️ **GitHub.com Fallback** ⚠️