[讨论]archlinux pcman 与debian apt-get 的对比

其他Linux/Unix/BSD/OSX等发行版讨论
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

[讨论]archlinux pcman 与debian apt-get 的对比

#1

帖子 skyx » 2008-02-04 14:45

http://wiki.archlinux.org/index.php/Off ... tall_Guide

图片

Package Management


pacman is the package manager which tracks all the software installed on your system. It has simple dependency support and uses the standard gzipped tar archive format for all packages. Some common tasks are explained below with the respective commands in long and short option form. For an up to date explanation of pacman's options, read man pacman. This overview is merely scratching the surface of pacman's current capabilities.

Typical tasks:

1. Adding a new package with a package file 2. Upgrading a package with a package file 3. Removing packages 4. Refreshing the package list 5. Upgrading the system 6. Adding/Upgrading a package from the repositories 7. List installed packages 8. Check if a specific package is installed 9. Display specific package info 10. Display list of files contained in package 11. Find out which package a specific file belongs to

Adding a new package with a package file

pacman --add foo.pkg.tar.gz
pacman -A foo.pkg.tar.gz

This will install the foo.pkg.tar.gz package on the system. If dependencies are missing, pacman will exit with an error and report the missing deps, but not attempt to resolve the dependencies automatically. Look at the --sync option if you expect this functionality. Adding multiple package files is possible, and if the listed files depend on each other, the packages will be automatically installed in the correct order.

Upgrading a package with a package file

pacman --upgrade foo.pkg.tar.gz
pacman -U foo.pkg.tar.gz

This does essentially the same as the --add operation, but will additionally upgrade an already-installed package at no extra cost. I can personally not imagine a case where you'd prefer --add over this --upgrade function, unless you want pacman to exit if a package is already installed.

Removing packages

pacman --remove foo
pacman -R foo

This will remove all files belonging to the package named foo, except for configuration files that have been edited. Only supply the name of the package to this command, without the pkg.tar.gz suffix.

To remove any and all trace of a package, add the --nosave option to the above command.

Refreshing the package list

pacman --sync --refresh
pacman -Sy

This will retrieve a fresh master package list from the repositories defined in the /etc/pacman.conf file and uncompress it into the database area. You should use this before using --sysupgrade to make sure you get the newest packages. Depending on your pacman.conf settings, this command may require a working internet connection to access FTP/HTTP-based repositories. This option is quite similar to Debian's apt-get update command.

Upgrading the system

pacman --sync --sysupgrade
pacman -Su

This command will upgrade all packages that are out-of-date on your system by comparing the local package version to the versions in the master package list that get downloaded with the --refresh command. It's a good idea to run this regularly to keep your system up to date. Note that this command does NOT implicitly refresh the master package list, so it's usually wiser to combine both commands into one like this:

pacman --sync --refresh --sysupgrade
pacman -Syu

With these options pacman will automatically retrieve the current master package list and do a full system upgrade to the latest packages with all dependencies being automagically resolved. You will want to run this quite often.

Adding/Upgrading a package from the repositories

pacman --sync foo
pacman -S foo

Retrieve and install package foo, complete with all dependencies it requires. Before using any sync option, make sure you refreshed the package list, or add --refresh or -y to the options to do it before the installation attempt. Unlike --add, the --sync option does not differ between installing and upgrading packages. Depending on your pacman.conf settings this function requires working internet access.

Receiving strange errors when downloading packages from the server, ie. broken downloads or files that aren't found, usually are either caused by not refreshing the package list with --sync, or if you're unlucky enough to try downloading from a mirror while it's syncing its contents, and is thus in an inconsistent state.

List installed packages

pacman --query
pacman -Q

Displays a list of all installed packages in the system.

Check if a specific package is installed

pacman --query foo
pacman -Q foo

Instead of grepping the full list for a name, you can append the name of the package you are looking for to the query command. This command will display the name and version of the foo package if it is installed, nothing otherwise.

Display specific package info

pacman --query --info foo
pacman -Qi foo

Displays information on the installed package foo (size, install date, build date, dependencies, conflicts, etc.). To display this information for a package file that is not yet installed, add the --file or -p option, respectively:

pacman --query --info --file foo.pkg.tar.gz
pacman -Qip foo.pkg.tar.gz

Display list of files contained in a package

pacman --query --list foo
pacman -Ql foo

Lists all files belonging to package foo.

Find out which package a specific file belongs to

pacman --query --owns /path/to/file
pacman -Qo /path/to/file

This query displays the name and version of the package which contains the file referenced by it's full path as a parameter. Just using the file name without the path will not yield results.
no security measure is worth anything if an attacker has physical access to the machine
头像
zhuqin_83
帖子: 10606
注册时间: 2006-05-13 4:02
联系:

#2

帖子 zhuqin_83 » 2008-02-04 20:43

丫头,对比呢?我没看到apt阿。
HP Pavilion DV6-2064CA: AMD Turion II Ultra Dual-Core Mobile M640, HD4650, 2GBx2 DDR2-800, Seagate 500GB 7200RPM SATA, BD-ROM
DELL UltraSharp 2209WA
Arch64, Testing repo
头像
jarryson
帖子: 4002
注册时间: 2005-08-14 19:53

#3

帖子 jarryson » 2008-02-04 21:38

感觉pacman比较简单。不过比方搜索功能也不强。。不过幸好有很多替换的软件
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

#4

帖子 skyx » 2008-02-04 21:46

zhuqin_83 写了:丫头,对比呢?我没看到apt阿。
只是在这里抛砖引玉
no security measure is worth anything if an attacker has physical access to the machine
头像
zhuqin_83
帖子: 10606
注册时间: 2006-05-13 4:02
联系:

#5

