0.前提
暗夜精靈5 (i7-9750H/ 16G RAM /NVIDIA 1660Ti/ 512G SSD)
Manjaro 18.1.0 Juhraya(之前的版本我測試過,會卡在TTL之類的地方,網絡上幾乎所有的方法我都試過了,全部無效)
1.安裝
1.1 製作U盤啓動盤
使用etcher(https://www.balena.io/etcher/)將ISO文件寫入U盤中。
1.2 設置U盤啓動
開機後按F10進入BIOS(F9修改啓動順序,F12是Windows的修復工具)
提示:不要啓用安全啓動檢查,那是爲Windows10設置,否則無法啓動Linux系統。
1.3 設置
圖片來自(https://cloud.tencent.com/developer/article/1390999)
將driver調整爲non-free,tz調整爲Asia/Shanghai
然後boot進入安裝環境。
1.4 安裝
之前安裝時,會因爲英偉達顯卡的問題無法安裝,連這個界面都看不見。要麼卡在命令行界面,要麼黑屏卡死等等。同時,惠普好像屏蔽了核心顯卡。而且惠普BIOS中沒有關閉獨立顯卡的設置。
設置磁盤分區
清空磁盤,主要清理之前的Windows系統,並且設置和內存同樣大小的交換內存。
然後就是安裝
安裝完成後,拔出U盤,並且將啓動順序改回來。
2.設置
2.1 設置華爲源
sudo pacman-mirrors -i -c China -m rank //按照速度更新鏡像,然後排名
華爲源的速度平均2M/s。絕對槓槓滴。
2.2 設置清華源archlinuxcn
文件位置:/etc/pacman.conf
[archlinuxcn]
SigLevel = Optional TrustAll
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
2.3 設置下載器
文件位置:/etc/makepkg.conf
#axel 單線程多鏈接
#DLAGENTS=('file::/usr/bin/axel -n 6 -o %o %u'
# 'ftp::/usr/bin/axel -n 6 -o %o %u'
# 'http::/usr/bin/axel -n 6 -o %o %u'
# 'https::/usr/bin/axel -n 6 -o %o %u'
# 'rsync::/usr/bin/rsync --no-motd -z %u %o'
# 'scp::/usr/bin/scp -C %u %o')
DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3 -O %o %u'
'http::/usr/bin/wget -c -t 3 --waitretry=3 -O %o %u'
'https::/usr/bin/wget -c -t 3 --waitretry=3 --no-check-certificate -O %o %u'
'rsync::/usr/bin/rsync -z %u %o'
'scp::/usr/bin/scp -C %u %o')
#DLAGENTS=('ftp::/usr/bin/aria2c -s5 %u -o %o'
# 'http::/usr/bin/aria2c -s5 %u -o %o'
# 'https::/usr/bin/aria2c -s5 %u -o %o'
# 'rsync::/usr/bin/rsync -z %u %o'
# 'scp::/usr/bin/scp -C %u %o')
#'ftp::/usr/bin/aria2c -c --ftp-pasv=true -m3 -s10 -j10 --follow-torrent=false -o %o %u >&2'
#'http::/usr/bin/aria2c -c --ftp-pasv=true -m3 -s10 -j10 --follow-torrent=false -o %o %u >&2'
#'https::/usr/bin/aria2c -c -m3 -s10 -j10 --check-certificate=false --follow-torrent=false -o %o %u >&2'
根據自己喜好選擇。
2.4 安裝 yaourt
sudo pacman -S yaourt archlinuxcn-keyring
yaourt -Syyu
然後更新系統。
2.5 設置shell
相比於bash,我更喜歡zsh。
yaourt -S zsh
chsh -s /bin/zsh #修改普通用戶的shell
sudo chsh -s /bin/zsh #修改root用戶的shell
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh #oh-my-zsh官方庫,目標位置爲用戶目錄下的.oh-my-zsh文件夾
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/plugins
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/plugins
啓用zsh後,需要個性化設置文件~/.zshrc
這是我的
# If you come from bash you might have to change your $PATH.
export PATH=/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# zhs的主題
ZSH_THEME="ys"
# Set list of themes to load
# Setting this variable when ZSH_THEME=random
# cause zsh load theme from this variable instead of
# looking in ~/.oh-my-zsh/themes/
# An empty array have no effect
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
export UPDATE_ZSH_DAYS=7
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
# z命令快速跳轉目錄 x命令解壓一切文件 命令行可以直接google
plugins=(
git z zsh-autosuggestions extract web-search zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
# User configuration
export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='mvim'
fi
# Compilation flags
export ARCHFLAGS="-arch x86_64"
# ssh
export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
#
alias config="gedit ~/.zshrc"
alias cp="cp -i" # confirm before overwriting something
alias df='df -h' # human-readable sizes
alias free='free -m' # show sizes in MB
alias more=less
# 自動更新的時間間隔,單位是天,這裏設置 30 天更新一次
export UPDATE_ZSH_DAYS=1
xhost +local:root > /dev/null 2>&1
# export QT_SELECT=4
export PATH=$PATH:/opt/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/cuda/lib:/opt/cuda/lib64
最後兩行是我開發需要的cuda的庫文件位置環境變量。