메뉴 닫기

Torrent로 ISO 파일 다운로드 – Linux command line

최근에는 ISO 파일을 토렌토로 배포하는데 리눅스에서 커맨드라인을 이용해서 다운로드 받는 방법을 소개합니다.
본문에서는 최근배포된 Ubuntu 14.10 이미지를 리눅스상 CMD로 BitTorrent를 이용해서 다운로드 받는 방법이며 CLI 비트토렌토 클라이언트 transmission-cli 를 이용하였습니다.

Ubuntu 14.10 릴리즈 정보는 링크를 통해 확인해보시기 바랍니다.
http://releases.ubuntu.com/utopic/

 
 
Install (설치)
Ubuntu
# apt-get install transmission-cli
 
Fedora & RHEL(CentOS)
# yum install transmission-cli
 
# wget http://releases.ubuntu.com/14.10/ubuntu-14.10-desktop-amd64.iso.torrent
# transmission-cli ubuntu-14.10-desktop-amd64.iso.torrent
[14:45:01.418] Transmission 2.77 (14031) started
[14:45:01.418] RPC Server: Adding address to whitelist: 127.0.0.1
[14:45:01.419] UDP: Failed to set receive buffer: requested 4194304, got 425984
[14:45:01.419] UDP: Please add the line “net.core.rmem_max = 4194304” to /etc/sysctl.conf
[14:45:01.419] UDP: Failed to set send buffer: requested 1048576, got 425984
[14:45:01.419] UDP: Please add the line “net.core.wmem_max = 1048576” to /etc/sysctl.conf
[14:45:01.419] DHT: Generating new id
[14:45:01.519] Saved “/root/.config/transmission/torrents/ubuntu-14.10-desktop-amd64.iso.b415c913643e5ff4.torrent”
[14:45:01.752] Port Forwarding (NAT-PMP): initnatpmp succeeded (0)
[14:45:01.752] Port Forwarding (NAT-PMP): sendpublicaddressrequest succeeded (2)
Progress: 0.0%, dl from 0 of 0 peers (0 kB/s), ul to 0 (0 kB/s) [None]    [14:45:09.760] Port Forwarding: State changed from “Not forwarded” to “Starting”
Progress: 0.0%, dl from 0 of 1 peers (0 kB/s)
[14:45:11.828] ubuntu-14.10-desktop-amd64.iso: Could not connect to tracker
[14:45:11.828] ubuntu-14.10-desktop-amd64.iso: Retrying announce in 313 seconds.
Progress: 0.4%, dl from 8 of 46 peers (2.54 MB/s), ul to 0 (0 kB/s) [0.00]      
[14:45:28.001] ubuntu-14.10-desktop-amd64.iso: Starting IPv4 DHT announce (poor, 18 nodes)
Progress: 3.5%, dl from 17 of 62 peers (7.15 MB/s), ul to 0 (0 kB/s) [0.00]     
[14:45:32.341] ubuntu-14.10-desktop-amd64.iso: Scrape error: Could not connect to tracker
[14:45:32.341] ubuntu-14.10-desktop-amd64.iso: Retrying scrape in 957 seconds.
Progress: 5.9%, dl from 26 of 60 peers (12.08 MB/s), ul to 0 (0 kB/s) [0.00]
        –> 다운로드중
 
다운로드가 완료되면 완료되었다는 메세지가 나옵니다.
Progress: 99.9%, dl from 46 of 60 peers (397 kB/s), ul to 2 (0 kB/s) [0.00]     
[14:46:52.201] ubuntu-14.10-desktop-amd64.iso: State changed from “Incomplete” to “Complete”
 
다운로드가 완료 되면 업로더로 제공할 의사가 없다면 Ctrl + C를 눌러서 나옵니다.
또한 자동으로 다운로드 완료후 끈어버릴려면 -f 옵션을 이용해서 스크립트를 연결하면 됩니다.
# transmission-cli -f torrent-down.sh ubuntu-14.10-desktop-amd64.iso.torrent
example) 
torrent-down.sh
#!/bin/bash
sleep 5
killall transmission-cli
 
