실습환경: vmware 11 ubuntu-mate 14.04


우분투 repository에는 간혹 원하는 패키지들이 존재하지 않을 경우가 있다.

이를 위해 personal repository를 만들어보고자 한다.


참고: https://help.ubuntu.com/community/Repositories/Personal (뭐 사실 동일)

단계

1. Install dpkg-dev

2. Put the packages in a directory

3. Create a script that will scan the packages and create a file apt-get update can read

4. Add a line to your sources.list pointing at your repository


단계를 실시하기전에 apt-get 명령어 정리 참고


1. Install dpkg-dev

$sudo apt-get install dpkg-dev


2. The Directory

패키지를 유지하고 싶은 곳에 디렉토리를 생성. 본 예제에서는 /usr/local/mydebs 경로 사용

$sudo mkdir -p /usr/local/mydebs        //-p는 하위디렉토리까지 생성할 때 쓰인다.

아래의 사진은 /usr/local/mydebs 내에 샘플 deb패키지를 넣음

(http://kkn1220.tistory.com/51 위의 샘플 deb 만드는 방법(커널모듈을 deb파일로 생성함))


3. The script update-mydebs

update-mydebs 스크립트 만들기


위의 매뉴얼을 살펴보면 update-mydebs 스크립트 파일을 ~/bin에 저장하라고 권고

(만약 존재하지 않을 경우 만들라고 까지..... 근데 뭐 사실 그닥 중요하진 않은듯)

-매뉴얼-

Cut and paste the above into gedit, and save it as update-mydebs in ~/bin. 

(the tilde '~' means your home directory. If ~/bin does not exist, create it: Ubuntu will put that directory in your PATH. 

It's a good place to put personal scripts). 


굳이 ~/bin에 넣을 필요를 못느껴서 desktop에 스크립트 파일 생성


다음으로 스크립트를 실행하기 위해서는 권한을 줘야됨

$chmod u+x ~/bin/update-mydebs

(위의 명령은 change mode로 실행권한인 x를 주는 것을 뜻합니다. chmod 764와 같음)

위 명령을 실행하면 아래와 같이 user권한에 rwx로 바꾸는 것을 확인할 수 있다.



위의 스크립트 동작원리

-> dpkg-scanpackages는 생성폴더인 mydebs안에 모든 패키지들을 보고 apt-get update가 읽을 수 있도록 압축하고 쓰여진다.(Packages.gz 파일로)

$./update-mydebs        //스크립트 실행

위의 명령을 실행하면 아래의 사진과 같이 Packages.gz 생성 확인할 수 있다.



$gunzip Packages.gz

$vi Packages    //패키지 확인하기 위해서




이를 웹에 등록하여 apt-get install하는 것도 할 예정




+ Recent posts