Gentoo/Debian/FreeBSD套件管理memo

Moderator: Forums Team

pahud
24hr 義工
Posts: 1251
Joined: Tue Nov 26, 2002 10:22 pm
Contact:

Post by pahud »

update: 新增
. 察看升級全系統會動到哪些套件
Join GOT@SETI now!
skychaser
Posts: 23
Joined: Tue Mar 02, 2004 11:07 pm

Post by skychaser »

提供一些以前用debian的心得~

升級單一軟體
Gentoo: emerge -u <package>
Debian: apt-get install <package>
FreeBSD: portupgrade <package>
<need portupgrade>

查詢某個套件安裝了什麼檔案
Gentoo: qpkg -l <pkg>
credit to paar@gentoo.org.tw
Debian: dpkg -L <pkg>
FreeBSD: pkg_info -L <pkg>

全系統重新編譯
Gentoo: emerge -e world
Debian: apt-get update;apt-get upgrade
FreeBSD: make world ; portupgrade -arf
<need portupgrade>
ycheng
Posts: 1
Joined: Thu May 27, 2004 11:46 pm

Post by ycheng »

找哪些 pkg "簡介" 裡含有你要找的關鍵字:
Debian: apt-cache search <keyword>

不管相依性強制移除某套件:
Debian: apt-get remove <package>

察看升級全系統會動到哪些套件:
Debian: apt-get -s upgrade
(或 apt-get -s dist-upgrade)

只 Download 而不升級套件:
Debian: apt-get -d upgrade / apt-get -d dist-upgrade / apt-get -d install <package>
d2207197
Posts: 197
Joined: Sun Dec 21, 2003 5:46 pm
Location: 新竹市

Post by d2207197 »

Code: Select all

升級單一軟體
Gentoo: emerge -u <package>
Debian: ?
FreeBSD: portupgrade <package>
<need portupgrade>
直接 apt-get install <package>
若有更新,就會升級該軟體了
d2207197
Posts: 197
Joined: Sun Dec 21, 2003 5:46 pm
Location: 新竹市

Post by d2207197 »

Code: Select all

Gentoo: qpkg -l <pkg>
Debian: ?
FreeBSD: pkg_info -L <pkg>
Debian: dpkg -L <pkg>
d2207197
Posts: 197
Joined: Sun Dec 21, 2003 5:46 pm
Location: 新竹市

Post by d2207197 »

Code: Select all