다운로드된 파일에 위치는 ~/Downloads/
저는 root 계정으로 로그인해서 작업하였기에 제 파일다운로드 위치는 /root/Downloads/ubuntu-14.10-desktop-amd64.iso
 
세부옵션은 아래부분을 참고하시기 바랍니다.
# transmission-cli  –help
transmission-cli 2.77 (14031)
A fast and easy BitTorrent client
 
Usage: transmission-cli [options] <file|url|magnet>
Options:
 -h  –help                          Display this help page and exit
 -b  –blocklist                     Enable peer blocklists
 -B  –no-blocklist                  Disable peer blocklists
 -d  –downlimit            <speed>  Set max download speed in kB/s
 -D  –no-downlimit                  Don’t limit the download speed
 -er –encryption-required           Encrypt all peer connections
 -ep –encryption-preferred          Prefer encrypted peer connections
 -et –encryption-tolerated          Prefer unencrypted peer connections
 -f  –finish               <script> Run a script when the torrent finishes   :: 다운로드 완료이후 스크립트 실행
 -g  –config-dir           <path>   Where to find configuration files
 -m  –portmap                       Enable portmapping via NAT-PMP or UPnP
 -M  –no-portmap                    Disable portmapping
 -p  –port                 <port>   Port for incoming peers (Default: 51413)
 -t  –tos                  <tos>    Peer socket TOS (0 to 255,
                                     default=default)
 -u  –uplimit              <speed>  Set max upload speed in kB/s  :: 업로드 제한
 -U  –no-uplimit                    Don’t limit the upload speed
 -v  –verify                        Verify the specified torrent
 -V  –version                       Show version number and exit
 -w  –download-dir         <path>   Where to save downloaded data
 
 
★ 필독))
토렌토 시드상에서는 워낙 많은 유해파일들이 돌아다니기에 토렌토를 이용해서 다운로드 이전에는 반드시 파일에 무결성검사를 체크해보시기 바립니다. 방법은 아래와 같습니다.
torrent1
 
 # wget http://releases.ubuntu.com/14.10/SHA256SUMS
# wget http://releases.ubuntu.com/14.10/SHA256SUMS.gpg
# yum install -y gpg
 
# gpg –verify SHA256SUMS.gpg SHA256SUMS
gpg: Signature made Thu Oct 23 22:36:00 2014 KST using DSA key ID FBB75451
gpg: Can’t check signature: public key not found
 
위와같은 에러가 발생하는 경우는 서명을 사용할때 공개키를 가져오지 않아서 발생되는 에러입니다. GPG 명령어 메세지에 출력되는 키 ID를 통해 공식 우분투 키서버에서 공개키를 가져온후 다시 실행합니다.
 
# gpg –keyserver hkp://keyserver.ubuntu.com –recv-keys FBB75451
gpg: requesting key FBB75451 from hkp server keyserver.ubuntu.com
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key FBB75451: public key “Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com>” imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
 
# gpg –verify SHA256SUMS.gpg SHA256SUMS
빨간색박스처럼 Good signature 메세지 확인
 torrent2
 
SHA256SUM 파일의 무결성을 검증한 이후에는 SHA256SUM 파일에 대응하는 체크섬값과 ISO 파일에 SHA256 체크섬을 비교합니다. 아래와 같은 명령어로 두 체크섬값의 일치함을 확인하면 해당 이미지는 무결성이 확인된 ISO 이미지 입니다.
 
# sha256sum -c <(grep ubuntu-14.10-desktop-amd64.iso SHA256SUMS)
ubuntu-14.10-desktop-amd64.iso: OK
 
 
[polldaddy rating=”7739789″]

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 항목은 *(으)로 표시합니다