[讨论]archlinux pcman 与debian apt-get 的对比
- skyx
- 论坛版主
- 帖子: 9202
- 注册时间: 2006-12-23 13:46
- 来自: Azores Islands
- 联系:
[讨论]archlinux pcman 与debian apt-get 的对比
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.
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
- 联系:
- skyx
- 论坛版主
- 帖子: 9202
- 注册时间: 2006-12-23 13:46
- 来自: Azores Islands
- 联系:
- zhuqin_83
- 帖子: 10606
- 注册时间: 2006-05-13 4:02
- 联系:
- skyx
- 论坛版主
- 帖子: 9202
- 注册时间: 2006-12-23 13:46
- 来自: Azores Islands
- 联系:
没买硬盘,我要装,本地源肯定是要全部镜像的。 现在也没太多时间,人都有些懒,可能花好长时间装好,用起来还是和ubuntu一样,各大linux发行版本质上也没什么区别,另外,我不太喜欢精简的系统,我追求的是美式风格,最好什么都给我装上,硬盘和内存我都不在乎。zhuqin_83 写了:赶紧装一个试试吧。
我正在看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)
- 联系:
- zhuqin_83
- 帖子: 10606
- 注册时间: 2006-05-13 4:02
- 联系:
尤其是我翻的对吧?中文的文档我不太爱看,一般的翻译都不精彩,英文原作者的那种心境变成中文后都找不到了。
我不建议你本地源,因为更新实在太快,每天都要好几次。
这个不是精简,而是你不要的他绝对不会给你自作主张的加上,美式风格。。。不懂,美式就=都给你弄上么?
arch=kiss=keep it simple, stupid.是简单,简洁。用起来么,各大发行版应该有些区别的,尤其是包管理方式和附加的所谓发行版特色,和相应的理念了。
arch是user-centric,但不是ubuntu的newbie-centric。你应该看的第一篇文章是:the arch way,然后是Arch Compared To Other Distros,接着就可以直接看beginners guide了。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.
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
DELL UltraSharp 2209WA
Arch64, Testing repo
- skyx
- 论坛版主
- 帖子: 9202
- 注册时间: 2006-12-23 13:46
- 来自: Azores Islands
- 联系:
- shellex
- 帖子: 2180
- 注册时间: 2007-02-18 19:33
- 系统: OSX
- 来自: lyric.im
- 联系:
- zhuqin_83
- 帖子: 10606
- 注册时间: 2006-05-13 4:02
- 联系:
- karron
- 帖子: 6226
- 注册时间: 2005-06-11 14:03
- 来自: 不明真相的群众
- 联系:
装多点好, 至少用起来的时候不会缺胳膊少腿... 就比如, vista明明 business或者home premium版本就可以用了, 但是就是要安装个ultimate...
没什么精力去调整系统, 没有必要. 有时间还不如去玩玩别的, 实在没事情干可以打打魔兽.
所以, 我要用要么就是kubuntu, 要么就是opensuse, 不过kubuntu用习惯了, opensuse怎么用怎么不习惯, 你说我费半天力气去把opensuse配习惯了, 就又搞得和kubuntu差不多了, 就没什么意思了.
嗯, 对于懒人, 我还是强烈推荐opensuse, 真的很不错, 可惜既生瑜何生亮啊, kubuntu再怎末不好, 我已经用习惯了.
没什么精力去调整系统, 没有必要. 有时间还不如去玩玩别的, 实在没事情干可以打打魔兽.
所以, 我要用要么就是kubuntu, 要么就是opensuse, 不过kubuntu用习惯了, opensuse怎么用怎么不习惯, 你说我费半天力气去把opensuse配习惯了, 就又搞得和kubuntu差不多了, 就没什么意思了.
嗯, 对于懒人, 我还是强烈推荐opensuse, 真的很不错, 可惜既生瑜何生亮啊, kubuntu再怎末不好, 我已经用习惯了.
上次由 karron 在 2008-02-05 7:11,总共编辑 1 次。
我的blog,关于技术,软件,linux,vim <---- 所有博客均被河蟹.