Manjaro linux 설치 및 설정

Arch linux 기반 배포판. Manjaro linux 설치 및 설정.


Gentoo기반의 Sabayon 리눅스에서 Asus ux31a의 무선랜을 못 잡는다.
여러 시도를 해보다가 안되서 다른 걸로 갈아타려고 여러 리눅스 배포판을 기웃거렸다.
봐도 봐도 끌리는 건 FreeBSD기반의 GhostBSD와 Arch 기반 Manajro다.
안써본 GhostBSD를 써보려고 이리저리 시도해 봤지만 아쉽게도 ux31과 궁합이 안 맞는지 설치가 되지 않는다.
그래서 결국 익숙한 Manjaro linux를 깔았다.
Ubuntu 보다 민첩하고, gentoo보다 편리한 Manjaro.
나와 궁합이 잘 맞는다.
Arch linux를 별다른 설정 없이 편리하게 사용하도록 만든 Manjaro linux.
그러나 내게 맞는 환경을 만들기 위해선 여기저기 손봐야 할 곳이 많다.
이게 시간이 꽤 걸리는 일이라, 나중을 위해 지금 리눅스 환경을 정리했다.
앞으로 한동안은 OS를 다시 설치할 일이 없겠지만,
재앙은 예고 없이 찾아오는 법이니까.


배포판 이미지 받기

http://sourceforge.net/projects/manjarolinux/files


부팅 가능한 USB 만들기

