当前位置: 代码迷 >> 综合 >> Manjaro 小配置
  详细解决方案

Manjaro 小配置

热度:1   发布时间:2024-02-24 19:39:54.0

Manjaro 小配置

换源

sudo pacman-mirrors -i -c China -m rank

添加archlinuxcn的源,不建议,除非真的需要

sudo vim /etc/pacman.conf

在末尾添加:

[archlinuxcn]
Server = http://mirrors.163.com/archlinux-cn/$arch

保存退出,然后更新系统

sudo pacman -Syyu

如果上一步添加了archlinuxcn的源:

sudo pacman -S archlinuxcn-keyring

安装Arch软件

sudo pacman -S yay
yay -S package-name

安装fcitx5及配置

sudo pacman -S fcitx5 fcitx5-chinese-addons fcitx5-qt kcm-fcitx5 fcitx5-im
yay -S fcitx5-pinyin-zhwiki

配置文件 ~/.xprofile

sudo vim ~/.xprofile
#fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx

开机自启

sudo cp /usr/share/applications/fcitx5.desktop /etc/xdg/autostart/

配置ohmyzsh

修改默认shell为zsh

chsh -s /usr/bin/zsh

安装ohmyzsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

如果提示被拒绝连接就改一下hosts文件

sudo vim /etc/hosts
# GitHub Start
151.101.76.133 raw.githubusercontent.com
# GitHub End

安装zsh-syntax-highlighting:提供命令高亮

git clone https://github.com.cnpmjs.org/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

安装autosuggestions:记住你之前使用过的命令

git clone https://github.com.cnpmjs.org/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

安装incr:再也不用先ls在粘贴文件名了

git clone https://github.com.cnpmjs.org/makeitjoe/incr.zsh $ZSH_CUSTOM/plugins/incr

启用所有插件

vim ~/.zshrc

将plugins=(git)改为:

plugins=(git zsh-syntax-highlighting zsh-autosuggestions incr sudo extract)
source $ZSH/oh-my-zsh.sh
eval $(thefuck --alias)

手动修改konsole的默认bash为/usr/bin/zsh,并打开konsole执行:

source ~/.zshrc

美化ohmyzsh

git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

设置 ~/.zshrc

ZSH_THEME="powerlevel10k/powerlevel10k"

配置pip

换源,终端输入

pip config set global.index-url https://pypi.douban.com/simple
pip config set install.trusted-host pypi.douban.com

或者编辑 ~/.pip/pip.conf

mkdir ~/.pip
vim ~/.pip/pip.conf
[global]
index-url = https://pypi.douban.com/simple[install]
trusted-host = pypi.douban.com

安装thefuck:帮你更加高效地学习linux命令

pip install --user thefuck

python虚拟环境工具

pip install virtualenvwrapper

启动virtualenvwrapper 并查看路径

virtualenvwrapper.sh
whereis virtualenvwrapper.sh

~/.bashrc 添加上:

if [ `id -u` != '0' ]; thenexport VIRTUALENV_USE_DISTRIBUTE=1        # <-- Always use pip/distributeexport WORKON_HOME=$HOME/.virtualenvs       # <-- Where all virtualenvs will be storedsource virtualenvwrapper.sh的路径export PIP_VIRTUALENV_BASE=$WORKON_HOMEexport PIP_RESPECT_VIRTUALENV=truefi

使其生效

source ~/.bashrc

虚拟环境基本使用

workon  # 查看
mkvirtualenv demo  # 创建
workon demo  # 激活
deactivate  # 退出
rmvirtualenv demo  # 删除

jupyter

pip install jupyter jupyterlab

安装 npm 并换源

sudo pacman -S npm
npm config set registry http://registry.npm.taobao.org

安装kite

bash -c "$(wget -q -O - https://linux.kite.com/dls/linux/current)"
jupyter-kite
jupyter labextension install "@kiteco/jupyterlab-kite"

MySql

安装

sudo pacman -S mysql

初始化

sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

查看状态

systemctl status mysqld.service

启动服务

sudo systemctl start mysqld.service

开机自启

sudo systemctl enable mysqld.service

修改密码

alter user 'root'@'localhost' identified by 'xxx';

安装日常软件

yay -S typora google-chrome ranger latte-dock

错误

错误: Cannot find the strip binary required for object file stripping.

解决

sudo pacman -Sy base-devel