Showing posts with label Linux Knowledge. Show all posts
Showing posts with label Linux Knowledge. Show all posts

4/28/2026

On Ubuntu 22.04/24.04, SAML authentication from GlobalProtect doesn't open the default browser

 The problem was that ~/.config/mimeapps.list doesn't have the correct setting for type text/html=. It should be set to text/html=microsoft-edge.desktop or your chosen browser.

4/13/2026

Ubuntu 24.04 installation on Surface Pro 9 & Surface Pro 11

 Issues:

    bluetooth: The bluetooth doesn't work after hibernation. The following steps nneed to be added:

        1. sudo emacs /lib/systemd/system-sleep/bt-lunar-fix

        2. Paste the following script:

#!/bin/sh

case $1 in

  post)

    echo "Resetting Bluetooth for Lunar Lake..."

    systemctl stop bluetooth

    modprobe -r btintel_pcie btintel bluetooth 2>/dev/null || true

    sleep 1

    modprobe btintel_pcie

    systemctl start bluetooth

    ;;

esac

        3. sudo chmod +x /lib/systemd/system-sleep/bt-lunar-fix

    hibernation: surface pro 9 hibernate won't shutdown completely on ubuntu 24.04. Need to add Adding specific kernel flags can force the hardware to respect power-off commands.

    Open the configuration: sudo nano /etc/default/grub.

    Find the line GRUB_CMDLINE_LINUX_DEFAULT.

    Append pci=hpiosize=0 to the existing parameters (e.g., GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=hpiosize=0").

    Update GRUB: sudo update-grub and reboot.


    sogou pinyin: Should not install fcitx5. sudo apt purge fcitx5. Need to install fcitx.


    Grub: Adding GRUB_DISABLE_MEMTEST=true to /etc/default/grub and re-running sudo update-grub to remove the memtest from the grub selection menu.

12/21/2025

How do I install the NVIDIA drivers for RTX A6000 GPUs on Ubuntu 22.04?

 


How do I install the NVIDIA drivers for RTX A6000 GPUs on Ubuntu 22.04?

Installing NVIDIA drivers for the RTX A6000 on Ubuntu 22.04 requires a few key steps to ensure optimal performance and compatibility. The RTX A6000 is a powerful data center and workstation GPU, and proper driver installation is essential for machine learning, AI, and high-performance computing workloads.

Prerequisites

  • Ubuntu 22.04 LTS installed and updated (sudo apt update && sudo apt upgrade -y)
  • RTX A6000 GPU properly installed in the system
  • Internet connection for downloading drivers
  • Administrative (sudo) privileges

Step-by-Step Installation Guide

1. Disable Nouveau Drivers (Open-Source Alternative)

Nouveau drivers can conflict with NVIDIA's proprietary drivers. Disable them by running:

  1. Open a terminal and create a new blacklist file: sudo nano /etc/modprobe.d/blacklist-nouveau.conf
  2. Add these lines:
    blacklist nouveau
    options nouveau modeset=0
  3. Save the file (Ctrl+O, then Ctrl+X).
  4. Update the initramfs: sudo update-initramfs -u
  5. Reboot the system: sudo reboot

2. Install NVIDIA Drivers via Ubuntu Repository

The simplest method is using Ubuntu's built-in repository:

  1. Open a terminal and update the package list: sudo apt update
  2. Install the recommended NVIDIA driver (usually the latest stable version): sudo ubuntu-drivers autoinstall
  3. Alternatively, manually select a driver version: sudo apt install nvidia-driver-535 (replace 535 with the latest version)
  4. Reboot the system: sudo reboot

3. Verify Installation

After rebooting, confirm the driver is working:

  • Run nvidia-smi to check GPU status and driver version.
  • Check the NVIDIA settings panel: nvidia-settings.
  • Verify CUDA compatibility if needed: nvcc --version (requires CUDA Toolkit).

Alternative: Install Drivers from NVIDIA Website

For the latest drivers directly from NVIDIA:

  1. Visit NVIDIA's official driver download page and select the RTX A6000 and Linux 64-bit option.
  2. Download the .run file.
  3. Make it executable: chmod +x NVIDIA-Linux-x86_64-*.run
  4. Run the installer: sudo ./NVIDIA-Linux-x86_64-*.run
  5. Follow on-screen prompts and reboot.

Troubleshooting Tips

  • If the system boots to a black screen, try switching to a virtual terminal (Ctrl+Alt+F2) and reinstalling drivers.
  • Use sudo apt purge nvidia* to remove existing drivers before reinstalling.
  • Check logs for errors: dmesg | grep -i nvidia.

Following these steps ensures your RTX A6000 operates at peak performance on Ubuntu 22.04, whether for AI training, 3D rendering, or high-performance computing tasks.



8/19/2021

Grub loader set default to Windows boot manager

 If you have dual boot setup, one of the frustrating things that you'll immediately notice is that Ubuntu is now set as the default OS in the Grub loader. There is an easy way to switch back to using Windows as the default.

sudo emacs /etc/default/grub

Change: GRUB_DEFAULT=? (? is the 0-based index of the Grub menu)

sudo update-grub

This is for grub-mkconfig (GRUB) 2.02-2ubuntu8.23

Ubuntu 18.04

3/02/2021

How to adjust Linux Ubuntu 18.04 screen brightness

sudo apt install  brightnessctl

sudo brightnessctl set 20%

5/11/2020

Enable Ubuntu 18.04/22.04/24.04 hibernate

To make things easy: create a swap drive instead of using a swap file.

In the BIOS settings: disable secure boot FIRST.


For 24.04:

Follow: https://ubuntuhandbook.org/index.php/2021/08/enable-hibernate-ubuntu-21-10/

  • First, run command to create a config file:
    sudo nano /etc/polkit-1/rules.d/10-enable-hibernate.rules
  • When file opens, paste the lines below and press Ctrl+S to save, finally press Ctrl+X to exit.
    polkit.addRule(function(action, subject) {
        if (action.id == "org.freedesktop.login1.hibernate" ||
            action.id == "org.freedesktop.login1.hibernate-multiple-sessions" ||
            action.id == "org.freedesktop.upower.hibernate" ||
            action.id == "org.freedesktop.login1.handle-hibernate-key" ||
            action.id == "org.freedesktop.login1.hibernate-ignore-inhibit")
        {
            return polkit.Result.YES;
        }
    });


For 22.04

Then follow: https://www.geeksforgeeks.org/how-to-enable-hibernate-in-ubuntu-22-04-lts/

Edit the file /etc/systemd/sleep.conf with the following configuration:


[Sleep]
HibernateMode=shutdown


Enable the hibernation menu:

sudo gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.desktop.pkla
 
[Enable hibernate in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

[Enable hibernate in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes
  

1/22/2018

Font of Microsoft OneDrive Text or text editor

Apparently Microsoft OneDrive website font depends on your operating system's browser version.
I like to use the Consolas font for the display, but it always uses Courier New as the font for my Ubuntu/Linux Firefox browser.

The solution is to install User Agent Switcher in Firefox and use Windows/Firefox to enable the Consolas font.

1/19/2018

How to install the latest cinnamon on Ubuntu 16.04

sudo add-apt-repository ppa:embrosyn/cinnamon
sudo apt update
sudo apt install cinnamon 

1/11/2018

VIM frequently commonly used commands

Left: h
Right: l
Up: k
Down: j
Undo: u
Start Editing: i
Append at line end: A
Edit after cursor: a
Goto line: number then G
Delete line: dd

1/06/2018

Linux下的飞鸽传书 iptux

sudo apt install iptux

Tools | Preferences | System
Use gb2312 for Preference network encoding

11/29/2017

X11 Forwarding over Screen (gnome terminal screen command)

Before running screen:
echo $DISPLAY

Once you have re-attached to screen, explicitly set the environment variable:

export DISPLAY=:N.0

How to set up Canon MF247 dw printer on Ubuntu 16.04

1. Go to https://www.usa.canon.com/internet/portal/us/home/support/details/printers/black-and-white-laser/imageclass-mf247dw?tab=drivers_downloads and download the Linux driver.
2. Manually install "sudo apt install libgcrypt20-dev"
3. Run sudo ./install.sh. (I had to edit the file and make sure it runs DEB instead of RPM by changing "if which rpm > /dev/null 2>&1;" to  if [ 1 -eq 0];

NOTE: I got this error:
#----------------------------------------------------#
# cups restart
#----------------------------------------------------#
/etc/init.d/cups restart
[ ok ] Restarting cups (via systemctl): cups.service.


Could not install.

But it seems this error doesn't matter.

4. Then I can add the printer by using its ip: 10.1.30.154

11/22/2017

11/02/2017

emacs paste text wrong indent

It turned out that I was using emacs version 24.5.1, which has a bug that caused the wrong paste indent.
The solution to it:
  Install Emacs 25.3 by using the following command:
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt update
sudo apt remove --purge emacs24
sudo apt install emacs25


8/30/2017

CloudCompare hangs on Linux/Ubuntu 16.04

To fix that:
Display | Display Options | Change Auto-compute octree for picking to NEVER

7/20/2017

.inputrc file content

set bell-style none  # disable bell
"\e[1;5C": forward-word   # ctrl + right
"\e[1;5D": backward-word  # ctrl + left

1/06/2017

How to change terminal cursor shape and color

For gnome-terminal:
Profile Preference | Cursor Shape (Prefer no blinking block)
Then:
Add "echo -ne '\e]12;#ff0000\a'" to change the color to red

To disable cursor blinking:
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default|tr -d \')/ cursor-blink-mode off

To disable Ubuntu Cinnemon cursor blinking:
System settings | Keyboard Turn off text cursor blinks

For Putty:
Window | Appearance | Cursor Appearance: to change shape
Window | Colors | Cursor Color: to change the color  

For Google Docs:

12/26/2016

How to restart Ubuntu cinnamon

pkill -HUP -f "cinnamon --replace"

9/07/2016

How to fix Docker

Sometime the Docker won't stop and it just hangs on any commends.

So far I haven't figured out a way to fix it without rebooting the machine.

Even worse: docker daemon won't start after reboot. I need to reinstall docker to get it to work. And I had to use the following commands to uninstall and reinstall to make it work.

$ sudo apt-get autoremove --purge docker-engine
$ rm -rf /var/lib/docker
$ sudo apt-get install docker-engine

8/03/2016

How to use SSHFS

# To install
sudo apt install sshfs

# To mount
sshfs -o idmap=user dev@192.168.1.45:/ /mnt/sshfs/

# to umount
fusermount -u /mnt/sshfs/