Linux/Kali_Linux

칼리 리눅스 한글 설정 / Kali Linux Hangul Configuration

옥뀨 2020. 6. 30. 02:17

오늘은 칼리 리눅스에 한글 설정을 해보려 한다.

Today, we're going to set up Hangul on Kali Linux.

 

처음 칼리 리눅스에 로그인하면 한글이 깨지는 현상을 확인할 수 있다.

When you log in to Kali Linux for the first time, you can see that the Hangul is broken.

 

한글 깨짐 현상 / Hangul broken in Kali Linux

 

먼저 저장소에 미러 사이트를 등록하자.

First, register the mirror site in the repository.

 

미러 사이트란 네트워크 트래픽을 줄이기 위해 다른 컴퓨터 서버를 복사해 놓은 웹사이트 혹은 컴퓨터

파일 서버를 의미한다.

A mirror site is a website or computer file server where the computer servers are copied to reduce network traffic.

 

필자는 부경대 서버를 이용한다. 기존에 있는 칼리 리눅스 기본 미러 사이트는 너무 느리기 때문이다.

I use the pukyong national university server. This is because the existing Kali Linux default mirror site is too slow.

 

미러 사이트는 많이 있으니 검색해보고 골라서 사용하는 것을 추천한다.

There are many mirror sites, so it is recommended to search and select them.

 

한국에는 카이스트나 카카오 서버 등등이 존재한다.

In Korea, KAIST, Kakao Server, etc. exist.

 

미러사이트는 /etc/apt 디렉토리 하위의 "sources.list" 파일에서 등록할 수 있다.

Mirror sites can be registered in the "sources.list" file under the /etc/apt directory. 

 

etc는 각종 설정에 관련된 내용이 들어있는 디렉토리이다.

etc is a directory containing contents related to various settings.

 

필자는 "root"로 로그인하는 것을 최소화하고 일반 사용자에게 관리자 권한을 주어

파일을 다운로드 혹은 수정한다.

I minimize log in as "root" and download or modify files by giving normal users administrator privileges.

 

이 사항은 보안에 있어서 굉장히 중요한 부분이다.

This is a very important part of security.

 

먼저 "sources.list" 파일의 권한을 확인해보자.

First, let's check the permissions of the "sources.list" file.

 

sources.list 파일의 권한 확인 / permissions of the  "sources.list" file

 

위의 사진에서 보면 소유자는 root 최고 권한자이고 root만이 파일을 수정할 수 있다.

In the picture above, the owner is root and only root can modify the file.

 

권한에 대한 자세한 설명은 추후에 올리도록 하겠다.

We will post more details on the permissions later.

 

"sudo"란 root의 권한으로 명령어를 실행한다는 의미이고 "vi"는 vi 편집기를 이용해 파일을 수정한다는 의미이다.

"sudo" means to run the command with root privileges and "vi" means to modify the file using the vi editor.

 $ sudo vi /etc/apt/sources.list

sources.list 파일 수정 / Modify the sources.list file

 

먼저 repository의 형식에 대해 살펴보자.

Let's first look at the format of the repository.

 

deb / deb-src : "deb"는 애플리케이션을 설치하기 위한 binary files에 대한 링크를 의미한다.
                    "deb-src"는 해당 애플리케이션의 source code에 대한 링크를 의미한다.

deb / deb-src "deb" means a link to binary files to install the application.

                    "deb-src" means a link to the source code of the application.

 

http://ftp.harukasan.org/kali repository 사이트에 대한 URI 이다.

http://ftp.harukasan.org/kaliURI for the repository site.

 

kali-rolling : 기본 분기이다. 좀 어려운 단어이긴 한데 패키지가 안정적인지 확인하고 칼리 롤링 전용의 패키지와

                결합 후 kali-dev에서 가져온다는 의미로 알고 있으면 되겠다.

kali-rolling : the main default branch that most should be using. It is being continuously updated,

                as it pulls from kali-dev after ensuring questionable packages are stable and

                combining them with packages from kali-rolling-only.

 

main : DFSG (Debian Free Software Guidelines)를 따르는 모든 무료 소프트웨어

non-free : DFSG를 따르지 않는 모든 종류의 무료 소프트웨어

contrib : DFSG를 따르지만 소프트웨어에 의존하는 무료 소프트웨어

 

main : Any free software that conforms to the DFSG (Debian Free Software Guidelines)

non-free : Free software of any kind that does not follow DFSG

contrib : Free software that follows DFSG but relies on software

 

