# 安装Linux发行版本日常工具


## 安装Linux

无论安装那个Linux发行版本都要注意下载完成镜像文件以后需要验证一下sha256sum文件一致。

```shell
sha256sum /path/Linux.iso
```

## 使用国内镜像源

1. 修改Linux系统源，以下以POP OS为例

``` shell
sudo sed -i 's@http://apt.pop-os.org/@https://mirror.sjtu.edu.cn/pop-os/@g' /etc/apt/sources.list.d/pop-os-apps.sources
sudo sed -i 's@http://apt.pop-os.org/@https://mirror.sjtu.edu.cn/pop-os/@g' /etc/apt/sources.list.d/pop-os-release.sources
sudo sed -i 's@http://apt.pop-os.org/@https://mirror.sjtu.edu.cn/@g' /etc/apt/sources.list.d/system.sources

```
2. 以NixOS为例

```shell
sudo nix-channel --add https://mirrors.tuna.tsinghua.edu.cn/nix-channels/nixos-22.11 nixos
sudo nix-channel --update

```

3. 修改flatpak源

```shell
sudo flatpak remote-modify flathub --url=https://mirrors.ustc.edu.cn/flathub
```

<!-- more -->
## 安装常用软件


### 安装ibus-rime

1. 执行 sudo apt install ibus-rime 安装软件
2. 在系统设置中搜索input/keyboard等，添加ibus-rime为中文输入法
3. 如果配置失败，尝试重启ibus-daemon -rdx
4. 将rime输入法配置文件拷贝到~/.config/ibus/rime目录下
5. 安装ibus-tweaker: https://extensions.gnome.org/extension/2820/ibus-tweaker/
6. 通过ibus-tweaker设置输入法


### 通过flatpak安装常用软件

```shell
flatpak install flathub md.obsidian.Obsidian
flatpak install flathub com.microsoft.Edge
flatpak install flathub com.visualstudio.code
flatpak install dev.zed.Zed
```

> [!tip] "重要说明"
> 1. 在某些发行版本中zed会出现 unsupported GPU的问题，可以将/etc/prime-discrete 翻转配置修改
> 2. If you have a discrete GPU and you are using PRIME (e.g. Pop_OS 24.04, ArchLinux, etc) you may be able to configure Zed to work by switching /etc/prime-discrete from ‘off’ to ‘on’ (or the reverse)
> 3. 参考：https://zed.dev/docs/linux?highlight=PRIME#zed-on-linux


### 安装Nodejs

1. 从国内源下载适当版本，建议下载压缩包
2. ttps://registry.npmmirror.com/binary.html?path=node/
3. 解压缩文件后将文件拷贝到 /usr/local 目录下
4. 配置Node.js国内源 npm config set registry https://registry.npmmirror.com/
5. 安装hexo sudo npm install -g hexo-cli

### 配置github

1. 在本地设置git用户和邮箱

``` shell
git config --global user.name "xxx"
git config --global user.email "xxx@163.com"
```
    
2. 生成密钥

```shell
ssh-keygen -t rsa -C "xxx@163.com"
```

3. 拷贝公钥信息并配置到GitHub
```
cat .ssh/id_rsa.pub
```

4. 测试是否已经配置成功
``` shell
ssh -T git@github.com
```

