post | sidebar | footer
Showing posts with label APT. Show all posts
Showing posts with label APT. Show all posts

August 1, 2008

apt 套件如何設定 configure 的規則

0 迴響
簡單來說,利用 apt-get 先把 source 及相關套件抓下來。更改過設定後,再利用 dpkg 重新 complier 安裝。


# 安裝相關使用套件
shell> apt-get install build-essential debhelper fakeroot

# 到 apt 存放原始碼的路徑 /usr/src
shell> cd /usr/src

# 下載套件原始碼
shell> apt-get source pkg

# build-dep 套件
shell> apt-get build-dep pkg
shell> cd pkg-version

# 接著在 debian/rules 裡就可以編輯你想要的 configure 規則

# 利用 dpkg-buildpackage build 該套件,並回上一層
shell> dpkg-buildpackage -rfakeroot
shell> cd ..

# 安裝重新變動過設定的套件
shell> dpkg -i pkg-xxx_i386.deb


以上的過程是在找 PHP5 跟 GD library 需變動設定規則時看到的。來源是 http://cumu.li/2008/5/13/recompiling-php5-with-bundled-support-for-gd-on-ubuntu

January 31, 2008

apt 常用參數

0 迴響
apt-cache search [關鍵字] - 搜尋未安裝套件
apt-get install [套件名稱] - 安裝新套件
apt-get remove [套件名稱] - 移除套件但不刪除設定檔
    apt-get remove --purge [套件名稱] - 刪除套件也刪除設定檔
apt-cache depends [套件名稱] - 顯示套件相依的相關資訊

apt-get clean - 移除所有套件的 deb 暫存檔
apt-get autoclean - 移除舊版所有套件的 deb 暫存檔
ps: apt 下載安裝過的檔案會放在 /var/cache/apt/archives/ 裡面,
      apt-get clean / autoclen 會清除在裡面的檔案。所以只要沒執行過這兩個指
      令,都可以到這個路徑看到已經有安裝過哪些檔案。

apt-cache show [套件名稱] - 列出套件詳細資訊
apt-cache stats - 套件庫中的資訊
apt-setup - 設定 /etc/apt/sources.list

apt-get update - 更新套件索引
apt-get upgrade - 升級已安裝套件
apt-get dist-upgrade - 考慮套件相依性進行升級
    apt-get -s dist-upgrade - 列出過程中執行的動作
    apt-get -d dist-upgrade - 僅下載相關套件,而不安裝
    apt-get -y dist-upgrade - 用 yes 回答所有設定問答

apt-update.sh
    #! /bin/bash
    apt-get update
    apt-get -y -d dist-upgrade
    apt-get -s dist-upgrade

April 16, 2007

apt-get install : couldn't find package 的解決方式

0 迴響
#apt-get install joe
Reading package list… Done
building dependences list… Done
E: couldnt find package

#vi /etc/apt/sources.list
deb http://tw.archive.ubuntu.com/ubuntu/ edgy-updates main restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ edgy-updates main restricted

deb http://tw.archive.ubuntu.com/ubuntu/ edgy universe
deb-src http://tw.archive.ubuntu.com/ubuntu/ edgy universe

deb http://tw.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe
deb-src http://tw.archive.ubuntu.com/ubuntu/ edgy-backports main restricted universe

deb http://security.ubuntu.com/ubuntu edgy-security main restricted
deb-src http://security.ubuntu.com/ubuntu edgy-security main restricted
deb http://security.ubuntu.com/ubuntu edgy-security universe
deb-src http://security.ubuntu.com/ubuntu edgy-security universe

#apt-get update

#apt-get install joe