파일을 열어 수정해보자. i키를 누르면 수정이 가능하다. vi 단축키에 대한 내용 또한 추후에 올리도록 하겠다.

Let's open the file and edit it. Press i to edit. We will also post vi shortcut later.

 

여기에서 "#"은 주석으로 설명을 하거나 추후에는 쓸 수 있으나 현재는 사용하지 않는 문구를 빼는 역할을 한다.

Here "#" is a comment or serves to subtract phrases that can be used later but are not currently used.

 

맨 밑줄에

"deb http://ftp.harukasan.org/kali kali-rolling main non-free contrib"

"deb-src http://ftp.harukasan.org/kali kali-rolling main non-free contrib" 을 입력하자.

Type

"deb http://ftp.harukasan.org/kali kali-rolling main non-free contrib"

"deb-src http://ftp.harukasan.org/kali kali-rolling main non-free contrib" in the bottom line.

 

수정을 완료했고 vi 편집기에서 빠져 나오고 싶다면 "ESC"를 눌러 커서를 없애주고 ":wq" 를 입력해주자.

":wq" 에서

":"는 명령 행 모드에서 입력을 할 수 있게 해준다.

"w"는 write의 약자로 현재 파일명으로 파일을 저장한다.

"q"는 quit의 약자로 vi를 종료한다는 의미이다.

너무 많이 알려고는 하지말자. 어차피 vi 편에서 다루어 볼 것이다.

 

If you are done editing and want to exit the vi editor, press "ESC" to remove the cursor and type ":wq".

In ":wq"
The ":" allows you to type in the command line mode.
"w" stands for write and saves the file with the current file name.
"q" stands for quit, which means to quit vi.

Don't try to learn too much. Anyway, we'll learn about vi later in the future.

 

"sources.list" 파일 수정 / Modify the "sources.list" file

 

아래 명령어에서 보이는 "apt-get(Advanced Packaging Tool)"은 우분투(Ubuntu)를 포함안 데비안(Debian)계열의

리눅스에서 쓰이는 패키지 관리 명령어 도구이다.

The "apt-get (Advanced Packaging Tool)" shown in the command below is

a package management command tool used in Debian-based Linux including Ubuntu.

 

apt 명령은 관리자 권한(sudo)으로 실행한다.

The apt command is executed with administrator authority (sudo).

 

sudo apt-get update : 패키지 인덱스, 인덱스 정보 업데이트.

sudo apt-get update : Update package index and index information.

 

sudo apt-get upgrade : 설치되어 있는 패키지를 모두 새 버전으로 업그레이드.

sudo apt-get upgrade : upgrade all installed packages to the new version.

 

sudo apt-get dist-upgrade : 업그레이드를 완료하기 위해 필요에 따라 패키지를 지능적으로 설치하거나 제거.

                                     이 명령어를 실행하기 위해선 먼저 시스템을 완전히 업그레이드 해야한다.

                                     바로 위에 쓴 명령어를 먼저 실행해야 한다는 뜻이다.

sudo apt-get dist-upgrade : intelligently installs or removes packages as needed to complete the upgrade.

                                     To execute this command, you must first upgrade your system completely.

                                     This means that the command written just above must be executed first.

sudo apt-get autoremove : 삭제한 패키지의 의존성이 있어서 설치되었던 필요없는 패키지를 삭제.                          sudo apt-get autoremoveremove unnecessary packages .

                                    that were installed together due to the dependency of the deleted package.

 

sudo apt-get clean : /var/cache/apt/archives 디렉토리에 다운로드한 파일을 삭제.
sudo apt-get clean : delete downloaded files in /var/cache/apt/archives directory.

 

&& : 이전 명령어의 실행이 완료되면 다음 명령어를 실행시켜주는 연산자.

       이전 명령어의 실행이 실패하면 다음 명령어는 실행되지 않는다.

&& : Operator that executes the next command when execution of the previous command is completed.

       If the previous command fails, the next command is not executed.

 

$ sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove && sudo apt-get clean

 

update, upgrade, dist-upgrade, autoremove, clean

 

파이틱스 한글 입력기를 설치하자.

Let's install the fcitx Korean input method.

 

$ sudo apt-get install fcitx-hangul

 

설치를 물어보면 "y"를 쳐서 설치를 진행하자.

When prompted for installation, type "y" to proceed with the installation.

 

y를 치기 귀찮으면 "sudo apt-get -y install fcitx-hangul" 을 쳐도 된다.

If you don't want to type y, you can type "sudo apt-get -y install fcitx-hangul".

 

