Post

Ubuntu Setup

0. Delete Ubuntu

双系统删除ubuntu

0.1 Open Diskpart

  • win+R: diskpart

0.2 Commands in Diskpart

  • Check available disks:
    1
    
    list disk
    
  • Select the disk where Ubuntu is installed (e.g., Disk 1):
    1
    
    select disk <disk_number>
    
  • Check partitions on the selected disk:
    1
    
    list partition
    
  • Select the partitio(System)n containing Ubuntu system files (e.g., Partition 1):
    1
    
    select partition 1
    
  • Assign a drive letter (P:):
    1
    
    assign letter=P
    

0.3 Delete Ubuntu System Files

  • Run Notepad as Administrator.
  • Navigate to P: in File Explorer and delete the Ubuntu folder in EFI folder.

0.4. Remove Assigned Drive Letter

  • Return to Diskpart and run the following command:
    1
    
    remove letter=P
    

0.5 Delete Ubuntu Partition Using Disk Management

  • Open Disk Management (Win + XDisk Management).
  • Locate the partition containing Ubuntu.
  • Right-click and select “Delete Volume”.
  • (Optional) Extend another partition into the unallocated space.

1. Install Ubuntu

2. Install Anaconda3

2.1 Download

Anaconda3

1
cd Downloads
1
bash Anaconda3-xxxx.xx-Linux-x86_64.sh

2.2 bashrc setting

1
nano ~/.bashrc
  • export
1
export PATH="/home/username/anaconda3/bin:$PATH"
1
source ~/.bashrc

2.3 Command

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
conda create -n your_env_name python=X.X(3.6,3.7,etc.)

source activate your_env_name(env_name)

source deactivate your_env_name(env_name)

conda remove -n your_env_name(env_name) --all

conda list

conda install package_name(package_name)
conda install scrapy==1.3 
conda install -n env_name package_name

#Check env
conda env list 
#or
conda info -e
#or
conda info --envs

conda update conda

conda update anaconda

conda update --all

conda update python

2.4 put images source

3.Install Pycharm

Pycharm

4.ROS

  • ROS2 - humble - ubuntu 22.04
  • ROS1 - ubuntu 20.04

5.Install Nvidia driver

1
ubuntu-drivers devices
1
sudo apt-get install nvidia-driver-535
  • hardware key
1
Enroll MOK 
  • reboot and check
1
nvidia-smi

6.CUDA

CUDA

  • nano ~/.bashrc
    1
    2
    
    export PATH=/usr/local/cuda-12.3/bin${PATH:+:${PATH}}
    export LD_LIBRARY_PATH=/usr/local/cuda-12.3/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
    

7.cuDNN

cudnn

  • Extract
1
cd ~/Downloads/cudnn-xxxxxxxxxxxxx`
  • move
1
2
3
sudo cp include/cudnn*.h /usr/local/cuda/include 
sudo cp -P lib/libcudnn* /usr/local/cuda/lib64 
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*
  • Check
1
cat /usr/local/cuda-12.3/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

8.Pytorch

https://pytorch.org/get-started/previous-versions/

  • Check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
>>import torch

>>print(torch.__version__)

>>print(torch.version.cuda)

>>print(torch.backends.cudnn.version())

>>torch.cuda.is_available()

>>torch.cuda.device_count()

>>torch.cuda.get_device_name(0)

>>torch.cuda.current_device()

9.Docker

Do not install docker-desktop!


This post is licensed under CC BY 4.0 by the author.