对于我用过的几个发行版本来说,ArchLinux算是天生对程序员亲和的,主要是有这几个原因,首先是官方源中维护了许多的编程环境的包,尤其是以Python维护的最多。其次是有AUR源,有许多人在共同的维护这个源,可以让开箱即用的包越来越多。最后的原因才是他是一个Linux的发行版本。
安装之前 在配置安装环境之前,我们得先对我们镜像源改造一下,这样才能继续我们之后的工作。我们得启用用multilib
和archlinuxcn
两个源。
multilib
将/etc/pacman.conf
中的multilib
的注释取消了就行
arclinuxcn源 在/etc/pacman.conf
加入如下配置:
1 2 3 [archlinuxcn] SigLevel = Optional TrustedOnly Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
1 2 3 sudo pacman -Syy sudo pacman -S archlinuxcn-keyring sudo pacman -S antergos-keyring
其它说法:
1 2 3 4 5 6 7 8 9 在终端输入 sudo pacman-mirrors -c China sudo pacman-mirrors -i -c China -m rank 即可换成国内镜像 原有的被保存在/var/lib/pacman-mirrors/custom-mirrors.json 现在的被保存在/etc/pacman.d/mirrorlist 另外pacman的下载缓存在/var/cache/pacman中 对于始终无法信任的情况,选择Optional TrustAll 即可 原文:https://blog.csdn.net/izzxacbbt/article/details/80150176
排列源
yaourt 或者 yay Yaourt是archlinux方便使用的关键部件之一,但没有被整合到系统安装中的工具。建议在装完系统重启之后,更新完pacman和基本系统之后,就安装这个工具。 最简单安装Yaourt的方式是arclinuxcn源
,pacman -Syu yaourt
安装pacman -S archlinuxcn-keyring
这个包导入秘钥就行。 对于这其中可能存在的两个问题,也就是由使用硬件时钟造成秘钥导入不成功的问题,可以使用以下方法进行解决:
立即同步时间,不用修改系统的时间设置
删除/etc/pacman.d/gnupg
文件夹,然后运行pacman-key --init
和pacman-key --refresh-keys
就可以解决这一个问题1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 sudo rm -R /etc/pacman.d/gnupg/ sudo rm -R /root/.gnupg/ sudo gpg --refresh-keys sudo pacman-key --init sudo pacman-key --populate archlinuxcn sudo pacman-key --populate archlinux manjaro sudo pacman-key --refresh-keys 或者 sudo pacman -Syu haveged sudo systemctl start haveged sudo systemctl enable haveged sudo rm -fr /etc/pacman.d/gnupg sudo pacman-key --init sudo pacman-key --populate archlinux sudo pacman-key --populate archlinuxcn sudo pacman-key --populate manjaro
安装 yay
配置 yay
1 yay --aururl "https://aur.tuna.tsinghua.edu.cn" --save
修改的配置文件位于 ~/.config/yay/config.json
,还可通过以下命令查看修改过的配置:
yay
的常用命令:1 2 3 4 5 yay -S package yay -Rns package yay -Syu yay -Ps yay -Qi package
安装打包工具包
中文字体 1 sudo pacman -S wqy-microhei ttf-dejavu wqy-zenhei wqy-microhei wqy-bitmapfont adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts
输入法 安装 sunpinyin
1 sudo pacman -S fcitx-im fcitx-configtool fcitx-sunpinyin
配置
1 2 3 4 5 vim ~/.xprofile export GTK_IM_MODULE=fcitxexport QT_IM_MODULE=fcitxexport XMODIFIERS="@im=fcitx"
软件/删除
TIM QQ yaourt qq
Python 对于Python编程环境来说,ArchLinux
默认的Python
环境是最新版本的Python3
版本,所以在使用的时候需要注意这个问题,对于常见Python
环境的安装方法如下:
1 2 3 4 5 6 7 8 sudo pacman -S python2 sudo pacman -S anaconda sudo pacman -S pyenv sudo yaourt -S pycharm-professional
Java JDK 在ArchLinux中使用Java,可以选择两种JDK的版本,一种是使用openjdk,另外一个是使用Oracle jdk版本,并且在ArchLinux中,可以使用archlinux-java来切换不同的版本。对于Java环境的一些工具集,可以使用如下的命令进行安装。
安装oracle jdk
安装openjdk1 sudo pacman -S jdk8-openjdk
chrome 1 sudo pacman -S google-chrome
maven
gradle
eclipse Idea 1 sudo pacman -S intellij-idea-ultimate-edition
postman
wget
vim
安装netstat\ifconfig等等net工具 1 2 3 4 5 6 7 8 9 10 11 sudo pacman -S net-tools ```bash ```bash sudo pacman -S postgresql sudo passwd postgres sudo echo -e "postgres ALL=(ALL) ALL" >> /etc/sudoers su postgres sudo chmod +w /var/lib/ initdb --locale en_US.UTF-8 -D '/var/lib/postgres/data'
Redis 1 2 3 4 5 wget http://download.redis.io/releases/redis-5.0.4.tar.gz tar -zxvf redis-5.0.4.tar.gz cd redis-5.0.4 sudo pacman -S gcc make make && make install
wiki-Redis
redis-desktop-manager 1 sudo pacman -S redis-desktop-manager
Node环境 和大部分的平台的安装配置一样,就是有可能需要配置以下全局的npm包的安装位置和一些目录,可以使用
1 sudo pacman -S nodejs npm
可以在~/.npmrc
中写入如下配置:
$HOME为你home目录路径的全写 1 2 cache=$HOME/.node_modules prefix=$HOME/.node_modules
markdown Typora
yaourt foxit
小巧强大的截图工具深度截图: 1 sudo pacman -S deepin-screenshot
zsh 强大的shell命令脚本解释器zsh: https://www.zhyong.cn/posts/edab/#安装zsh
you-get 强大的Web内容(视频,音频,图片)下载工具you-get:
brook 轻量级跨平台的go语言代理工具brook:
aria2 强大的命令行下载工具aria2:
fzf 模糊搜素神奇fzf:
具体配置查看文档,我的配置是添加alias:alias fzf=“fzf –height 40%”,可在oh-my-zsh配置文件中添加fzf插件。 个人认为通过vim **再按Tab键更好地利用了fzf命令,类似的还有kill **等。
ag 一个速度极快的类似ack的代码搜索工具ag:
1 sudo pacman -S the_silver_searcher
thefuck 自动纠正上一个控制台命令thefuck:
tmux 强大的终端复用工具tmux:
tig 字符模式下交互查看git项目tig:
安装配置Git
设置个人github信息:
1 2 3 4 git config --global user.name "github昵称" git config --global user.email "注册邮箱" git config --global user.name "maxzhao" git config --global user.email "1441439636@qq.com"
集合 1 sudo pacman -S python2 anaconda pyenv pycharm-professional maven gradle intellij-idea-ultimate-edition wget vim nodejs npm git openssh file-roller unrar unzip p7zip
安装网易云音乐 1 sudo pacman -S netease-cloud-music
即时聊天工具——wechat Github上electronic-wechat开源项目(据说比腾讯官方开发的要好-)
可以直接使用:
1 sudo pacman -S electronic-wechat
在安装前需要安装node.js不然不能使用其中的命令安装 安装 Node.js 的最佳方式是使用 nvm。
cURL:$ curl https://raw.github.com/creationix/nvm/master/install.sh | sh
Wget: $ wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh
安装完成后,重启终端并执行下列命令即可安装 Node.js。
切换目录到下载git clone下载
1 git clone https://github.com/geeeeeeeeek/electronic-wechat.git
切换到wechat目录
安装运行
1 npm install && npm start
编译安装在本地(Linux选择linux,这个不用解释吧?)
1 2 3 4 npm run build:osx npm run build:linux npm run build:win32 npm run build:win64
国内版火狐浏览器 1 pacman -S firefox firefox-i18n-zh-cn
压缩解压缩 1 pacman -S file-roller unrar unzip p7zip
Git ssh
Git kraken 1 sudo pacman -S gitkraken
安装wps 之前的安装方式,不在使用
1 2 3 4 5 6 yay -S wps-office sudo pacman -S ttf-ms-fonts: yay -S wps-office-fonts yay -S wps-office-mime yay -S wps-office-mui-zh-cn
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 vim /etc/pacman-mirrors.conf OnlyCountry = China pacman-mirrors -g sudo vim /etc/pacman.conf SigLevel = Optional TrustedOnly Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch sudo pacman -S archlinuxcn-keyring sudo pacman -S wps-office sudo pacman -S ttf-wps-fonts
如果安装上好搜狗和wps后不能输入中文的解决方法:vim ~/.xprofile
#在最后添加以下内容
1 2 3 4 5 6 7 8 export LC_ALL=zh_CN.UTF-8 export XIM=fcitx export XIM_PROGRAM=fcitx export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS="@im=fcitx" eval `dbus-launch --sh-syntax --exit-with-session` exec fcitx &
如果有重复登录不进界面系统的情况,则改为
1 2 3 4 export XIM_PROGRAM=fcitxexport GTK_IM_MODULE=fcitxexport QT_IM_MODULE=fcitxexport XMODIFIERS="@im=fcitx"
然后reboot即可
VSCode 1 sudo pacman -S visual-studio-code-bin
截图工具 1 sudo pacman -S spectacle
KDE安装NVIDIA驱动 打开设置页面,找到硬件设定,选择 Auto Install Proprietary Driver
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 Starting > Using config 'video-hybrid-intel-nvidia-prime' for device: 0000:01:00.0 (0300:10de:1c91) Display controller nVidia Corporation GP107M [GeForce GTX 1050 3 GB Max-Q] > Using config 'video-hybrid-intel-nvidia-prime' for device: 0000:00:02.0 (0300:8086:3e9b) Display controller Intel Corporation UHD Graphics 630 (Mobile) > Dependencies to install: video-modesetting > Installing dependency video-modesetting... Sourcing /etc/mhwd-x86_64.conf Has lib32 support: true Sourcing /var/lib/mhwd/db/pci/graphic_drivers/video-modesetting/MHWDCONFIG Processing classid: 0300 Sourcing /var/lib/mhwd/scripts/include/0300 :: Synchronizing package databases... core is up to date extra is up to date community is up to date multilib is up to date archlinuxcn is up to date > Successfully installed dependency video-modesetting > Installing video-hybrid-intel-nvidia-prime... Sourcing /etc/mhwd-x86_64.conf Has lib32 support: true Sourcing /var/lib/mhwd/db/pci/graphic_drivers/hybrid-intel-nvidia-prime/MHWDCONFIG Processing classid: 0300 Sourcing /var/lib/mhwd/scripts/include/0300 resolving dependencies... looking for conflicting packages... Packages (4) lib32-nvidia-utils-460.56-1 linux59-nvidia-460.56-1 nvidia-prime-1.0-4 nvidia-utils-460.56-2 Total Download Size: 131.55 MiB Total Installed Size: 447.25 MiB :: Proceed with installation? [Y/n] :: Retrieving packages... downloading nvidia-utils-460.56-2-x86_64.pkg.tar.zst... downloading nvidia-prime-1.0-4-any.pkg.tar.zst... downloading linux59-nvidia-460.56-1-x86_64.pkg.tar.zst... downloading lib32-nvidia-utils-460.56-1-x86_64.pkg.tar.zst... checking keyring... checking package integrity... loading package files... checking for file conflicts... checking available disk space... :: Processing package changes... installing nvidia-utils... ==> If you run into trouble with CUDA not being available, run nvidia-modprobe first. Optional dependencies for nvidia-utils gtk3: nvidia-settings [installed] xorg-server-devel: nvidia-xconfig opencl-nvidia: OpenCL support installing nvidia-prime... installing lib32-nvidia-utils... Optional dependencies for lib32-nvidia-utils lib32-opencl-nvidia installing linux59-nvidia... In order to use nvidia module, reboot the system. :: Running post-transaction hooks... (1/6) Creating system user accounts... Creating group nvidia-persistenced with gid 143. Creating user nvidia-persistenced (NVIDIA Persistence Daemon) with uid 143 and gid 143. (2/6) Reloading system manager configuration... (3/6) Arming ConditionNeedsUpdate... (4/6) Updating module dependencies... (5/6) Updating Kernel initcpios for Nvidia-DRM... ==> Building image from preset: /etc/mkinitcpio.d/linux59.preset: 'default' -> -k /boot/vmlinuz-5.9-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.9-x86_64.img ==> Starting build: 5.9.16-1-MANJARO -> Running build hook: [base] -> Running build hook: [udev] -> Running build hook: [autodetect] -> Running build hook: [modconf] -> Running build hook: [block] -> Running build hook: [keyboard] -> Running build hook: [keymap] loadkeys: Unable to open file: cn: No such file or directory -> Running build hook: [filesystems] ==> Generating module dependencies ==> Creating gzip-compressed initcpio image: /boot/initramfs-5.9-x86_64.img ==> Image generation successful ==> Building image from preset: /etc/mkinitcpio.d/linux59.preset: 'fallback' -> -k /boot/vmlinuz-5.9-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.9-x86_64-fallback.img -S autodetect ==> Starting build: 5.9.16-1-MANJARO -> Running build hook: [base] -> Running build hook: [udev] -> Running build hook: [modconf] -> Running build hook: [block] -> Running build hook: [keyboard] -> Running build hook: [keymap] loadkeys: Unable to open file: cn: No such file or directory -> Running build hook: [filesystems] ==> Generating module dependencies ==> Creating gzip-compressed initcpio image: /boot/initramfs-5.9-x86_64-fallback.img ==> Image generation successful (6/6) Updating the desktop file MIME type cache... nvidia-utils: install reason has been set to 'explicitly installed' nvidia-prime: install reason has been set to 'explicitly installed' lib32-nvidia-utils: install reason has been set to 'explicitly installed' linux59-nvidia: install reason has been set to 'explicitly installed' xorg configuration file: '/etc/X11/mhwd.d/nvidia.conf' > Successfully installed video-hybrid-intel-nvidia-prime
GNOME安装显卡驱动 我的笔记本是Intel的集成显卡和英伟达的独立显卡,这里有一些相关描述:https://wiki.archlinux.org/index.php/NVIDIA_(简体中文)
sudo pacman -S xf86-video-intel
sudo pacman -S xf86-video-nouveau
GNOME安装NVIDIA
显卡驱动 Manjaro
虽然自带硬件管理,但无法在两个显卡之间自由切换,按照ArchLinux Wiki给出的方法,只有Bumblebee方案成功
1 sudo pacman -S bumblebee bbswitch
把用户添加到bumblebee组里:sudo gpasswd -a XXX bumblebee
//XXX是用户名
启动bumblebeed
服务:sudo systemctl enable bumblebeed.service
安装依赖sudo pacman -S bumblebee nvidia opencl-nvidia lib32-nvidia-utils lib32-opencl-nvidia mesa lib32-mesa-libgl xf86-video-intel
配置bumblebee: 编辑vim /etc/bumblebee/bumblebee.conf
,修改以下内容:
1 2 3 Driver=nvidia # 指定nvidia [driver-nvidia] PMMethod=bbswitch # 电源管理指定bbswitch
用vim编辑文件的保存方法: 编辑好以后按esc键退出,然后输入英文的冒号再输入wq,即保存并退出reboot
开启NVIDIA
显卡 sudo tee /proc/acpi/bbswitch <<< ON #关闭则是off
查看显卡状态 nvidia-smi
Steam配置Manjaro
自带Steam,双击打开之后出现一个License界面之后再也没有反应,通过谷歌之后发现是缺少依赖:sudo pacman -S steam-native-runtime
steam_install_workaround
等待依赖安装完成后就可以发现steam已经正常打开
sublimit官方地址 http://www.sublimetext.com/docs/3/linux_repositories.html#pacman
一些软件安装卸载的操作
安装 pacman -S
删除 pacman -R
移除已安装不需要软件包 pacman -Rs
删除一个包,所有依赖 pacman -Rsc
升级包 pacman -Syu
查询包数据库 pacman -Ss
搜索已安装的包 pacman -Qs
显示包大量信息 pacman -Si
本地安装包 pacman -Qi
清理包缓存 pacman -Sc
添加命令打别名,比如ll
1 2 3 vim ~/.bashrc alias ll='ls -l'
其他安装及汇总 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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 sudo pacman -S deepin-picker sudo pacman -S deepin-screen-recorder sudo pacman -S deepin-screenshot sudo pacman -S deepin-system-monitor yay -s deepin-wine-wechat yay -S deepin-wine-tim yay -S deepin-wine-baidupan yay -S deepin.com.thunderspeed sudo pacman -S scrcpy yay -S peek sudo pacman -S jdk8-openjdk sudo pacman -S make sudo pacman -S cmake sudo pacman -S clang sudo pacman -S nodejs sudo pacman -S npm sudo pacman -S goland sudo pacman -S vim sudo pacman -S maven sudo pacman -S pycharm-professional sudo pacman -S intellij-idea-ultimate-edition sudo pacman -S goland sudo pacman -S visual-studio-code-bin sudo pacman -S qtcreator sudo pacman -S postman-bin sudo pacman -S insomnia sudo pacman -S gitkraken sudo pacman -S wireshark-qt sudo pacman -S zeal sudo pacman -S gitkraken sudo pacman -S google-chrome sudo pacman -S foxitreader sudo pacman -S bookworm sudo pacman -S unrar unzip p7zip sudo pacman -S goldendict sudo pacman -S wps-office yay -S typora yay -S electron-ssr yay -S xmind sudo pacman -S pencil sudo pacman -S netease-cloud-music sudo pacman -S aria2 sudo pacman -S filezilla sudo pacman -S gimp sudo pacman -S albert yay -S copyq sudo pacman -S screenfetch sudo pacman -S htop sudo pacman -S bat sudo pacman -S yakuake sudo pacman -S net-tools yay -S tldr yay -S tig yay -S tree yay -S ncdu yay -S mosh
本文地址:arch-gnome 编程环境和其它环境安装
Linux上IDEA激活 curl 与 wget 的区别 无法挂载参考链接 u盘安装manjaro——抛弃Centos的旅程开始
本文地址: https://github.com/maxzhao-it/blog/post/25441/