Difference between revisions of "Beginners' Guide/Installation (한국어)"
m |
|||
Line 13: | Line 13: | ||
[[sr:Beginners' Guide/Installation]] | [[sr:Beginners' Guide/Installation]] | ||
[[zh-CN:Beginners' Guide/Installation]] | [[zh-CN:Beginners' Guide/Installation]] | ||
− | {{ | + | {{도움말|이 문서는 초보자 안내서 전체 문서의 일부입니다. 초보자 안내서 전체를 보려면 '''[[Beginners' Guide (한국어)|여기]]'''를 클릭하십시오.}} |
</noinclude> | </noinclude> | ||
==설치하기== | ==설치하기== |
Revision as of 04:06, 30 July 2012
zh-CN:Beginners' Guide/Installation
Contents
- 1 설치하기
- 1.1 키맵 변경하기
- 1.2 라이브 설치 환경에서 네트워크 설정하기
- 1.3 하드디스크 준비하기
- 1.4 블록 디바이스, 파일시스템, 마운트 지점 설정하기
- 1.5 파티션 마운트하기
- 1.6 미러 사이트 선택하기
- 1.7 기본 시스템 설치하기
- 1.8 부트로더 설치하기
- 1.9 fstab 생성하기
- 1.10 시스템에 chroot로 들어가기
- 1.11 시스템 설정하기
- 1.12 Configure the network
- 1.13 Create an initial ramdisk environment
- 1.14 Configure the bootloader
- 1.15 Root password
- 1.16 Unmount the partitions and reboot
설치하기
부팅 후에는 설치 미디어에서 자동으로 root로 로그인되며 US 키보드 레이아웃을 사용합니다.
키맵 변경하기
US와 호환되지 않는 키보드 레이아웃을 사용할 경우 다음 명령어를 이용해 대화형으로 키맵과 콘솔 폰트를 지정할 수 있습니다.
# loadkeys layout
여기서 layout은 fr
, uk
혹은 be-latin1
와 같은 여러분 키보드의 레이아웃을 뜻합니다.
키맵은 여러 나라나 키보드 타입에 대해 제공됩니다. 키맵 파일은 /usr/share/kbd/keymaps/
내에서 찾을 수 있습니다 (you can omit the keymap path and file extension when using loadkeys
).
라이브 설치 환경에서 네트워크 설정하기
유선 네트워크 설정하기
여러분의 컴퓨터가 이더넷 네트워크에 연결되어 있다면 이 절차를 따르십시오.
유동 IP (DHCP)
유선 인터넷 연결을 하면서 DHCP서버에 접속(예를 들어 라우터를 사용하는 경우)한다고 가정하고,
# dhcpcd
를 실행하여 IP를 얻으십시오.
이더넷 카드가 여러 개 있는 등 여러 가지 인터페이스가 있는 경우, dhcpcd <interface>
로 다음과 같이 특정 인터페이스를 선택할 수 있습니다.
# dhcpcd eth0
고정 IP
DHCP를 사용하지 않거나 접속할 수 없는 경우에는 고정 IP 주소를 직접 배정해야 합니다. 다음 설정값들을 알아야 합니다:
- 고정 IP 주소
- 서브넷 마스크
- 게이트웨이 IP 주소
- 네임서버(DNS)의 IP 주소
- 도메인 이름(여러분이 직접 지을 수 있는 로컬 랜이 아닌 경우)
콘솔에서, 다음 명령어를 넣으십시오.
# ip addr add <IP 주소>/<서브넷 마스크> dev <인터페이스>
예시:
# ip addr add 192.168.1.2/24 dev eth0
더 많은 옵션을 보려면, man ip
를 보십시오.
다음과 같이 게이트웨이를 추가하십시오.
# ip route add default via <IP 주소>
(여러분 게이트웨이의 IP 주소로 바꿔 넣으십시오.)
예시:
# ip route add default via 192.168.1.1
여러분의 네임서버 IP 주소와 로컬 도메인 이름을 /etc/resolv.conf
에 다음과 같이 넣으십시오.
nameserver 61.23.173.5 nameserver 61.95.849.8 search example.com
nameserver
줄을 넣을 수 있습니다.ADSL 브릿지 설정하기
ISP에 접속하기 위해 브릿지 모드로 설정된 모뎀이나 라우터가 있는 경우 다음 절차를 따르십시오.
다음 명령어를 실행하십시오.
# pppoe-setup
모든 설정이 제대로 끝나고 나면, 다음 명령어로 ISP에 연결하실 수 있습니다.
# pppoe-start
하드디스크 준비하기로 넘어가십시오.
무선 네트워크 설정하기
설치 과정에서 무선 연결이 필요하다면 다음 절차를 따르십시오.
무선 드라이버와 유틸리티는 설치 미디어의 라이브 환경에서 사용하실 수 있습니다. 무선 하드웨어에 대해 잘 알고 있을수록 설정을 쉽게 끝낼 수 있을 것입니다. 지금 시점에서 실행하는 간단 설정 내용은 무선 장치를 설치 매체의 라이브 환경에서만 사용할 수 있게 만들 것입니다. 이 단계(혹은 다른 형태의 무선 관리)는 설치가 끝난 뒤 다시 한번 설정해 주어야 합니다.
또한 이 시점에서의 무선 연결은 꼭 필요하지만은 않다는 것을 알아두십시오; 무선 네트워크는 나중에라도 언제든지 연결할 수 있습니다.
wlan0
를 인터페이스로, linksys
를 ESSID로 가정합니다. 여러분의 환경에 따라 이 값들을 변경해서 사용하십시오.기본 단계는 다음과 같습니다.
- (선택) 무선장치의 인터페이스를 알아냅니다.
기본적인 방법은 다음과 같습니다.
# lspci | grep -i net
혹은, USB 어댑터를 사용한다면 다음과 같이 합니다.
# lsusb
-
/usr/sbin/iwconfig
를 통해 다음과 같이 udev가 드라이버를 로드했고 해당 드라이버가 사용 가능한 커널 인터페이스를 만들어냈다는 것을 확인합니다.
# iwconfig
lo no wireless extensions. eth0 no wireless extensions. wlan0 unassociated ESSID:"" Mode:Managed Channel=0 Access Point: Not-Associated Bit Rate:0 kb/s Tx-Power=20 dBm Sensitivity=8/0 Retry limit:7 RTS thr:off Fragment thr:off Power Management:off Link Quality:0 Signal level:0 Noise level:0 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0
이 예시에서는 wlan0
가 사용할 수 있는 무선 인터페이스입니다.
- 해당 인터페이스를 다음 명령어로 작동시킵니다.
# ip link set wlan0 up
몇몇 무선 드라이버는 드라이버 뿐만 아니라 펌웨어도 필요로 합니다. 무선 칩셋이 펌웨어를 필요로 한다면 인터페이스를 작동시킬 때 다음과 같은 에러가 나타날 것입니다.
# ip link set wlan0 up
SIOCSIFFLAGS: No such file or directory
잘 모르겠다면, /usr/bin/dmesg
명령어로 커널 로그를 보면서 해당 칩셋에 대한 펌웨어 요청이 있는지 확인하십시오.
다음 예는 펌웨어가 필요한 한 인텔 칩셋의 경우에 부팅 시의 커널의 요청을 나타냅니다.
$ dmesg | grep firmware
firmware: requesting iwlwifi-5000-1.ucode
출력이 없다면, 시스템의 무선 칩셋에 펌웨어가 필요하지 않다는 뜻입니다.
/usr/lib/firmware
에 미리 설치되어 있지만 재부팅 후에는 직접 따로 시스템에 설치해 줘야 합니다. 패키지 설치는 이 가이드 내에서 나중에 다뤄집니다. 재부팅 하기 전에 무선 모듈과 펌웨어를 꼭 설치하도록 하세요! 특정 칩셋이 펌웨어를 필요로 하는지 잘 모르겠다면 무선 네트워크 설정 페이지를 보세요. 이것은 일어나기 쉬운 실수입니다.- 만약 ESSID를 잊어버렸거나 알지 못한다면,
iwlist <인터페이스> scan
명령어로 가까운 네트워크를 찾아볼 수 있습니다.
# iwlist wlan0 scan
Cell 01 - Address: 04:25:10:6B:7F:9D Channel:2 Frequency:2.417 GHz (Channel 2) Quality=31/70 Signal level=-79 dBm Encryption key:off ESSID:"dlink" Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s 36 Mb/s; 48 Mb/s; 54 Mb/s
- WPA 암호화를 사용하는 경우
WPA 암호화를 사용하는 경우 키와 ESSID를 하나의 파일 내에 저장한 다음 나중에 wpa_supplicant
를 통해 접속해야 합니다. 그러므로, 몇 단계가 더 필요합니다.
절차를 줄이고 백업을 해 두고 싶은 경우, 기본 wpa_supplicant.conf
파일의 이름을 다음과 같이 바꿔 두십시오.
# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original
wpa_passphrase
를 사용해서 /etc/wpa_supplicant.conf
에 무선 네트워크 이름과 WPA 키가 암호화되어 쓰여지도록 하십시오.
다음의 예는 "my_secret_passkey"라는 키와 "linksys"라는 무선 네트워크를 사용한다고 가정해서 새로운 설정 파일/etc/wpa_supplicant.conf
을 만들어냅니다.
# wpa_passphrase linksys "my_secret_passkey" > /etc/wpa_supplicant.conf
{{Note|만약 위의 명령어가 bash: event not found
라는 에러를 낸다면, 무선 네트워크 이름 내의 !
와 같은 특수문자 때문일 수 있습니다. 이런 경우 다음과 같이 해 보십시오.
# sh -c 'wpa_passphrase linksys "my_secret_passkey" > /etc/wpa_supplicant.conf'
그래도 특수문자로 인한 문제가 발생한다면, ~/mykey
에 임시로 비밀번호를 저장해 두고 다음과 같이 해 보십시오.
# cat ~/mykey | wpa_passphrase linksys > /etc/wpa_supplicant.conf
보안상의 문제로 /etc/wpa_supplicant.conf
파일을 설정한 후에는 이 ~/mykey
파일을 삭제하는 것이 좋습니다.
WPA Supplicant페이지에서 더 많은 정보와 해결책을 찾을 수 있습니다.
/etc/wpa_supplicant.conf
는 평범한 텍스트 파일 형식입니다. 설치 환경에서는 이것이 상관 없지만, 설치 후에 새로운 시스템에서 WPA를 다시 설정할 때에는 /etc/wpa_supplicant.conf
의 권한을 꼭 변경해 두십시오. (예를 들어, chmod 0600 /etc/wpa_supplicant.conf
명령어로 루트 권한으로만 읽을 수 있도록 할 수 있습니다.)- 여러분의 무선 장치를 사용하고자 하는 AP에 연결시키십시오. 암호화에 따라서(WPA, WEP, 혹은 없음) 절차는 달라질 수 있습니다. 사용하고자 하는 무선 네트워크의 이름(ESSID)를 알고 있어야 합니다.
Encryption | Command |
---|---|
암호화 없음 | iwconfig wlan0 essid "linksys"
|
WEP (Hex 키) | iwconfig wlan0 essid "linksys" key "0241baf34c"
|
WEP (ASCII 비밀번호) | iwconfig wlan0 essid "linksys" key "s:pass1"
|
WPA | wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf
|
/etc/rc.d/dbus start
와 /etc/rc.d/networkmanager start
를 넣고networkmanager를 시작한 다음, 사용가능한 연결을 nmcli con list
로 사용할 수 있는 연결을 나열하고 nmcli con up id NAME
(NAME은 연결대상의 이름)을 통해 무선 연결을 설정할 수도 있습니다.- 위에서 설명한 방법대로 연결을 마친 뒤, 잠깐 기다리고 나서 AP와 제대로 연결되었다는 것을 다음과 같은 방법으로 확인하십시오.
# iwconfig wlan0
출력에 무선 네트워크가 해당 인터페이스와 연결되었다는 것이 나타나야 합니다.
- 다음과 같이
/sbin/dhcpcd <interface>
를 통해 IP 주소를 요청합니다.
# dhcpcd wlan0
- 마지막으로,
/bin/ping
를 통해 라우팅이 제대로 되는 것을 확인합니다.
# ping -c 3 www.google.com
PING www.l.google.com (74.125.224.146) 56(84) bytes of data. 64 bytes from 74.125.224.146: icmp_req=1 ttl=49 time=87.7 ms 64 bytes from 74.125.224.146: icmp_req=2 ttl=49 time=87.0 ms 64 bytes from 74.125.224.146: icmp_req=3 ttl=49 time=94.6 ms --- www.l.google.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 87.052/89.812/94.634/3.430 ms
이제 무선 연결이 제대로 연결되어 있을 것입니다. 그렇지 않다면, 무선 네트워크 연결페이지에서 상세한 내용을 확인하십시오.
하드디스크 준비하기
{{Note|GParted와 같은 어떤 파티션 관리 도구라도 사용하실 수 있습니다. 현재 설치 미디어에 포함된 디스크 파티션 관리 도구는 fdisk, cfdisk, gdisk, cgdisk, 그리고 parted가 있습니다.
이미 하드디스크에 파티션을 잡아 두었다면, /sbin/fdisk
에 -l
(소문자 L) 옵션을 주어 현재 설정을 확인하십시오.
루트 프롬프트에서 다음과 같이 입력합니다.
# fdisk -l
아치 설치에 쓸 디스크와 파티션을 기록해 둡니다. 각각의 파티션은 끝에 숫자를 붙여서 구분합니다. 예를 들어,
sda1
는 디스크 내의 첫 파티션을 지정하고 sda
는 디스크 전체를 지정합니다. 이제 여러분은 #블록 디바이스, 파일시스템, 마운트 포인트 설정하기로 넘어가셔도 좋습니다.
이 항목의 나머지 부분은 초보자에게 아치를 설치할 때 설정하는 예시를 보여주기 위한 것이며 cfdisk파티션 관리 도구를 사용합니다. 이 내용은 예시일 뿐이며 여러분은 굳이 이 설정이나 이 도구를 사용할 필요는 없습니다.
하드 디스크에 파티션을 잡는 데 관한 더 많은 정보를 원한다면, 파티션 관리를 보십시오.
파일 시스템에 데한 더 많은 정보를 원한다면, 파일 시스템을 보십시오.
수동으로 하드 디스크에 파티션을 잡기
현재 설치 미디어에 포함된 디스크 관리 도구는 fdisk, cfdisk, gdisk
, cgdisk
, 그리고 parted가 있습니다. gdisk
와 cgdisk
는 GPT 파티션 테이블만을 지원하고, fdisk
와 cfdisk
는 MBR만을 지원합니다. 이 예시는 cfdisk를 사용합니다.
cfdisk를 이용해 대상 디스크를 수동으로 파티션을 잡을 수 있도록 엽니다. (만약 SSD를 사용한다면 gdisk나 GNU Parted를 사용하는 편이 나을것입니다). 이 예제에서는 sda로 지정된 첫 번째 하드 디스크를 사용합니다.
# cfdisk /dev/sda
이 예제에서 시스템은 15GB 루트(/
) 파티션에 1GB swap
파티션, 그리고 나머지에 /home
파티션을 사용하도록 합니다. 파티션을 잡는 것은 개인적으로 선택할 사항이고 이 예시는 그저 보여주기 위한 것일 뿐입니다.
New -> 'Primary'를 선택해서 루트/
파티션에 원하는 크기를 넣습니다. 이 파티션은 디스크의 시작 부분에 넣을 것입니다. Type을 선택해서 83 Linux
로 지정합니다. 생성된 /
파티션은 sda1
으로 나타날 것입니다. 그 후에 "Bootable"을 선택하여 root 파티션을 부팅 가능한 것으로 지정합니다.
다음으로, 두 번째 파티션을 swap으로 생성합니다. 적절한 크기를 선택(1 GB정도)하고 Type을 82 (Linux swap / Solaris)
으로 지정합니다. 생성된 파티션은 sda2
로 나타날 것입니다.
나머지 공간은 세 번째 /home
파티션을 잡는 데 사용합니다. primary 파티션으로 지정하고 크기를 지정합니다. Type을 83 Linux
으로 지정합니다. 생성된 /home
파티션은 sda3
로 나타날 것입니다.
이 예시대로 수행한 후에는 다음과 같이 나타날 것입니다.
Name Flags Part Type FS Type [Label] Size (MB) ------------------------------------------------------------------------- sda1 Boot Primary Linux 15440 #root sda2 Primary Linux swap / Solaris 1024 #swap sda3 Primary Linux 133000 #/home
Write를 선택하고 yes
를 입력합니다. 이 작업은 여러분 디스크의 데이터를 파괴할 수 있다는 것을 숙지하십시오. Quit를 눌러 cfdisk를 빠져 나갑니다.
파티션을 잡는 데 관한 더 많은 정보를 원한다면, 파티션 관리를 보십시오.
블록 디바이스, 파일시스템, 마운트 지점 설정하기
mkfs
유틸리티를 이용해 파티션을 포멧합니다. 다음 예시 설정에서는, 우리는 루트와 홈 파티션 모두에 ext4 파일 시스템을 사용할 것입니다.
# mkfs.ext4 /dev/sda1 # mkfs.ext4 /dev/sda3
스왑 파티션도 다음과 같이 포멧시킨 후 활성화시킵니다.
# mkswap /dev/sda2 && swapon /dev/sda2
파일 시스템 종류에 대해 더 많은 정보를 원한다면, 파일 시스템을 보십시오.
파티션 마운트하기
루트 파티션을 /mnt
에 마운트합니다.
# mount /dev/sda1 /mnt
다음과 같이 /home파티션 디렉토리를 만들어서 마운트합니다.
# mkdir /mnt/home && mount /dev/sda3 /mnt/home
미러 사이트 선택하기
설치하기 전에, 선호하는 미러 사이트가 먼저 오도록 /etc/pacman.d/mirrorlist
를 편집하는 것이 좋습니다. mirrorlist의 사본이 pacstrap에 의해서 새 시스템에도 복사될 것이므로 지금 설정해 두는 것이 좋을 것입니다.
기본 시스템 설치하기
기본 시스템은 pacstrap 스크립트에 의해 설치됩니다. 최소 시스템은 base 패키지 그룹을 필요로 합니다. 또한 지금 base-devel 패키지를 설치할 것을 권합니다. 다른 패키지가 필요하다면 pacstrap 명령어에 추가해 주면 됩니다.
# pacstrap /mnt base base-devel
- base: 최소한의 기반 환경을 제공하기 위한 [core] 저장소의 소프트웨어 패키지들
- base-devel:
make
나automake
와 같은 [core]의 기타 도구들. 이 도구들은 새로운 시스템을 확장하는데 필요할 가능성이 높기 때문에 대부분의 초보자들은 설치하도록 선택해야 합니다. 이 도구들은 Arch User Repository의 소프트웨어를 설치하는 데 필요합니다.
이렇게 해서 아치의 기본 시스템이 만들어집니다. 다른 패키지들은 pacman을 이용해서 설치할 수 있습니다.
부트로더 설치하기
syslinux나 GRUB2중 한 가지를 설치하십시오(둘 다 설치할 필요는 없습니다).
Syslinux
# pacstrap /mnt syslinux
GRUB2
BIOS를 사용하는 시스템
# pacstrap /mnt grub-bios
EFI를 사용하는 시스템
# pacstrap /mnt grub-efi-x86_64
(간혹 grub-efi-i386
를 대신 설치해야 할 수 있습니다.)
fstab 생성하기
다음 명령어를 이용해 fstab파일을 생성합니다. (만약 UUID나 라벨을 사용하고 싶다면 각각 -U
나 -L
옵션을 추가하십시오.)
# genfstab -p /mnt >> /mnt/etc/fstab
/mnt/etc/fstab
을 확인해 보는 것이 좋습니다. genfstab을 실행하는 중이나 나중에 설치 과정에서 문제가 발생하면, genfstab을 다시 실행하지 마십시오. 그냥 fstab을 수정하기만 하십시오. 또한, "/"파티션만 끝에 "1"이 붙어야 합니다. 나머지는 "2"나 "0"이 붙어야 합니다(필드 정의를 보세요).시스템에 chroot로 들어가기
이제 새로 설치한 시스템에 chroot을 이용해서 들어갈 것입니다.
# arch-chroot /mnt
시스템 설정하기
지금 단계에서는, 여러분의 아치 리눅스 기반 시스템의 설정 파일을 수정할 것입니다.
설정 파일
/etc/rc.conf
가 아치 initscripts의 설정 파일이고, 과거에는 이 파일이 시스템의 다른의 부분 설정을 포함하기도 했습니다. /etc/rc.conf
는 부팅시에 어느 데몬을 실행할지 그리고 몇몇 네트워크와 저장장치 정보를 설정합니다.
/etc/rc.conf
의 예전 설정을 이용하는 것도 여전히 동작하기는 하지만, 더 이상 공식적인 방법은 아닙니다. 새 설정파일들은 /etc/rc.conf
보다 우선합니다. 이러한 수정은 initscripts와 systemd 사이의 차이 뿐만 아니라 아치 리눅스와 다른 배포판 사이의 사소한 차이를 없애기 위한 것입니다. 아래의 표는 수정해야 할 파일을 그에 해당하는 etc/rc.conf
의 과거 설정과 함께 나타낸 것입니다. 예전의 설정은 이후에 버려질 것이기 때문에 새로 설치하는 분들은 과거 설정을 무시해야 합니다. systemd와 rc.conf에서 수정된 것들의 자세한 설명을 보실 수 있습니다.설정 | 설정 파일 | 과거 /etc/rc.conf 부분
|
---|---|---|
Hostname | /etc/hostname
|
NETWORKING
|
Console fonts and Keymap | /etc/vconsole.conf
|
LOCALIZATION
|
Locale | /etc/locale.conf
|
LOCALIZATION
|
Timezone | /etc/timezone
|
LOCALIZATION
|
Hardware clock | /etc/adjtime
|
LOCALIZATION
|
Kernel modules | /etc/modules-load.d/
|
HARDWARE
|
Daemons | /etc/rc.conf
|
DAEMONS
|
Wired Network | /etc/rc.conf
|
NETWORKING
|
호스트 네임
/etc/hostname
에 호스트 네임을 넣으십시오. 예시:
myhostname
여러분이 좋은 대로 정하십시오. 이것은 여러분 컴퓨터의 이름입니다.
앞에서 정한 그대로 여러분의 호스트 네임을 /etc/hosts
에도 다음과 같이 넣으십시오.
127.0.0.1 localhost.localdomain localhost myhostname ::1 localhost.localdomain localhost myhostname
고정 IP를 사용한다면, 다음 형식으로 새 줄을 추가하십시오. <고정 IP> <호스트네임.도메인네임.org> <호스트네임> 예:
192.168.1.100 myhostname.domain.org myhostname
/etc/hosts
에 여러분 네트워크나 웹상의 호스트의 alias를 넣을 수 있습니다.
192.168.1.90 media 192.168.1.88 data위의 예는 여러분이 각각의 IP 주소를 치지 않더라도 이름만으로 media서버와 data서버를 접속할 수 있게 해 줍니다.
콘솔 폰트와 키맵
/etc/vconsole.conf
를 수정하십시오.
- KEYMAP
- 사용할 수 있는 키맵은
/usr/share/kbd/keymaps
에 있습니다. 이 세팅은 TTY에만 유효하고 어떤 그래픽 윈도 매니저 혹은 X에도 적용되지 않는다는 것을 알아두십시오. - FONT
- 사용할 수 있는 대체 폰트는
/usr/share/kbd/consolefonts/
에 있습니다. 기본대로 비워 두어도 됩니다. - FONT_MAP
- Defines the console map to load with the setfont program at boot. Possible maps are found in
/usr/share/kbd/consoletrans
, if needed. The default (blank) is safe.
Example:
KEYMAP=us FONT=lat9w-16 FONT_MAP=8859-1_to_uni
Timezone
Edit the file /etc/timezone
and write your Zone
/Subzone
. Available time zones and subzones can be found in the /usr/share/zoneinfo/<Zone>/<SubZone>
directories. Example:
Europe/Minsk
Read man 5 timezone
for more options.
Additionaly, create a symbolic link /etc/localtime
to the same /usr/share/zoneinfo/<Zone>/<SubZone>
using this command:
# ln -s /usr/share/zoneinfo/<Zone>/<SubZone>
/etc/localtime
Example:
# ln -s /usr/share/zoneinfo/Europe/Minsk /etc/localtime
Locale
Enable locales
The /usr/sbin/locale-gen
command reads from /etc/locale.gen
to generate specific locales. They can then be used by glibc and any other locale-aware program or library for rendering text, correctly displaying regional monetary values, time and date formats, alphabetic idiosyncrasies, and other locale-specific standards.
By default /etc/locale.gen
is an empty file with commented documentation. Once edited, the file remains untouched. locale-gen
runs on every glibc upgrade, generating all the locales specified in /etc/locale.gen
.
Choose the locale(s) you need by removing the # in front of the lines you want, e.g.:
en_US.UTF-8 UTF-8
Then run:
# locale-gen
"The current locale is invalid..."
error. This is perhaps the most common mistake by new Arch users.Setting up system-wide locale
Set locale preferences in /etc/locale.conf
. Example:
/etc/locale.conf
LANG=en_US.UTF-8
Run source /etc/profile.d/locale.sh
to load the locale settings for the current shell, or just log in again.
Hardware clock time
This is set in /etc/adjtime
. Set the hardware clock mode uniformly between your operating systems on the same machine. Otherwise, they will overwrite the time and cause clock shifts (which can cause time drift correction to be miscalibrated).
You can generate /etc/adjtime
automatically by using one of the following commands.
/etc/rc.conf
is not set when using this method.- UTC (recommended)
# hwclock --systohc --utc
- localtime (discouraged) - Used by default in Windows
# hwclock --systohc --localtime
Setting time in a Windows dual boot setup
If you are setting up a dual-boot with Windows on your system, you have two options:
- Recommended: Set both Arch Linux and Windows to use UTC (a quick registry fix is needed, see this page for instructions). Also, be sure to prevent Windows from synchronizing the time with the Internet, as it will make the hardware clock use localtime again. If you want such functionality (NTP sync), you should use ntpd on your Arch Linux installation instead.
- Not recommended: Set Arch Linux to localtime and later (in Configure the system) remove
hwclock
from theDAEMONS
array in/etc/rc.conf
(Windows will take care of hardware clock corrections).
Kernel modules
Edit /etc/modules-load.d/
to configure kernel modules to load during boot in a static list. Each configuration file is named in the style of /etc/modules-load.d/<program>.conf
. The configuration files should simply contain a list of kernel module names to load, separated by newlines. Empty lines and lines whose first non-whitespace character is #
or ;
are ignored. Example:
/etc/modules-load.d/virtio-net.conf
# Load virtio-net.ko at boot virtio-net
Daemons
Daemons are programs that run in the background, waiting for events to occur and offering services. A good example is a web server that waits for a request to deliver a page (e.g.: httpd
) or an SSH server waiting for a user login (e.g.: sshd
). While these are full-featured applications, there are also daemons whose work is not that visible. Examples are a daemon which writes messages into a log file (e.g. syslog
, metalog
), and a daemon which provides a graphical login (e.g.: gdm
, kdm
).
These programs can be added to the DAEMONS line in /etc/rc.conf
and will be started when the system boots. The DAEMONS array simply list the names of those scripts contained in /etc/rc.d/
which are to be started during the boot process, and the order in which they start. Asynchronous initialization by backgrounding is also supported and useful for speeding up boot:
DAEMONS=(network @syslog-ng netfs @crond)
- If a script name is prefixed with a bang (
!
), it is not executed. - If a script is prefixed with an "at" symbol (
@
), it shall be executed in the background; the startup sequence will not wait for successful completion of each daemon before continuing to the next. (Useful for speeding up system boot). Do not background daemons that are needed by other daemons. For examplempd
depends onnetwork
, therefore backgroundingnetwork
may causempd
to break. - Edit this array whenever new system services are installed, if starting them automatically during boot is desired.
rc.d list
.Configure the network
You need to configure the network again, but this time for your newly installed environment. The procedure and prerequisites are very similar to the one described above, except we are going to make it persistent and automatically run at boot.
Wired Network
If you only use a single wired network connection, you can use the network daemon, a simple solution for both dynamic and static IP addressing. First, insure that the daemon is listed in the DAEMONS array:
/etc/rc.conf
DAEMONS=(... network ...)
Then configure the NETWORKING section of /etc/rc.conf
as follows, depending on your IP addressing type.
Dynamic IP (DHCP)
Assuming the network interface to activate at start is eth0, use this configuration:
interface=eth0 address= netmask= gateway=
Your DNS server addresses will be automatically filled in by the dhcpcd daemon.
Static IP
If you need to use a static IP address, use this configuration:
interface=eth0 address=192.168.0.2 netmask=255.255.255.0 broadcast=192.168.0.255 gateway=192.168.0.1
You will also need to add your name servers' (DNS) IP addresses and your local domain name to your /etc/resolv.conf
like this:
nameserver 61.23.173.5 nameserver 61.95.849.8 search example.com
Wireless network
The network daemon is not sufficient to handle Wireless networking, which requires additional configuration. You will need to install other programs to configure and manage wireless network profiles, such as netcfg. NetworkManager and Wicd are popular alternatives.
- Exit the chroot environment:
# exit
- Install the required packages:
# pacstrap /mnt wireless_tools netcfg
- If you use WPA/WPA2 wireless encryption, install:
# pacstrap /mnt wpa_supplicant wpa_actiond
- If your wireless adapter requires a firmware (as described in #Setup_wireless_network and Wireless_Setup#Drivers_and_firmware), install the package containg your firmware, e.g.:
# pacstrap /mnt zd1211-firmware
- Chroot back:
# arch-chroot /mnt
- Create a network profile for your wireless connection in the
/etc/network.d
directory:- Copy and rename a configuration template from
/etc/network.d/examples/
to/etc/network.d/mynetwork
(mynetwork being an example; the name is not a network setting and does not need to match the wireless network name (SSID)). These templates are adapted to the type of your wireless connection, such aswireless-wep
orwireless-wpa
. See Netcfg#Configuration for a list of available templates and their usage. - Set
INTERFACE
to the correct wireless interface. This can be checked withiwconfig
. - Ensure the
ESSID
andKEY
(passkey) are set correctly for wireless connections. Typos in these fields are common errors.- Note that WEP string keys (not hex keys) must be specified with a leading
s:
(e.g.KEY="s:somepasskey"
). - For WPA-Personal, it is possible to specify the passkey in plain text or as an encoded hex.
- Note that WEP string keys (not hex keys) must be specified with a leading
- Copy and rename a configuration template from
- Add
net-auto-wireless
to theDAEMONS
array in/etc/rc.conf
:
/etc/rc.conf
DAEMONS=(... net-auto-wireless ...)
And specify the desired wireless interface with the WIRELESS_INTERFACE
variable in /etc/conf.d/netcfg
:
/etc/conf.d/netcfg
WIRELESS_INTERFACE="wlan0"
It is also possible to define a list of network profiles that should be automatically connected with the AUTO_PROFILES
variable in /etc/conf.d/netcfg
. If AUTO_PROFILES
is not set, all wireless networks will be tried.
Create an initial ramdisk environment
Configure /etc/mkinitcpio.conf
as needed (see mkinitcpio) and create an initial RAM disk with
# mkinitcpio -p linux
/etc/mkinitcpio.conf
file.Configure the bootloader
Syslinux
If you installed syslinux, edit the /boot/syslinux/syslinux.cfg
to point to the right /
partition. Then type the following command to install (-i
), set boot flag (-a
) and install the MBR (-m
).
# /usr/sbin/syslinux-install_update -iam
For more information on configuring and using syslinux, see Syslinux.
Grub
If you installed GRUB2, install it to the hard disk containing your boot partition.
# grub-install /dev/sda
To prevent a (harmless) error message at boot time:
# mkdir -p /boot/grub/locale # cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
Create the grub.cfg file.
# grub-mkconfig -o /boot/grub/grub.cfg
For more information on configuring and using GRUB2, see GRUB2.
Root password
Set a root password with passwd
.
Unmount the partitions and reboot
If you are still in the chroot environment then type exit
or Ctrl+D
in order to exit chroot.
Since the partitions are mounted under /mnt
, we use the following command to unmount them.
# umount /mnt/{boot,home,}
Exit the install, and reboot:
# reboot