http://sourceforge.net/projects/manjarolinux/files
UNetbootin(http://unetbootin.sourceforge.net/) - linux,mac,windows
Pendrivelinux(http://www.pendrivelinux.com/) - windows
Image Writer for Windows(https://launchpad.net/win32-image-writer) - windows
http://en.wikipedia.org/wiki/List_of_tools_to_create_Live_USB_systems


USB로 설치.

이미 리눅스 시스템을 사용중인 Encrypt된 파티션을 가진 SSD에 UEFI를 지원하도록 설치.
1. 터미널 실행.
2. Encrypt된 파티션 열기
cryptsetup luksOpen /dev/sdx cryptVG
3. root파티션 포멧하기
mkfs ext4 /dev/mapper/cryptVG-root-partition-name
4. GUI모드로 설치 시작
5. 파티션 설정
* /swap : 없음.
* /boot : ext4
* /boot/efi : vfat
* /root : ext4 (위에서 포멧한 파티션)
* /home : ext4 (포멧하지 않고 마운트만)
6. 설치 진행
7. 설치가 완료되면, 터미널 실행.
8. 설치된 시스템 루트로 chroot
mount -o bind /proc /mount-point-of-installed-root/proc
mount -o bind /dev /mount-point-of-installed-root/dev
mount -o bind /sys /mount-point-of-installed-root/sys
chroot /mount-point-of-installed-root /bin/bash

9. /etc/mkinitcpio.conf 파일에서 HOOKS의 filesystems 앞에 encrypt lvm2 추가.
예시 : HOOKS="base udev autodetect modconf block encrypt lvm2 filesystems keyboard keymap fsck"
10. mkinitcpio 설정 적용.
mkinitcpio -p linux
11. /etc/default/grub 파일에서 GRUB_CMDLINE_LINUX_DEFAULT 옵션 변경
libata.force=noncq : SSD성능 향상,응답 중단 방지 (The libata.force=noncq parameter will prevent SSD lockups and the rootflags option is used for SSD-performance.)
acpi_osi : ux31a에서 기능키 사용
cryptdevice : Encrypt된 파티션 정보
noapic : 인텔의 Advanced Programmable Interrupt Controller를 사용하지 않는다.
acpi=force : acpi를 바이오스 버전에 관계 없이 켠다.
예시 : GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=/dev/sda3:cryptVG quiet libata.force=noncq acpi_osi='!Windows 2012' noapic acpi=force"
12. Grub 설정 적용.
grub-mkconfig -o /boot/grub/grub.cfg
sudo update-grub
13. 재부팅
14. USB 제거


fstab 설정

ssd를 사용할 경우 파티션에 defaults,noatime,discard를 붙인다.
/etc/fstab
tmpfs /dev/shm tmpfs defaults,noatime 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777,size=4G 0 0
tmpfs /scratch tmpfs noatime,nosuid,nodev,mode=1777 0 0



로케일 설정

https://wiki.archlinux.org/index.php/locale

/etc/locale.gen
ko_KR.UTF-8 UTF-8
en_GB.UTF-8 UTF-8
es_ES.UTF-8 UTF-8
ja_JP.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8


/etc/locale.conf
LANG=ko_KR.UTF-8
LANGUAGE="ko_KR.UTF-8:es_ES.UTF-8:en_GB.UTF8:en"
LC_COLLATE=ko_KR.UTF-8
LC_CTYPE=ko_KR.UTF-8
LC_MONETARY=ko_KR.UTF-8
LC_NUMERIC=ko_KR.UTF-8
LC_TIME=ko_KR.UTF-8
LC_PAPER=ko_KR.UTF-8
LC_MESSAGES=en_GB.UTF-8


~/.config/locale.conf
LANGUAGE="ko_KR.UTF-8:es_ES.UTF-8:en_GB.UTF8:en"
LANG="ko_KR.UTF-8"
LC_COLLATE=ko_KR.UTF-8
LC_CTYPE=ko_KR.UTF-8
LC_MONETARY=ko_KR.UTF-8
LC_NUMERIC=ko_KR.UTF-8
LC_TIME=ko_KR.UTF-8
LC_PAPER=ko_KR.UTF-8
LC_MESSAGES=en_GB.UTF-8


sudo locale-gen


Pacman 업데이트

pacman
pacman -Syy
pacman -Syu



Manjaro 커널 업데이트

http://wiki.manjaro.org/index.php/Manjaro_Kernels
mhwd-kernel -li
sudo mhwd-kernel -i linux313 rmc



한글 관련 설정


UIM 설정

sudo pacman -S uim

Applications Menu > settings > input method

Global settings
check Specify default IM
Default input method Byeoru
Enable input methods Byeoru only.
Uncheck Enable IM switching by hotkey.
Uncheck Enable input method toggle by hot keys.

Byeoru key bindings 1
Add hangul key to Byeoru on, Byeoru off

~/.xprofile에 IM설정
IM="uim"
export GTK_IM_MODULE=$IM
export XMODIFIERS=@im=$IM
export QT_IM_MODULE=$IM
export XIM=$IM

한글폰트 설치

yaourt -S ttf-alee
yaourt -S xfonts-baekmuk
yaourt -S ttf-unfonts-core
yaourt -S ttf-unfonts-extra
yaourt -S ttf-nanum
yaourt -S ttf-nanumgothic_coding


PDF 한글 나오도록 poppler(PDF rendering library)설치

sudo pacman -S poppler
sudo pacman -S poppler-data

; pdf뷰어 epdfview 설치
sudo pacman -S epdfview

VLC 한글 설정

Pereference -> Subtitles / OSD -> Default encoding 을 Korean(EUC-KR/CP949)로 변경하고 플레이어를 다시 시작한다.


watchdog(프로세스가 죽으면 자동 재시동) 설정

/etc/systemd/system.conf
#RuntimeWatchdogSec=0
RuntimeWatchdogSec=30



어플리케이션 설치


개발용

pacman -S ruby
pacman -S git
pacman -S openssh
pacman -S mariadb
pacman -S apache
pacman -S mod_wsgi2
yaourt -S jdk

nodejs

git clone git://github.com/creationix/nvm.git ~/.nvm
printf "\n\n# NVM\nif [ -s ~/.nvm/nvm.sh ]; then\n\tNVM_DIR=~/.nvm\n\tsource ~/.nvm/nvm.sh\nfi" >> ~/.bashrc
NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
nvm install v0.10.25
nvm alias default 0.10
nvm use 0.10

권한 설정
sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` ~/node_modules
sudo chown -R `whoami` /usr/lib/node_modules


루비 경로 설정

~/.xprofile
export PATH=$PATH:~/.gem/ruby/2.1.0/bin:

gvim 설치

pacman -S gvim
플러그인 설치
vim-colorsupport https://aur.archlinux.org/packages/vim-colorsupport/
Vundle vundle-git https://github.com/gmarik/Vundle.vim
NERDTree vim-nerdtree-git https://github.com/scrooloose/nerdtree
ctrip https://github.com/kien/ctrlp.vim
Syntastic vim-syntastic https://github.com/scrooloose/syntastic
EasyMotion vim-easymotion https://github.com/Lokaltog/vim-easymotion

.vimrc
vmap "+yi
vmap "+c
vmap c"+p
imap +
syntax on
set wrap
set linebreak
" set spell spelllang=en_GB "
map :set spell! spelllang=en_GB
map :set guioptions-=m:set guioptions-=r:set guioptions-=l:set guioptions-=L:set guioptions-=T:redraw!
map :set guioptions+=m:set guioptions+=r:set guioptions+=l:set guioptions+=L:set guioptions+=T:redraw!
nnoremap
set runtimepath^=~/.vim/bundle/ctrlp.vim
colors koehler


disable USB autosuspend

vim /etc/laptop-mode/conf.d/usb-autosuspend.conf
CONTROL_USB_AUTOSUSPEND="0"


시스템 커멘드라인 유틸리티

pacman -S ack
pacman -S ncdu
pacman -S fdupes


GUI 유틸리티

pacman -S transmission-gtk
pacman -S filezilla
pacman -S stardict
pacman -S xfce4-weather-plugin
pacman -S gnumeric
pacman -S deadbeef
pacman -S virtualbox
pacman -S virtualbox-guest-modules
pacman -S wine
pacman -S wine_gecko
pacman -S chromium
pacman -S qupzilla
pacman -S thunderbird
pacman -S tomboy
pacman -S festival
yaourt -S marble
yaourt -S gmapcatcher
yaourt -S xnviewmp


화면잠금

yaourt -S xfce-slimlock
이미지 폴더 : /usr/share/slim/themes/default

눈 피로를 덜어주는 Redshift

https://wiki.archlinux.org/index.php/Redshift
pacman -S redshift

focuswriter

qt5로 설치시 uim에서 한글 입력이 안되므로 PKGBUILD에서 depends를 qt4로 변경한다.
# Maintainer: Graeme Gott

pkgname=focuswriter
pkgver=1.4.5
pkgrel=1
pkgdesc="A simple fullscreen word processor"
arch=('i686' 'x86_64')
url="http://gottcode.org/${pkgname}/"
license=('GPL3')
#depends=('qt5-base' 'qt5-multimedia' 'enchant' 'libzip')
depends=('qt4' 'enchant' 'libzip')
install=${pkgname}.install
source=(http://gottcode.org/${pkgname}/${pkgname}-${pkgver}-src.tar.bz2)
md5sums=('42b14c9357e5b33d55ddbdb3a97e6af1')
sha256sums=('4fb4d826493b2a8a420762b67c74659574092b641f55442e74a292b6ef5e36f2')

build() {
cd "${srcdir}/${pkgname}-${pkgver}"
#qmake-qt5 PREFIX=/usr
qmake-qt4 PREFIX=/usr
make
}

package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make INSTALL_ROOT="${pkgdir}/" install
}


yaourt 설정

~.yaourtrc

yaourt 패키지 업데이트

yaourt -Syua

chrome 설정

https://wiki.archlinux.org/index.php/chromium

chrome 관련 url 보기
chrome://chrome-urls

chrome://flags
Override software rendering list - Enable
Disable accelerated 2D canvas -Enable
Enable WebGL Draft Extensions - Disable
Enable Developer Tools experiments - Enable

실행 옵션
chromium --disk-cache-dir=/scratch/psd --scroll-pixels=320 --disable-accelerated-compositing --cipher-suite-blacklist=0x0001,0x0002,0x0004,0x0005,0x0017,0x0018,0xc002,0xc007,0xc00c,0xc011,0xc016,0xff80,0xff81,0xff82,0xff83

플래쉬 플레이어 설치
yaourt -S chromium-pepper-flash
chrome://plugins 에서 adobe flash player서 기본 flash player disable

프로파일 클리너 설치
sudo yaourt -S profile-cleaner

profile sync daemon 활성화
https://wiki.archlinux.org/index.php/Chromium_tweaks
https://wiki.archlinux.org/index.php/Profile-sync-daemon

yaourt -S profile-sync-daemon

/etc/psd.conf
USERS="dorajistyle"
BROWSERS="chromium firefox qupzilla"
VOLATILE="/scratch"


sudo systemctl enable psd psd-resync


xfce 테마 설정


메뉴 고급 설정

yaourt -S xfce4-whiskermenu-plugin
panel > Items / Window Buttons - Show flat buttons 활성

테마 관련 파일 경로

  • 폰트 : ~/.font
  • 아이콘 : ~/.icons
  • 테마 : ~/.themes

테마 설치

yaourt -S xubuntu-artwork
yaourt -S xfce4-xquisite-icon-theme
yaourt -S xfce4-finalorder-icon-theme
yaourt -S xfce-theme-simplix
yaourt -S zen-gtk-themes


simpliX 테마 설치

  • chrome용 : crx file 을 extension로 드래그
  • 파이어폭스용 :~/.mozilla/firefox/profile.default/chrome/userChrome.css 복사

폰트 렌더링 설정

~/.config/fontconfig/fonts.conf

true
true
hintslight


키보드 단축키

  • super b
    chromium --disk-cache-dir=/scratch/psd --scroll-pixels=320 --disable-accelerated-compositing --cipher-suite-blacklist=0x0001,0x0002,0x0004,0x0005,0x0017,0x0018,0xc002,0xc007,0xc00c,0xc011,0xc016,0xff80,0xff81,0xff82,0xff83
  • super =
    deadbeef
  • super f
    firefox
  • super g
    qupzilla
  • super i
    ~/XnView/xnview.sh
  • super backspace
    leafpad ~/work/article/notes/note.txt
  • control alt del
    slimlock
  • super d
    stardict
  • super n
    tea
  • super e
    thunar
  • super m
    thunderbird
  • super q
    /usr/bin/focuswriter
  • super c
    /usr/bin/qalculate-gtk
  • super t
    /usr/bin/xfce4-taskmanager
  • super y
    /usr/bin/xsensors
  • super p
    xfce4-display-settings --minimal
  • ctrl print (region)
    xfce4-screenshooter
  • alt print (window)
    xfce4-screenshooter -w
  • print
    xfce4-screenshooter -r
  • super s
    xfce4-terminal
  • super v
    gvim
  • ctrl alt x
    xfce4-session-logout

HDMI와 노트북 모니터 동시에 켜기

루트 유저로 다음 파일을 추가한다.
/usr/local/share/hdmi-plugged-startup
#!/bin/bash

export XAUTHORITY=/home/$USER/.Xauthority
export DISPLAY=:0

/usr/bin/xrandr -display :0 --output eDP1 --auto --output HDMI1 --auto --above eDP1


이 파일을 실행 가능하게 만든다.
chmod +x /usr/local/share/hdmi-plugged-startup
And add the following udev rule:
다음 udev rule을 추가한다.
echo 'ACTION=="change", SUBSYSTEM=="drm", RUN+="/usr/local/share/hdmi-plugged-startup"' >> /etc/udev/rules.d/10-local.rules

특정 디렉토리에서 Shell 띄우기

bash -c 'cd ~/specific/dir; exec "/bin/bash"'

문제 해결

Pacman이나 Yaourt로 패키지 설치시 error: failed to commit transaction (conflicting files)

pacman -S --force $package

재부팅을 하면 화면이 제대로 동작하지 않고, /usr/local/share/hdmi-plugged-startup를 실행하면 아래의 오류가 날 때.

No Protocol specified
Error cannot open display :0.0
echo $HOSTNAME 으로 호스트 이름을 확인한다.

/etc/NetworkManager/NetworkManager.conf 파일을 열어 다음을 추가한다.
[keyfile]
hostname=<your_hostname>

xhost 권한 추가.
xhost +SI:localuser:<user>

NTFS 파티션 마운트 오류 해결

pacman -S ntfs-3g
ntfsfix /dev/ntfs-partition-name


USB를 Fat32로 포멧

pacman -Sy dosfstools
fdisk -l
mkdosfs -F 32 -I /dev/usb-partition-name


외장 디스크가 readonly로 뜰 때

sudo su -
df -Th
umount /media/mounted-name
dosfsck -a /dev/partition-name


bash: fork: retry: No child processes

/etc/security/limits.conf 파일에 다음 추가
username soft nofile 4096
username hard nofile 65536

/etc/sysctl.d/99-sysctl.conf 파일에 다음 추가
fs.inotify.max_user_watches = 20000
fs.file-max = 800000

현재 쉘 세션에서만 임시로 open files 크기를 늘려줄 때는 아래 명령어를 실행
ulimit -n 4096


X server가 실행되지 않을 때

mhwd 로 다른 그래픽 드라이버를 제거한 후, 사양에 맞는 드라이버를 재설치

mhwd -r pci video-nvidia
mhwd -r pci video-intel
mhwd -r pci video-hybrid-intel-nvidia-bumblebee
mhwd -i -f pci video-hybrid-intel-nouveau-bumblebee

https://forum.manjaro.org/index.php?topic=10120.0
https://forum.manjaro.org/index.php?topic=76.0

Asus ux31a 관련

https://wiki.archlinux.org/index.php/ASUS_Zenbook_Prime_UX31A
https://wiki.debian.org/InstallingDebianOn/Asus/UX31a
https://help.ubuntu.com/community/AsusZenbookPrime#Optimizing_for_SSD
http://community.linuxmint.com/tutorial/view/1366
https://wiki.archlinux.org/index.php/Solid_State_Drives#Advantages_over_HDDs
https://wiki.archlinux.org/index.php/ASUS_Zenbook_Prime_UX31A#HDMI_plugged_at_boot



by


Tags : , , , , , , , ,

  • 재미있게 읽으셨나요?
    광고를 클릭해주시면,
    블로그 운영에 큰 도움이 됩니다!