Meh Belly Lint Collection

That awful moment when you realize,
THIS is YOUR circus and THOSE are YOUR monkeys.

User Tools

Site Tools


ubuntu_steps

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu_steps [2025/05/23 05:56] kensonubuntu_steps [2026/04/23 07:14] (current) kenson
Line 1: Line 1:
 Start with "bare" ubuntu, I'm still on 22.04 LTS Start with "bare" ubuntu, I'm still on 22.04 LTS
  
-Just be root+Notes: 
 <code> <code>
-sudo su -+vi ~/.inputrc 
 +set enable-bracketed-paste off
 </code> </code>
  
Line 52: Line 54:
 If you didn't config the machine as static but you want to If you didn't config the machine as static but you want to
 <code> <code>
-sudo mkdir -p /etc/cloud/cloud.cfg.d && +# detect current interface, IP/CIDR and gateway 
-echo 'network: {config: disabled}' | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg && \+iface=$(ip route show default | awk '/default/ {for(i=1;i<=NF;i++) if($i=="dev"){print $(i+1); exit}}'
 +cidr=$(ip -o -4 addr show dev "$iface" | awk '{print $4}'
 +gw=$(ip route show default | awk '/default/ {print $3}'
 + 
 +# disable cloud-init network config 
 +sudo mkdir -p /etc/cloud/cloud.cfg.d \ 
 +  && echo 'network: {config: disabled}' 
 +      | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg >/dev/null 
 + 
 +# write your custom netplan
 sudo tee /etc/netplan/01-netcfg.yaml >/dev/null <<EOF sudo tee /etc/netplan/01-netcfg.yaml >/dev/null <<EOF
 network: network:
 +  version: 2
 +  renderer: networkd
   ethernets:   ethernets:
-    ens3f0:+    $iface:
       dhcp4: false       dhcp4: false
       addresses:       addresses:
-        - 10.10.22.181/24 +        - $cidr 
-      gateway410.10.22.1+      routes: 
 +        - to: 0.0.0.0/0 
 +          via: $gw
       nameservers:       nameservers:
         addresses:         addresses:
           - 8.8.8.8           - 8.8.8.8
           - 8.8.4.4           - 8.8.4.4
-  version: 2 
 EOF EOF
-sudo bash -c "echo 'This file has been disabled by custom configuration (/etc/netplan/01-netcfg.yaml).'/etc/netplan/50-cloud-init.yaml" + 
-echo REMEMBER TO SET IP IN /etc/netplan/01-netcfg.yaml+disable the auto-generated cloud-init netplan 
 +sudo tee /etc/netplan/50-cloud-init.yaml >/dev/null <<EOF 
 +# disabled by custom config (/etc/netplan/01-netcfg.yaml
 +EOF 
 + 
 +echo "✔️  Netplan written for $iface ($cidr) via $gw" 
 </code> </code>
  
Line 92: Line 112:
 </code> </code>
  
-Fix nvme bug and turn off audit and apparmor+Fix nvme bug and turn off audit and app armor
 <code> <code>
 sudo sed -i '/^\s*GRUB_CMDLINE_LINUX_DEFAULT=/d' /etc/default/grub && echo 'GRUB_CMDLINE_LINUX_DEFAULT="audit=0 pcie_aspm=off pcie_port_pm=off nvme_core.default_ps_max_latency_us=0 apparmor=0 security=apparmor"' | sudo tee -a /etc/default/grub && sudo update-grub sudo sed -i '/^\s*GRUB_CMDLINE_LINUX_DEFAULT=/d' /etc/default/grub && echo 'GRUB_CMDLINE_LINUX_DEFAULT="audit=0 pcie_aspm=off pcie_port_pm=off nvme_core.default_ps_max_latency_us=0 apparmor=0 security=apparmor"' | sudo tee -a /etc/default/grub && sudo update-grub
Line 106: Line 126:
 @reboot /usr/bin/python3 /root/hostinfoLCDbyid.py @reboot /usr/bin/python3 /root/hostinfoLCDbyid.py
 </code> </code>
 +
 +AI
 +
 +Cuda 12.x uses ≥525
 +<code>
 +add-apt-repository ppa:graphics-drivers/ppa -y
 +apt update
 +</code>
 +Check for latest recommended NVIDIA driver
 +<code>
 +ubuntu-drivers devices
 +</code>
 +Replace 575-open with the recommended, for certain 40 series and all 50 series use the open
 +<code>
 +apt install nvidia-driver-575-open -y
 +</code>
 +
 +<code>
 +reboot
 +</code>
 +
 +Verify Installation
 +<code>
 +nvidia-smi
 +</code>
 +
 +Add CUDA repo
 +<code>
 +# Ensure NVIDIA CUDA repo is added:
 +sudo apt install software-properties-common
 +distribution="ubuntu2204"
 +wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/cuda-keyring_1.1-1_all.deb
 +sudo dpkg -i cuda-keyring_1.1-1_all.deb
 +sudo apt update
 +
 +# List the latest CUDA toolkit packages available:
 +apt-cache madison cuda-toolkit
 +</code>
 +
 +Returns
 +<code>
 +cuda-toolkit |   12.9.0-1 | https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  Packages
 +cuda-toolkit |   12.8.1-1 | https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  Packages
 +cuda-toolkit |   12.8.0-1 | https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  Packages
 +cuda-toolkit |   12.6.3-1 | https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  Packages
 +cuda-toolkit |   12.6.2-1 | https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  Packages
 +cuda-toolkit |   12.6.1-1 | https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  Packages
 +</code>
 +
 +Install the latest toolkit
 +<code>
 +sudo apt install cuda-toolkit-12-9 -y
 +</code>
 +
 +Set CUDA environment variables
 +<code>
 +echo 'export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}' >> ~/.bashrc
 +echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}' >> ~/.bashrc
 +source ~/.bashrc
 +</code>
 +
 +Verify CUDA
 +<code>
 +nvcc --version
 +</code>
 +
 +
 +<code>
 +apt install nfs-common
 +
 +apt install nfs-kernel-server
 +</code>
 +
 +
 +
 +
 +
  
 <code> <code>
Line 142: Line 239:
 apt install nmap apt install nmap
 </code> </code>
 +
 +===== WiFi + “jerky typing” fix for low power wifi cards!!!! =====
 +
 +Run <code>ip addr</code> to find the wlan card, mine is wlp2s0.
 +
 +Test if this is the problem first.
 +<code>
 +iw dev wlan0 get power_save
 +</code>
 +if its on, it will report:
 +<code>
 +Power save: on
 +</code>
 +Turn off power save via:
 +<code>
 +sudo iw dev wlan0 set power_save off
 +</code>
 +If that works, make it permanent via (also note this isn't the "right" way, just the fastest way)
 +<code>
 +vi /etc/systemd/system/wifi-powersave-off.service
 +</code>
 +Add the following snippet
 +<code>
 +[Unit]
 +Description=Disable WiFi Power Save
 +After=network.target
 +
 +[Service]
 +Type=oneshot
 +ExecStart=/usr/sbin/iw dev wlp2s0 set power_save off
 +
 +[Install]
 +WantedBy=multi-user.target
 +</code>
 +Make it permanent
 +<code>
 +sudo systemctl daemon-reexec
 +sudo systemctl enable wifi-powersave-off
 +sudo systemctl start wifi-powersave-off
 +</code>
 +
ubuntu_steps.1747979800.txt.gz · Last modified: 2025/05/23 05:56 by kenson

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki