一、更新源的配置:
1)、自動方法:
在 終端 執行下面的arch" style="color: #002be5">命令從官方的源列表中對中國源進行測速和設置
sudo pacman-mirrors -c China
2)、手動方法
自動方法(上面的方法1,自動測速)的源ping雖然低但是更新時不是很穩定,下載速度忽高忽低,所以也可以用下面的方法手動指定想要使用的源。
創建一個名為 /etc/pacman.d/mirrors/Custom
的文件,並在里面加入:
##
## Pacman Mirrorlist
##
[Custom]
Server = http://mirrors.tuna.tsinghua.edu.cn/manjaro/stable/$repo/$arch Server = https://mirrors.ustc.edu.cn/manjaro/stable/$repo/$arch # 目前中國有四個源我去除了兩個實際速度不加的,查看官方的源列表 http://repo.manjaro.org/ # 可以加入其它的軟件源,格式與這個類似。
保存后接着編輯 /etc/pacman-mirrors.conf
,使 pacman-mirrors 只對這個文件列出的鏡像站進行排行:
如果需要關閉測速則進一步修改
保存后終端執行
linux-cn源" class=" sm_bf" style="color:#000000;font-weight:700;margin:5px 0px;">二、額外增加Arch Linux CN源
Manjaro是基於Arch的,而AUR是Arch社區用戶維護的軟件包(也是arch可用軟件量巨大的所在),我們等下要安裝的搜狗拼音、chrome等不少軟件都在這里維護。不過網慢啊~!所以我們可以為Manjaro增加這個中文社區的源來方便我們安裝一下軟件。
在 /etc/pacman.conf
文件末尾添加行:
然后安裝 archlinuxcn-keyring 包以導入 GPG key,否則的話key驗證失敗會無法安裝的。
下面是網上抄來的添加中科大源的方法:
#先排列源sudo pacman-mirrors -g
#同步並優化(類似磁盤整理,固態硬盤無需操作)sudo pacman-optimize&& sync
#升級系統 (根據自己需要決定運行否)sudo pacman -Syyu
添加中科大源
#打開配置文件sudo nano /etc/pacman.conf
在文件末尾添加
#導入GPG Key
現在可以安裝軟件了,比如 chrome 和搜狗拼音輸入法
#安裝chromesudo pacman -S google-chrome
添加了中科大源后,也可以直接在添加/刪除軟件里搜索直接安裝
安裝搜狗拼音輸入法
#添加輸入法配置文件sudo pacman nano ~/.xprofile
添加以下內容
archlinux 的自啟動:
1,一般情況下新建一個 ~/.xprofile
文件然后在里面加入命令就可以了。注意該文件是由 GDM/KDM/startx 等呼叫起來的,里面的命令執行完畢之后控制權會交回給 GDM/KDM/startx。
2,.xinitrc/.xsession 就比較特殊了,雖然也可以在里面放置需要啟動時執行的命令,且也是由 由 GDM/KDM/startx 等呼叫起來的,但是這些命令執行之后控制權無法回到 GDM/KDM/startx。因此你需要在這些文件的末尾放置: exec $(get_session) 或 exec gnome-session
或 exec startkde
或 exec enlightenment
或 exec icewm
之類的。
3,所有linux發行版的自啟動文件測試:
把這三個文件 (如果有的話) 先備份起來, 然后建立一個測試用的 .xprofile, 里面放一句:
(echo -n "$0 is called at " ; date) >> ~/startup.log
這句話是打印出自己的名字(即$0)及被執行的時間,並寫入到log文件里。注意有些系統需要文件的可執行屬性,記得修改下,即 chmod u+x .profile。 然后重啟或注銷再登錄,檢查 ~/startup.log的內容。然后把 .xprofile 改名為 .xinitrc,記得在最后加上一句 exec $(get_session) ,再次重啟、再登錄,檢查 startup.log。最后把 .xinitrc 改成 .xsession, 重啟、登錄,檢查 startup.log。 警告,.xinitrc 及 .xsession 必須加上 exec $(get_session),如果忘記加或者加錯了,則無法進入桌面視窗,會立即退回到登錄界面。 這是需要按 ctrl-alt-f6 切換到文字模式,然后刪除 .xinitrc / .xsession 或者把他們的最后那句寫對,就可以繼續登錄桌面視窗了。 這中方法可以對所有linux發行版的自啟動文件進行測試,看哪個文件可以加入自啟動命令。
manjaro 安裝 virtualbox 的方法:
1, 因為 virtualbox 有模塊要安裝到內核里面,你需要知道你當前的內核版本:
uname -r
,比如輸出了v4.14.20-2-MANJAROv
那么你的內核版本為414。
2, 然后運行:
安裝完成后重啟 virtualbox 或者 直接重啟機器,以下命令是重啟 virtualbox:
3, 安裝擴展包,以下命令可以查看或者安裝擴展包的名字:
如果以上命令沒有安裝,你可以去官網下載對應的擴展包。然后安裝如下過程安裝:
3.1, 以sudo 方式運行 virtualbox, 從菜單選擇 File -> Preference, 選擇 Extension tab, 然后 點擊 Add Package, 安裝剛才下載的擴展包。
4, 將當前登錄用戶加入 vboxusers 組:
5, 如果你使用了多個內核, (使用單內核的請忽略這一步):
5.1, 如果安裝virtualbox時是單內核,即多內核是在安裝 virtualbox 之后才加入的,那么沒必要再重新安裝 vritualbox 及其擴展包了,因為 manjaro 會自動探測到已安裝的模塊,然后在新的內核中自動添加。
5.2, 如果你安裝 virtualbox 之前就已經是多內核了,則:
5.2.1. Select the appropriate kernel at the bootup screen
5.2.2. Download the VirtualBox Host Utilitiesfor that particular kernel, as this provides the necessary vboxdrvVirtualBox module to add. The syntax of the command to do so is:
sudo pacman -S [kernel version]-virtualbox-host-modules
When listing the kernel version currently being used in the command, it is not necessary to write the entire version number. Any version of Kernel 3.5 can be listed simply as 'linux35', and any version of Kernel 3.6 can be listed as 'linux36', and so on. As an example, the following command will install the VirtualBox Host Utilitiesspecifically for kernel version 3.5:
sudo pacman -S linux35-virtualbox-host-modules
5.2.3. Once the VirtualBox Host Utilitieshave been downloaded, enter the following command to add the VirtualBox module to the kernel:
sudo modprobe vboxdrv
VirtualBox 安裝 ArchLinux 的 guest 增強功能的方法:
網上說 manjaro 會自動安裝上 virtualbox 的 guest 增強功能,請自行檢查,如果沒有安裝上,請以如下方式安裝:
當用VirtualBox安裝ArchLinux時(即ArchLinux作為guest),啟用增強功能的方式與其他Linux有所區別,在ArchLinux需要不必采用附加鏡像安裝增強功能的方式,而是直接安裝官方倉庫中的virtualbox-guest-modules包即可,如過需要增強功能隨着內核升級而動態更新則需要安裝dkms服務,執行以下命令完成增強功能的安裝:
# pacman -S virtualbox-guest-modules virtualbox-guest-dkms
當增強功能安裝完成后,需要啟動對應的內核模塊:
# modprobe -a vboxguest vboxsf vboxvideo
之后還需要運行VirtualBox客戶端腳本確保相關特性全部開啟:
# VBoxClient-all
如果經常使用增強功能,則可以開啟服務:
# systemctl enable vboxservice
然后就可以嘗試掛載你的分區了:
# mount -t vboxsf [你的共享文件夾的名字] [需要掛載到的位置]
archlinux 啟動 sshd
首先檢查是否安裝了它,直接在命令行敲 sshd 看看有沒有這個命令,沒有則安裝它:
然后運行:
則可以將sshd運行起來。
manjaro 禁止開機啟動 bluetooth:
systemctl list-unit-files --type=service | grep enabled # lists of enabled services
sudo systemctl stop bluetooth.service # stops the service
sudo systemctl disable bluetooth.service # disables service from loading at boot
systemctl status bluetooth.service # verify that service got disabled
arch" style="color: #002be5">sudo systemctl mask bluetooth.service # if you really want it dead (so other services can’t start it again)
systemctl list-unit-files --type=service # lists of ALL services (some STATIC are dependancies of other services and can’t be disabled)
備注:有些進程/服務,如果你不將它們進行mask,即使被disable了,也有可能被其它進程再次啟動起來。
manjaro 設置 fcitx 輸入法:
1、設置它只有在使用額外切換鍵隱藏輸入法后,才可以再使用額外切換鍵將其喚醒:
直接運行 fcitx-configtool 即可進行圖形界面配置。
然后查看 .config/fcitx/config 里的相應值是否已經改變,然后立即手動將 .config/fcitx/config 和 .config/fcitx/profile 的所有寫屬性去掉,即 chmod a-w .config/fcitx/config; chmod a-w .config/fcitx/profile;