Ubuntu 使用经验积累

本文主要记录了 Ubuntu 系统的使用经验,包括 Ubuntu 系统的安装配置、Ubuntu 系统的基础知识、Ubuntu 系统的开发环境配置等。

安装配置 Ubuntu 系统

  • 安装系统,设置用户信息
  • 安装 Oh-my-bash 终端美化软件
  • 安装配置 Neovim

Nvim 快捷键映射

这里的 lua 文件和 Windows 系统里的文件一样,但是需要更新 neovim 的版本,否则会出 bug。更新的方法为:添加源,然后直接更新即可。

Easiest way to update Neovim on Ubuntu

系统基础知识

.bashrc 和 .bash_profile 的区别

.bash_profile and .bashrc are files that contain commands, aliases, and functions for Bash, a common shell for Linux and macOS 1,2,3,4. .bash_profile is executed only once when you log in to your machine using a username and password, either via console or remotely 1,2,3,5. .bashrc is executed every time you open a new terminal window or a new Bash instance 1,3,5. Use .bash_profile to set up the environment using variables like $PATH 1,2,4. Use .bashrc to customize the shell for interactive use 3,4.

What is the difference: .bashrc and bash_profile?

.bashrc vs .bash_profile

.bashrc vs .bash_profile

Apt 和 Apt-get 的区别

APT vs APT-GET: What’s the Difference?

APT-GET Command in Linux {Detailed Tutorial With Examples}

文件和文件夹管理

1
2
3
4
mkdir dir # 创建文件夹
rmdir empty_dir # 删除空文件夹
rm file1 file2 # 删除文件
rm -rf dir # 删除一个非空文件夹和其中的所有文件

使用经验积累

1
export PATH="/home/xxxxx/.local/bin:$PATH$"

How to add a directory to the PATH?

基于 Miniconda 配置开发环境

基于 Pyenv 和 Pipenv 配置 Python 开发环境

CUDA 和 cuDNN 安装

Ubuntu 22.04 安装 Cuda11.7 和 cudnn8.6

How to verify CuDNN installation?

安装 Pyenv 管理 Python 版本

安装 Pipenv 管理虚拟环境

问题和解决方案

远程连接桌面显示不一致

  • 添加配置文件

    1
    nvim ~/.xsessionrc

    添加如下内容

    1
    2
    3
    export GNOME_SHELL_SESSION_MODE=ubuntu
    export XDG_CURRENT_DESKTOP=ubuntu:GNOME
    export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
  • 重启 xrdp 服务

    1
    sudo systemctl restart xrdp.service

Ubuntu 使用 CFW

关键在于本机代理设置。

Ubuntu 22.04 LTS 安装并配置 Clash - 掘金

作者

Shangyu ZHAO

发布于

2024-01-06

更新于

2024-10-13

许可协议