查詢有沒有裝這個關鍵字的套件
Gentoo: qpkg -I | grep <keyword> (qpkg再[上 -v 看版本號碼)
Debian:
FreeBSD: pkg_info | grep <keyword>
若是套件名稱而已,可以用
dpkg -l '*keyword*'

若搜尋範圍含蓋套件說明
dpkg -S <keyword>
d2207197
Posts: 197
Joined: Sun Dec 21, 2003 5:46 pm
Location: 新竹市

Post by d2207197 »

Code: Select all

Gentoo: emerge -C <pkg>
Debian:
FreeBSD: pkg_delete -f <pkg>
dpkg -r --force-depends <pkg>
dpkg -P --force-depends <pkg>

上面是 remove ,下面是 purge
使用 remove 不會清掉設定檔,用 purge 才會
scsi
Posts: 1326
Joined: Tue Oct 14, 2003 7:49 am
Contact:

Post by scsi »

d2207197 wrote:

Code: Select all

升級單一軟體
Gentoo: emerge -u <package>
Debian: ?
FreeBSD: portupgrade <package>
<need portupgrade>
直接 apt-get install <package>
若有更新,就會升級該軟體了

Code: Select all

emerge -u <pkg>
會更新<pkg>外,還會更新所有與<pkg>這個軟體直接相依的軟體
--update (-u)
Updates packages to the best version available, which may not always be the highest version number due to masking for testing
and development. This will also update direct dependencies which may not what you want. In general use this option only in
combination with the world or system target.
世界再大,不過是妳我之間的事
:111.gif: 欲使用GOT的ebuild請看Gentoo 台灣中文 Ebuild 使用指南
Image  我的部落格
d2207197
Posts: 197
Joined: Sun Dec 21, 2003 5:46 pm
Location: 新竹市

Post by d2207197 »

apt-get install 也會阿
scsi
Posts: 1326
Joined: Tue Oct 14, 2003 7:49 am
Contact:

Post by scsi »

d2207197 wrote:apt-get install 也會阿
so ga
世界再大,不過是妳我之間的事
:111.gif: 欲使用GOT的ebuild請看Gentoo 台灣中文 Ebuild 使用指南
Image  我的部落格
scsi
Posts: 1326
Joined: Tue Oct 14, 2003 7:49 am
Contact:

Post by scsi »

d2207197 wrote:apt-get install 也會阿
install
install is followed by one or more packages desired for installation. Each package is a package name, not a fully qualified filename (for instance, in a Debian GNU/Linux system, libc6 would be the argument provided, not libc6_1.9.6-2.deb). All packages required by the package(s) specified for installation will also be retrieved and installed. The /etc/apt/sources.list file is used to locate the desired packages. If a hyphen is appended to the package name (with no intervening space), the identified package will be removed if it is installed. Similarly a plus sign can be used to designate a package to install. These latter features may be used to override decisions made by apt-get's conflict resolution system.
從這個man page來看,似乎apt-get install並沒有提到我所說的也能更新直接相依的軟體的功能
我以前使用redhat的apt的時候,似乎也沒有這樣的功能
還是debian的apt跟redhat不大一樣呢?
世界再大,不過是妳我之間的事
:111.gif: 欲使用GOT的ebuild請看Gentoo 台灣中文 Ebuild 使用指南
Image  我的部落格
d2207197
Posts: 197
Joined: Sun Dec 21, 2003 5:46 pm
Location: 新竹市

Post by d2207197 »

Code: Select all

mail:[/home/joeyen/PCManX-0-1-4]# apt-get dist-upgrade
讀取套件清單中... Done
了解套件依存關係中... Done
Calculating Upgrade... 完成
The following packages will be upgraded:
  base-config esound esound-common gksu gnome-applets gnome-applets-data
  gnome-gv gnome-panel gnome-panel-data gsfonts lesstif1 lesstif2 libcurl2
  libcurl3 libesd0 libesd0-dev libgcrypt11 libgnutls11 libkrb-1-kerberos4kth
  libmikmod2 libnspr4 libnss3 libopencdk8 libpanel-applet2-0
  libroken16-kerberos4kth libselinux1 libsnmp-base libsnmp5 libtdb1 man2html
  mozilla-browser mozilla-psm php4 php4-mysql
34 upgraded, 0 newly installed, 刪除 0 個套件,另不更新 0 個套件。
需要下載 33.1MB 的檔案。
解壓縮後將空出 1894kB 的空間。
繼續執行嗎? 是按 [Y] 鍵,否按 [n] 鍵 n
放棄執行。
mail:[/home/joeyen/PCManX-0-1-4]# apt-get install gnome-panel
讀取套件清單中... Done
了解套件依存關係中... Done
下列的【新】套件都將被安裝:
  gnome-panel-data
Suggested packages:
  gnome2-user-guide gnome-system-tools
The following packages will be upgraded:
  gnome-panel gnome-panel-data
2 upgraded, 0 newly installed, 刪除 0 個套件,另不更新 32 個套件。
需要下載 2646kB 的檔案。
解壓縮後將空出 1286kB 的空間。
繼續執行嗎? 是按 [Y] 鍵,否按 [n] 鍵
連帶更新是這樣嗎?
我執行 apt-get dist-upgrade 時,發現有 gnome-panel 要更新
於是執行 apt-get install gnome-panel,他也連帶更新 gnome-panel-data

這應該是理所當然的吧,apt 就是要處理相依問題阿。
scsi
Posts: 1326
Joined: Tue Oct 14, 2003 7:49 am
Contact:

Post by scsi »

d2207197 wrote: [略]
連帶更新是這樣嗎?
我執行 apt-get dist-upgrade 時,發現有 gnome-panel 要更新
於是執行 apt-get install gnome-panel,他也連帶更新 gnome-panel-data

這應該是理所當然的吧,apt 就是要處理相依問題阿。
這個可能還要再看軟體的相依的設定才能確定
比如說
軟體 sw_a-1.0 的相依關係是
sw_b (不限定版本或>=1.0版)及 sw_c-1.0
所以假設當第一次安裝 sw_a時會安裝
sw_b-1.0
sw_c-1.0
sw_a-1.0
而現在版本都升了一級,變成
sw_b-2.0
sw_c-2.0
sw_a-2.0

sw_a的相依性也變成了
sw_b (不限定版本或>=1.0版)及 sw_c-2.0

在此時,當執行emerge -u sw_a 會update
sw_b-2.0
sw_c-2.0
sw_a-2.0

那apt-get install sw_a呢?
以我的認知是,當執行apt-get install sw_a 只會update
sw_c-2.0
sw_a-2.0
sw_b會保持在1.0的版本

如有錯誤,請指教
世界再大,不過是妳我之間的事
:111.gif: 欲使用GOT的ebuild請看Gentoo 台灣中文 Ebuild 使用指南
Image  我的部落格
d2207197
Posts: 197
Joined: Sun Dec 21, 2003 5:46 pm
Location: 新竹市

Post by d2207197 »

scsi wrote:
d2207197 wrote: [略]
連帶更新是這樣嗎?
我執行 apt-get dist-upgrade 時,發現有 gnome-panel 要更新
於是執行 apt-get install gnome-panel,他也連帶更新 gnome-panel-data

這應該是理所當然的吧,apt 就是要處理相依問題阿。
這個可能還要再看軟體的相依的設定才能確定
比如說
軟體 sw_a-1.0 的相依關係是
sw_b (不限定版本或>=1.0版)及 sw_c-1.0
所以假設當第一次安裝 sw_a時會安裝
sw_b-1.0
sw_c-1.0
sw_a-1.0
而現在版本都升了一級,變成
sw_b-2.0
sw_c-2.0
sw_a-2.0

sw_a的相依性也變成了
sw_b (不限定版本或>=1.0版)及 sw_c-2.0

在此時,當執行emerge -u sw_a 會update
sw_b-2.0
sw_c-2.0
sw_a-2.0

那apt-get install sw_a呢?
以我的認知是,當執行apt-get install sw_a 只會update
sw_c-2.0
sw_a-2.0
sw_b會保持在1.0的版本

如有錯誤,請指教
了解,apt 是這樣沒錯
但其實使用 apt 的人通常是全系統一起更新
apt-get dist-upgrade
或許使用習慣上與 gentoo 不太相同
也無法分優劣
scsi
Posts: 1326
Joined: Tue Oct 14, 2003 7:49 am
Contact:

Post by scsi »

d2207197 wrote:<略>
了解,apt 是這樣沒錯
但其實使用 apt 的人通常是全系統一起更新
其實很多emerge的人也是全系統一起更新的,像我就是個典型的例子

Code: Select all

emerge -uD world
or
emerge -UD world
另外也有跟apt-get install <pkg>一模一樣的功能的指令,那就是

Code: Select all

emerge <pkg>
d2207197 wrote:apt-get dist-upgrade
或許使用習慣上與 gentoo 不太相同
也無法分優劣
的確,這只是習慣的不同,沒有誰比較好誰比較不好
我只是要說明emerge -u pkg 跟apt-get install <pkg> 的確是不一樣的
因為這個討論串是功能對照的討論,可能會有人來這裡找對照的功能,所以必需要清楚
世界再大,不過是妳我之間的事
:111.gif: 欲使用GOT的ebuild請看Gentoo 台灣中文 Ebuild 使用指南
Image  我的部落格
Post Reply