帖子 zhuqin_83 » 2008-02-04 22:18

赶紧装一个试试吧。
HP Pavilion DV6-2064CA: AMD Turion II Ultra Dual-Core Mobile M640, HD4650, 2GBx2 DDR2-800, Seagate 500GB 7200RPM SATA, BD-ROM
DELL UltraSharp 2209WA
Arch64, Testing repo
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

#6

帖子 skyx » 2008-02-04 22:33

zhuqin_83 写了:赶紧装一个试试吧。
没买硬盘,我要装,本地源肯定是要全部镜像的。 现在也没太多时间,人都有些懒,可能花好长时间装好,用起来还是和ubuntu一样,各大linux发行版本质上也没什么区别,另外,我不太喜欢精简的系统,我追求的是美式风格,最好什么都给我装上,硬盘和内存我都不在乎。

我正在看lfs book ,看了不一定去试,只是想更深入的了解linux .另外debian的也在看,ubuntu的也不放过,中文的文档我不太爱看,一般的翻译都不精彩,英文原作者的那种心境变成中文后都找不到了。
no security measure is worth anything if an attacker has physical access to the machine
头像
millenniumdark
论坛版主
帖子: 4159
注册时间: 2005-07-02 14:41
系统: Ubuntu 14.04 (Kylin)
联系:

#7

帖子 millenniumdark » 2008-02-04 22:45

skyx 写了:另外,我不太喜欢精简的系统,我追求的是美式风格,最好什么都给我装上,硬盘和内存我都不在乎。
我也是喜欢什么都给我装上,但是同时在乎硬盘和内存。
skyround
帖子: 96
注册时间: 2006-05-13 15:25

#8

帖子 skyround » 2008-02-04 22:48

嫌pacman索功能不强可以用tupac
头像
zhuqin_83
帖子: 10606
注册时间: 2006-05-13 4:02
联系:

#9

帖子 zhuqin_83 » 2008-02-04 22:50

中文的文档我不太爱看,一般的翻译都不精彩,英文原作者的那种心境变成中文后都找不到了。
尤其是我翻的对吧? :lol:
我不建议你本地源,因为更新实在太快,每天都要好几次。
这个不是精简,而是你不要的他绝对不会给你自作主张的加上,美式风格。。。不懂,美式就=都给你弄上么?
arch=kiss=keep it simple, stupid.是简单,简洁。用起来么,各大发行版应该有些区别的,尤其是包管理方式和附加的所谓发行版特色,和相应的理念了。
Arch Linux defines simplicity as a lightweight base structure without unnecessary additions, modifications, or complications, that allows an individual user to shape the system according to their own needs. In short; an elegant, minimalist approach.
arch是user-centric,但不是ubuntu的newbie-centric。你应该看的第一篇文章是:the arch way,然后是Arch Compared To Other Distros,接着就可以直接看beginners guide了。
HP Pavilion DV6-2064CA: AMD Turion II Ultra Dual-Core Mobile M640, HD4650, 2GBx2 DDR2-800, Seagate 500GB 7200RPM SATA, BD-ROM
DELL UltraSharp 2209WA
Arch64, Testing repo
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

#10

帖子 skyx » 2008-02-04 22:57

millenniumdark 写了:
skyx 写了:另外,我不太喜欢精简的系统,我追求的是美式风格,最好什么都给我装上,硬盘和内存我都不在乎。
我也是喜欢什么都给我装上,但是同时在乎硬盘和内存。

现在内存一百多块1G,花时间精简还不如加一天班后上街去买几条内存
no security measure is worth anything if an attacker has physical access to the machine
头像
shellex
帖子: 2180
注册时间: 2007-02-18 19:33
系统: OSX
来自: lyric.im
联系:

#11

帖子 shellex » 2008-02-04 23:10

Arch的新logo?还不错
头像
zhuqin_83
帖子: 10606
注册时间: 2006-05-13 4:02
联系:

#12

帖子 zhuqin_83 » 2008-02-04 23:10

我用arch和内存可没有关系,再怎么不精简的linux发行版也不会耗费多少,主要是速度,定制以及简单配置。
HP Pavilion DV6-2064CA: AMD Turion II Ultra Dual-Core Mobile M640, HD4650, 2GBx2 DDR2-800, Seagate 500GB 7200RPM SATA, BD-ROM
DELL UltraSharp 2209WA
Arch64, Testing repo
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#13

帖子 eexpress » 2008-02-04 23:10

从来没人关注过aptitude的搜索功能。
● 鸣学
头像
karron
帖子: 6226
注册时间: 2005-06-11 14:03
来自: 不明真相的群众
联系:

#14

帖子 karron » 2008-02-04 23:10

装多点好, 至少用起来的时候不会缺胳膊少腿... 就比如, vista明明 business或者home premium版本就可以用了, 但是就是要安装个ultimate...

没什么精力去调整系统, 没有必要. 有时间还不如去玩玩别的, 实在没事情干可以打打魔兽.

所以, 我要用要么就是kubuntu, 要么就是opensuse, 不过kubuntu用习惯了, opensuse怎么用怎么不习惯, 你说我费半天力气去把opensuse配习惯了, 就又搞得和kubuntu差不多了, 就没什么意思了.

嗯, 对于懒人, 我还是强烈推荐opensuse, 真的很不错, 可惜既生瑜何生亮啊, kubuntu再怎末不好, 我已经用习惯了.
上次由 karron 在 2008-02-05 7:11,总共编辑 1 次。
我的blog,关于技术,软件,linux,vim <---- 所有博客均被河蟹.
skyround
帖子: 96
注册时间: 2006-05-13 15:25

#15

帖子 skyround » 2008-02-04 23:25

澄清一点,Arch并不是什么精简的系统,而是简洁的系统
回复