Chủ Nhật, 22 tháng 6, 2014

Tải package từ external repositories

Ngoài official repositories của ubuntu, trên thế giới còn nhiều repositories khác nữa như ppa...Đôi khi package bạn cần không thể tìm thấy trên official repositories của ubuntu, bạn có hai lựa chọn: Một là biên dịch và cài từ source code. Cách này đôi khi khá vất vả vì vấn đề dependencies và tương thích. Hai là tìm và tải package từ một external repositories. Trong tutorial này, tôi viết về cách thứ hai.

Ví dụ tôi muốn tải phần mềm movgrab - một chương trình download video từ các trang chia sẻ nhưng tôi không tìm thấy trên ubuntu official. Tôi tìm kiếm đoạn ppa của movgrab từ http://www.webupd8.org/2012/02/movgrab-command-line-video-downloader.html

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install movgrab

Tất cả các repository bao gồm official, external third party repositories của ubuntu đều nằm trong /etc/apt/sources.list và /etc/apt/sources.list.d/ Lệnh add-apt-repository chỉ thực hiện thêm một cặp entry deb và deb-src vào trong file /etc/apt/sources.list hoặc một file nằm trong thư mục /etc/apt/sources.list.d/ 

Kết quả của câu lệnh sudo add-apt-repository ppa:nilarimogard/webupd8
sẽ tạo ra file /etc/apt/sources.list.d/nilarimogard-webupd8-precise.list chứa cặp entry:
deb http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu precise main
deb-src http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu precise main


Thay vì chạy lệnh add-apt-repository, bạn có thể chỉnh sửa file /etc/apt/sources.list, điền vào cặp entry deb và deb-src. Tôi từng tải ultramonkey theo cách này. Tôi tìm thấy thông tin deb và deb-src cho ultramonkey
từ http://www.ultramonkey.org/3/installation-debian.sarge.html Tôi bổ sung cặp entry vào cuối /etc/apt/sources.list
deb http://www.ultramonkey.org/download/3/ sarge main
deb-src http://www.ultramonkey.org/download/3 sarge main

Sau đó update repo và tải:
sudo apt-get update
sudo apt-get install ultramonkey

Không có nhận xét nào:

Đăng nhận xét