본문 바로가기

Development Note/Ubuntu

우분투 저장소(repository) 변경을 통한 속도 향상 [How to change Ubuntu repository]



 [KOR] 우분투Ubuntu를 사용하면서 가장 빈번하게 쓰는 터미널 명령어는 아무래도 [#sudo apt-get install package-name] 이 아닌가 싶습니다. 이 명령어를 수행하면 저장소 서버에서 패키지를 가져와서 설치하게 되는데 이 서버 속도가 꽤나 느립니다. 그래서 답답할 때가 많이 있죠. 이 명령어를 실행할 때 보면 서버 주소가 뜨는데, 이 주소를 국내에서(어쩌면 세계에서) 가장 빠른 서버인 다음 FTP 서버로 바꾸어 주면 패키지 인스톨 과정에서 비약적인 속도의 향상이 있습니다. 이번 포스트에서는 어떻게 저장소 서버 주소를 바꾸는지 알아보고자 합니다. 우분투 12.04 LTS 버전을 기준으로 설명합니다.

 [ENG] Maybe this command: [#sudo apt-get install package-name] is the most popular command. When you fulfill this command, then Ubuntu get packages from repository server and install. The problem is, this server is really slow. So in this post, I will introduce how to change repository server address. If you change server address, you will meet fantastic speed of apt-get installer. This post created based on Ubuntu 12.04 LTS.



1. 기존 서버 주소[Current repo server]:


http://kr.archive.ubuntu.com/ubuntu/    (한국서버, [kr] can be different in Countries)



2. 우리가 바꿀 주소[Fastest repo server]:


http://ftp.daum.net/ubuntu/



 [KOR] 기존의 서버 주소와 우리가 바꿀 서버 주소를 비교 해 보면, 다 똑같은데 kr.archive.ubuntu.com 만 ftp.daum.net 으로 바뀐다는 사실을 알 수 있습니다. 그래서 gedit 의 replace 기능을 통해서 모든 저장소 서버 주소를 한번에 바꾸어 보고자 합니다. 먼저 다음 명령어로 sources.list 파일을 엽니다.

 [ENG] As we compare two server(Current, Fastest),  we can catch what's different easily. Now all we have to do is replace [kr.archive.ubuntu.com] to [ftp.daum.net]. that's all. So we will use replace function of 'gedit' for this work. First, run following command to open [sources.list] file.



다음[Followings]:


#sudo gedit /etc/apt/sources.list



 [KOR] 그럼 gedit가 sources.list 파일을 열면서 실행되는 모습을 볼 수 있는데, 여기서 돋보기에 연필이 겹쳐있는 모양의 아이콘을 클릭합니다.

 [ENG] Then 'gedit' will open [sources.list] file. Now click the magnifier-pencil shaped icon.






 [KOR] 그러면 Replace 기능을 수행할 수 있는 창이 등장합니다. 여기서 다음 그림과 같이 입력하고 Replace all 버튼을 클릭합니다.

 [ENG] Then a window will pop up. Now input like picture below and click the 'Replace all' button.





 [KOR] 이제 짠! 모든 저장소 주소가 ftp.daum.net 으로 변경되었습니다. 이제 빨라진 속도를 체감하러 가 보죠. 다음의 커맨드를 실행합니다.

 [ENG] Boom! Now every repository address have changed to [ftp.daum.net]. Now we need to feel the upgraded speed. Run Following commands.



다음[Followings]:


#sudo apt-get update

#sudo apt-get upgrade



 [KOR] 슈퍼패스트 스피드를 경험할 수 있습니다. 앞으로 apt-get 명령어 걸어놓고 밥먹고 오지 않아도 된답니다.

 [ENG] Super-fast speed. Now you don't have to wait when you are running [apt-get] command.