zoukankan      html  css  js  c++  java
  • Manjaro安装与基本配置

    0. 安装

    # 启动时选择第二项boot(non-free),Manjaro自带的驱动精灵会帮你安装好所需驱动,笔记本双显卡则会帮你安装bumblebee
    driver boot(non-free)

    如果是WIndows+Manjaro双系统安装,

    步骤可以参考:https://my.oschina.net/langxSpirit/blog/1633384

    1.系统信息

    #查看系统信息

    inxi -Fx

    2.网络设置

    #查看网络状态

    ping 8.8.8.8

    ------------
    connect: Network is unreachable
    ------------
    #如果网卡驱动是正常,请尝试手动设置IP地址、网关、DNS信息

    3.笔记本双显卡设置

    #查看显卡NVIDIA状态

    lspci| grep -i vga

    01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GTX 660M] (rev ff)
    Nvidia 卡信息的末尾是 rev ff,表示独显已经关闭。现在运行的是intel核显,这正是我们安装bumblebee目的。
    bumblebee的作用是禁用nvidia独立显卡,需要使用独显时,使用”optirun 程序名“手动开启nvidia来运行需要加速的程序,如optirun vmware。

    https://wiki.archlinux.org/index.php/Bumblebee
    https://wiki.archlinux.org/index.php/Bumblebee_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
    要使用 Bumblebee,请确保添加你的用户到 bumblebee 组:
    $  gpasswd -a svenaugustus bumblebee #gpasswd -a 您的用户名 bumblebee
    启用服务:

    systemctl enable bumblebeed.service

    重启
    测试 Bumblebee 是否工作:

    optirun glxgears -info

    如果一个内有动画的窗口出现,那么 Optimus 和 Bumblebee 正在工作。
    ------------------
    NVIDIA(0): Failed to assign any connected display devices to X screen 0
    如果终端输出如下:
    [ERROR]Cannot access secondary GPU - error: [XORG] (EE) NVIDIA(0): Failed to assign any connected display devices to X screen 0
    [ERROR]Aborting because fallback start is disabled.
    你要修改 /etc/bumblebee/xorg.conf.nvidia 里的这行:
    Option "ConnectedMonitor" "DFP"
    为:
    Option "ConnectedMonitor" "CRT"
    ------------------
    打开N卡设置:

    optirun nvidia-settings -c :8

    如果需要不依赖Bumblebee来使用CUDA, 为开启NVIDIA显卡,运行:

    sudo tee /proc/acpi/bbswitch <<< ON

    注意,重启完N卡又会回复关闭状态。

    4.时间和日期

    #如果安装的是双系统,注意Manjaro Setting Manager > Time and Date勾选以下选项
    --set time and date automatically
    --hardware clock in local time zone


    If you has Windows as well, please install NTP. http://www.satsignal.eu/ntp/setup.html
    Tips: NTP server ,please select your nearest country or region from the drop-down list.
    Here are some links in chinese: http://blog.csdn.net/aaazz47/article/details/78696899
    #如果你装了双系统,那么Windows系统需要装NTP同步为UTC时间,或者委屈Manjaro使用本地时间localtime。

    5.源镜像与系统更新

    #排列源

    sudo  pacman-mirrors -i -c China -m rank   #只留下清华源能令带宽跑满

    #同步并优化(类似磁盘整理,固态硬盘无需操作)$  sudo pacman-optimize && sync

    #增加archlinuxcn库和antergos库

    echo -e "
    [archlinuxcn]
    SigLevel = TrustAll
    Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
    
    [antergos]
    SigLevel = TrustAll
    Server = https://mirrors.tuna.tsinghua.edu.cn/antergos/$repo/$arch
    "|sudo tee -a /etc/pacman.conf

    #升级系统:

    sudo pacman -Syyu

    #安装archlinuxcn签名钥匙&antergos签名钥匙

    sudo pacman -S --noconfirm archlinuxcn-keyring antergos-keyring


    6.中文输入法

    #安装搜狗输入法#xfce桌面

    sudo pacman -S --noconfirm fcitx-im fcitx-configtool fcitx-sogoupinyin 

    #安装搜狗输入法#kde桌面

    sudo pacman -S --noconfirm fcitx-im kcm-fcitx fcitx-sogoupinyin 

    #配置fcitx

    sudo echo -e "export GTK_IM_MODULE=fcitx
    export QT_IM_MODULE=fcitx
    export XMODIFIERS=@im=fcitx">>~/.xprofile

    then restart.

    #fcitx的激活输入法方式改为ctrl+逗号,避免jetbrains系列快捷键冲突
    #额外的激活输入法快捷键禁用
    #输入法切换取消,上一页下一页改为逗号句号
    #在窗口间共享状态改为所有(所有的话就是windows的习惯)

    #对于jetbrians系列fcitx无法跟随的情况 fcitx输入法配置>附加组件>勾选高级>xim前端>勾选on the spot

    7.中文汉化

    #切换系统语言为中文,可以在登录界面右下角选择zh_CN.utf8然后重启
    login screen choose zh_CN.UTF8
    then restart.

    sudo pacman -S --noconfirm firefox-i18n-zh-cn thunderbird-i18n-zh-cn gimp-help-zh_cn libreoffice-still-zh-CN man-pages-zh_cn

    7-1.火狐汉化
    https://support.mozilla.org/en-US/kb/use-firefox-interface-other-languages-language-pack
    安装火狐汉化
    $  sudo pacman -S firefox-i18n-zh-cn
    在add-ons检查language是否已包含。如果已包含,在火狐浏览器中敲about:config然后回车。
    搜索intl.locale.requested
    如果没有那么右键new一个 键是 intl.locale.requested 值 是 zh_CN。
    最后重启Firefox,解决。

    8.中文字体

    https://wiki.archlinux.org/index.php/Arch_Linux_Localization_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#.E5.AE.89.E8.A3.85.E4.B8.AD.E6.96.87locale

    sudo pacman -S --noconfirm wqy-microhei && fc-cache -fv

    安装完可以 在"外观>字体"中设置应用程序的默认字体。
    可以在"QT5设置>字体"设置qt窗体的默认字体。
    还可以在各个应用程序中,如notepadqq中设置显示的字体。
    其他文泉驿家族:
    $  sudo pacman -S wqy-microhei-lite
    $  sudo pacman -S wqy-bitmapfont
    $  sudo pacman -S wqy-zenhei
    选用:
    $  sudo pacman -S adobe-source-han-sans-cn-fonts
    $  sudo pacman -S adobe-source-han-serif-cn-fonts
    $  sudo pacman -S noto-fonts-cjk

    9.AUR助手yaourt

    Manjaro有自己的图形化包管理器,pamac,当然也可以命令行使用archlinux系的,还有AUR助手 yaourt 更方便。

    Yaourt可用于查找软件包(包括[core] [extra] [community] AUR的软件包,pacman只能查找非AUR的软件包)。   已经过期。

    https://linux.cn/article-9925-1.html

    sudo pacman -S yay

    10.桌面菜单或启动器

    https://wiki.archlinux.org/index.php/Desktop_entries_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
    应用程序配置项,即 .desktop 文件是原信息资源和应用程序快捷图标的集合。
    系统程序的配置项通常位于 /usr/share/applications 或 /usr/local/share/applications目录,单用户安装的程序位于 ~/.local/share/applications 目录,优先使用用户的配置项。

    cd ~/.local/share/applications

    [Desktop Entry]
    Type=Application
    Version=1.0
    Name=IntelliJ IDEA
    Exec=/opt/ide/idea/bin/idea.sh
    Icon=/opt/ide/idea/bin/idea.png
    Terminal=false
    Categories=Development;Languages;Java;

    11.应用程序快捷键

    可以给软件设置热键,比如截图
    在键盘–应用程序快捷键
    选择添加,命令:里输入xfce4-screenshooter -f
    点击确定,弹出快捷键确认,按下Print
    再次点击确定。
    在需要截图的时候,按下Print
    就可以截图

    #xfce默认快捷键盘修改(键盘)
    打开启动器菜单(类似windows的开始) >设置>键盘> xfce4-popup-whiskermenu  > super+退出(Esc)
    打开文件管理器:系统工具>设置>键盘> exo-open --launch FileManager  >  super+F
    打开邮件客户端:系统工具>设置>键盘>exo-open --launch MailReader  >  super+M
    打开默认浏览器:系统工具>设置>键盘> exo-open --launch WebBrowser    >  super+W
    打开应用程序查找器:系统工具>设置>键盘> xfce4-appfinder --collapsed  > super+R
    打开任务管理器:系统工具>设置>键盘>  xfce4-taskmanager  > super+K
    打开显示/分辨率设置:系统工具>设置>键盘> xfce4-display-settings  -minimal  > super+P
    打开下拉终端:系统工具>设置>键盘> xfce4-terminal --drop-down  > super+N
    打开模拟终端:系统工具>设置>自定义快捷键> exo-open --launch TerminalEmulator  > super+T

    截图:系统工具>设置>键盘>自定义快捷键>xfce4-screenshooter -f > Print
    截图:系统工具>设置>键盘>自定义快捷键>deepin-screenshot>super+A

    #xfwm4默认快捷键盘修改(窗口管理器)
    显示桌面:改为 Super + D
    Ctrl + F1 .... F12 删除 清除不需要的,以防止与Jetbrains等IDE开发工具快键键冲突。
    Ctrl+Alt+上下左右 清除,暂时不需要,以防止与Jetbrains等IDE开发工具快键键冲突。
    Alt+insert、delete 清除,暂时不需要,以防止与Jetbrains等IDE开发工具快键键冲突。

    12.快速设置

    #系统全面更新

    sudo pacman -Syyu --noconfirm

    #登录后开启数字锁

    yay -S --noconfirm systemd-numlockontty&&sudo systemctl enable numLockOnTty.service

    #文件管理器(可选)
    ###for xfce

    yay -Sy --noconfirm  nemo nemo-fileroller && gsettings set org.cinnamon.desktop.default-applications.terminal exec xfce4-terminal

    nemo  一款很不错的文件管理器,某程度比 thunar 更好用。

        wiki : https://wiki.archlinux.org/index.php/Nemo
    nemo-fileroller 增加fileroller,nemo提供解压,压缩的菜单。

    #安装常用软件

    yay -Sy --noconfirm netease-cloud-music smplayer smplayer-skins smplayer-themes google-chrome sublime-text-dev-zh-cn masterpdfeditor remarkable uget filezilla deepin-screenshot shutter

    netease-cloud-music 网易云音乐;
    smplayer 视频播放器;
    google-chrome 谷歌浏览器;
    notepadqq 像notepad++文本编辑;
    sublime-text-dev-zh-cn 强大的开发必备文本编辑器;(有能力采用付费许可证)
    masterpdfeditor 对linux用户免费的PDF浏览及编辑器,支持实时预览;
    remarkable 卓越且功能齐全的 Markdown 编辑器;
    uget 媲美迅雷的下载工具;
    filezilla 强大的FTP工具;
    deepin-screenshot 深度截图工具;
    shutter 强大的截图工具,gnome-web-photo配合使用;
    variety 随即更换壁纸的应用;
    ccal 终端农历日历,终端启动ccal;

    yay -Sy --noconfirm bleachbit redshift 

    bleachbit 快速释放磁盘空间并不知疲倦地守卫你的隐私。释放缓存,删除 cookie,清除互联网浏览历史,清理临时文件,删除日志,以及更多功能...
    i-nex 小而全的系统信息查看软件;
    redshift 根据你的周边调整你屏幕的色温。当你夜晚在屏幕前工作时,它也许能帮助你减少对眼睛的伤害;

    yay -Sy --noconfirm keepassx-git screenfetch-git freefilesync #需要网络git

    keepassx-git 密码管理器;
    screenfetch-git  系统信息工具,终端使用screenfetch命令;
    freefilesync 文件夹比较和同步工具;

    #生产力

    yay -Sy --noconfirm wiznote meld goldendict easystroke catfish peek

    wiznote 为知笔记;
    meld 文本比较;
    goldendict 词典软件;
    easystroke 鼠标手势;
    catfish 基于GTK+的非常快速,轻量级的文件搜索工具;
    peek 屏幕录像工具,小巧玲珑,可保存录像为gif动图和兼容于html5的webm视频;

    yay -Sy --noconfirm xmind  #需要网络

    xmind 跨平台的思维导图工具,关键还是可以导入MindManage的文件;

    #编程开发

    yay -Sy --noconfirm eclipse-jee jetbrains-toolbox openjdk8-doc openjdk8-src dbeaver dbeaver-plugin-apache-poi dbeaver-plugin-batik dbeaver-plugin-office 

    eclipse-jee 企业Java 集成开发环境;
    jetbrains-toolbox 著名的jetbrains序列的IDE管理工具;
    openjdk8-doc openjdk8-src 针对OpenJDK8的文档和源码;
    dbeaver 通用数据库客户端,支持多个平台及多种数据库,社区版是免费的; 

    yay -Sy --noconfirm codeblocks qtcreator glade glade-gtk2 kompozer kompozer-i18n-zh-cn

    codeblocks 跨平台的C++ IDE,官方网站上称其能满足最苛刻的用户的需求。'
    qtcreator 基于QT的C++开发工具(包括界面设计);
    glade基于GTK3 的C++开发工具(包括界面设计);
    glade-gtk2基于GTK2 的C++开发工具(包括界面设计);
    kompozer 类似Dreamweaver所见即所得功能的开源HTML编辑器。

    yay -Sy --noconfirm soapui #需要网络
    yay -Sy --noconfirm nginx tomcat8 zookeeper

    dbeaver 通用数据库客户端,支持多个平台及多种数据库,社区版是免费的;
    nginx 终端执行 sudo nginx 启动,sudo nginx -s stop/realod 停止或重启;
    tomcat8 开发必备,轻量的应用服务器;
    zookeeper 终端执行sudo zkServer.sh start 启动;

    #有意思

    yay -Sy --noconfirm cmatrix geogebra stellarium celestia

    cmatrix 终端从上往下输出无尽的字符串,类似<<黑客帝国>>中的矩阵效果,终端运行 cmatrix ;
    geogebra 图形计算器,支持函数,几何,代数,微积分,统计以及 3D 数学。
    stellarium 星象软件。可调选项很多,这是随便开起来截图的。
    celestia 免费的空间模拟器,让你在三维空间中探索我们的宇宙;
    gnucash 开源免费的个人或小型企业财务软件;
    gramps 家谱软件;

    #游戏

    yay -Sy --noconfirm nethack gnome-mines 2048-qt zaz

    nethack 经典的命令行游戏,启动命令行nethack;
    gnome-mines 经典的扫雷游戏(gnome桌面自带,kde也有类似的kmines);
    2048-qt 经典的2048游戏;
    zaz 经典的泡泡射击游戏;

    yay -Sy --noconfirm sudokuki wesnoth wesnoth-data 0ad

    sudokuki 基于Java的跨平台的数独游戏(https://sourceforge.net/projects/sudokuki/files/sudokuki/);
    wesnoth 经典的韦诺之战,Linux上比较火的游戏,回合制策略游戏;
    0ad 跨平台的“帝国时代”(http://sourceforge.net/projects/zero-ad/files/releases/locales/下载对应版本的汉化放到$HOME/.local/share/0ad/mods/public/);

    #虚拟机(全面更新系统重启后最后安装)

    sudo pacman -Sy virtualbox linux414-virtualbox-host-modules virtualbox-ext-oracle

    virtualbox 虚拟机工具,linux首选,比vmware还好用。

        https://wiki.manjaro.org/index.php?title=Virtualbox
    linux414-virtualbox-host-modules  根据安装的内核版本选择,比如有 uname -r 如果是4.14内核,则安装 linux414-virtualbox-host-modules ;

    #展示Linux系统信息(装逼)

    screenfetch

    by 斯武丶风晴  https://my.oschina.net/langxSpirit

    还可以看看这篇文章:https://blog.tshine.me/manjaro-install-and-setup.html

  • 相关阅读:
    RocketMQ中Producer消息的发送源码分析
    VS等待调试
    Window&Linux遍历某一文件夹
    遍历当前USB设备信息
    批处理常用符号详解
    Windows 批处理(bat)语法大全
    Windows CMD命令大全(值得收藏)
    遍历文件夹
    ASCII,UTF-8,Unicode字符串相互转换
    shellexecute的使用和X64判断
  • 原文地址:https://www.cnblogs.com/jpinsz/p/12348000.html
Copyright © 2011-2022 走看看