"-y" 옵션을 넣으면 설치과정 중 물어보는 질문에 다 yes를 답한다.

If you enter the "-y" option, all of the questions asked during the installation process are answered yes.

 

fcitx 한글 입력기 설치 / Install fcitx Korean input method

 

fcitx 라이브러리를 설치하자.

Install the fcitx library.

 

$ sudo apt-get install fcitx-lib*

 

fcitx 라이브러리 설치 / Install the fcitx library

 

나눔 폰트를 설치하자.

Install the nanum fonts.

 

$ sudo apt-get install fonts-nanum*

 

나눔 폰트 설치 / Install the nanum fonts

 

설치가 완료되면 컴퓨터를 재부팅해주자.

When the installation is complete, reboot the computer.

 

init 사용법을 간단하게 알아보면 형식은 "init [숫자]" 이다.

The simple format for using init is "init [number]".

 

0 : 시스템 종료 (halt)

0 : Shut down (halt)

 

1 : 싱글 유저 모드(single 모드로 쉘로 바로 부팅, 주로 복구 시에 사용)

1 : Single user mode (single mode to boot directly into the shell, mainly used for recovery)

 

2 : NFS 기능을 사용하지 않는 다중사용자 모드

2 : Multiuser Mode without NFS function

 

3 : 모든 기능을 포함한 멀티유저 모드, 콘솔 부팅

3 : Multiuser Mode including all functions, console boot

 

4 : 사용하지 않음

4 : Not used

 

5 : X-윈도우로 부팅 및 멀티유저 모드

5 : Booting into X-Windows and Multiuser Mode

 

6 : 시스템 재부팅 (reboot)

6 : system reboot

 

$ sudo init 6

 

시스템 재부팅 / System reboot

 

재부팅을 하고 나면 한글이 깔끔하게 출력되는 것을 확인할 수 있다.

After rebooting, you can see that the Hangul is displayed neatly.

 

이제 출력은 끝났고 입력기 설정을 해야 한다. fcitx을 기본으로 해주자.

Now that the output is done, Let's set the input method, fcitx as the default.

 

먼저 메뉴 아이콘을 누르고 "입력기"라고 치자.

First, tap the menu icon and type "Input".

 

입력기 설정(1) / Input method settings(1)

 

"확인"을 누르자.

Click "OK".

 

입력기 설정(2) / Input method settings(2)

 

"예"를 누른다.

Click "Yes".

 

입력기 설정(3) / Input method settings(3)

 

기본 입력기를 "fcitx"로 지정하고 "확인"을 누른다.

Set the default input method to "fcitx" and press "OK".

 

입력기 설정(4) / Input method settings(4)

 

입력기 기본 설정을 "fcitx"로 할 것이냐고 묻는다. 확인을 눌러 입력기 설정을 완료하자.

It asks if you want to set the input method preference to "fcitx".

Click OK to complete the input method setup.

 

입력기 설정 완료 / Input method setting completed

 

이제 한영키나 단축키를 이용해 한글에서 영어로, 영어를 한글로 변환해줄 수 있도록 설정을 하자.

Now, let's set it up so that you can convert from Korean to English and English to Korean using a Korean key or a shortcut.

 

메뉴창을 열고 검색창에 "fcitx"를 검색하여 "fcitx 설정"을 클릭한다.

Open the menu window, search for "fcitx" in the search box, and click "fcitx settings".

 

fcitx 설정(1) / fcitx settings(1)

 

입력기 설정을 할건데 한글은 있지만 영어가 보이지 않는다. "+" 버튼을 눌러 영어를 추가해주자.

I'm going to set up the input method, but I have Korean but I can't see English.

Click the "+" button to add English.

 

fcitx 설정(2) / fcitx settings(2)

 

입력기 추가 메뉴에서 "영어"를 선택하고 선택 버튼을 누르자.

Choose "English" from the Add Input Method menu and press the Select button.

 

fcitx 설정(3) / fcitx settings(3)

 

항목에 "영어"가 추가되었음을 확인할 수 있다.

we can see that "English" has been added to the item.

 

fcitx 설정 완료 / fcitx setting completed

 

필자는 터미널에서 한글을 입력해보았다.

I tried typing Hangul in the terminal.

 

한글 설정 완료 / hangul setting completed

 

이제 터미널이나 인터넷 등 다양한 곳에서 한글과 영어를 자유자제로 변경해가며 사용할 수 있다.

Now you can freely switch between Korean and English in various places such as the terminal or the Internet.