Difference between revisions of "Talk:Pacman"

From ArchWiki
Jump to: navigation, search
m (corrected signature)
(testdb)
 
(203 intermediate revisions by 16 users not shown)
Line 1: Line 1:
== Detail missing ==
+
== Description of pacman internals (for new pacman programmers) ==
 +
 
 +
{{META Box Blue|Moderation note:|2=
 +
The previous discussion on this subject (titled [https://wiki.archlinux.org/index.php?title=Talk:Pacman&oldid=252437#Detail_missing Detail missing]) has been seriously derailed in the past. Please let's focus on the original topic, also presented by the current title, i.e. the description of pacman internals and its code base, targeting new pacman programmers. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 21:27, 11 October 2015 (UTC)
 +
}}
 +
 
 
Can someone please add the details of pacman?  There is no explanation of how it works.  What are the components and their interaction?  And how about related dependencies and libraries?  Without that basic flow-chart concept in mind, it is very difficult to understand the roll that third-party additions or frontends might play.
 
Can someone please add the details of pacman?  There is no explanation of how it works.  What are the components and their interaction?  And how about related dependencies and libraries?  Without that basic flow-chart concept in mind, it is very difficult to understand the roll that third-party additions or frontends might play.
  
Line 5: Line 10:
 
::There's [http://allanmcrae.com/2010/11/basic-overview-of-pacman-code/ a tiny bit] on Allan's blog. Details regarding libalpm should be in a separate wiki article. -- [[User:Karol|Karol]] 13:13, 10 February 2012 (EST)
 
::There's [http://allanmcrae.com/2010/11/basic-overview-of-pacman-code/ a tiny bit] on Allan's blog. Details regarding libalpm should be in a separate wiki article. -- [[User:Karol|Karol]] 13:13, 10 February 2012 (EST)
 
::[http://allanmcrae.com/2012/02/the-great-pacman-bug-hunt-of-2012/ Some more, pretty low level, info], also from Allan's blog. -- [[User:Karol|Karol]] 13:24, 11 February 2012 (EST)
 
::[http://allanmcrae.com/2012/02/the-great-pacman-bug-hunt-of-2012/ Some more, pretty low level, info], also from Allan's blog. -- [[User:Karol|Karol]] 13:24, 11 February 2012 (EST)
:Yes, I fully support '''Detail missing''' and I will try to write the paragraph as an Introduction. I am happy that I am not alone on this, as I just had an argument [https://bbs.archlinux.org/viewtopic.php?pid=1225728#p1225728 here]. [[User:Doru001|Doru001]] ([[User talk:Doru001|talk]]) 15:06, 1 February 2013 (UTC)
 
::Well, the improvement is here: [[Pacman#Introduction|Introduction]]. The news statement does not look right. Where are those news about the introduction of systemd and the need to copy a directory of glibc?--[[User:Doru001|Doru001]] ([[User talk:Doru001|talk]]) 16:38, 3 February 2013 (UTC)
 
:::I have reverted these changes. There were a couple of problems with your contribution:
 
:::# You overwrote the [[pacman#Upgrading packages|Upgrading packages]] section without explanation.
 
:::# You over-used personal pronouns. Please read [[Help:Style]].
 
:::# You point to the [[Wiki News]] page as a source for package / update advisories, rather than https://www.archlinux.org/news/.
 
:::I appreciate your effort, but I think this contribution needs improvement before being included at the beginning of one of ArchWiki's most prominent articles. I do agree that a high-level overview like this would be helpful. I would suggest that you avoid using any actual pacman code / commands in this section to avoid duplicating content in the rest of the article. A detailed overview in plain English would be most beneficial.
 
:::I have moved your contribution below:
 
:::-- [[User:Pointone|pointone]] ([[User talk:Pointone|talk]]) 18:07, 3 February 2013 (UTC)
 
  
<pre>
+
== <s>testdb</s> ==
== Introduction ==
+
  
Packages in ''arch repositories'' are constantly upgraded. When a package is upgraded, its old version is removed from the repository. There are no major arch releases. Each package is upgraded as new versions become available from upstream sources. The repository is always coherent. (The packages in the repository always have compatible versions.) This type of repository is called a '''rolling archive'''. Before packages are upgraded in the '''core''', '''extra''' and '''community''' repositories, they are tested in the '''testing''' repository, to ensure that the distribution is stable.
+
IMO it should be added to this page. You can get text from [https://bbs.archlinux.org/viewtopic.php?pid=320958]. --[[User:Beroal|Beroal]] 13:13, 8 November 2010 (EST)
  
{{ic|pacman}} saves to disk a list of packages available in the repository. This list is not automatically updated (refreshed). You can refresh the list using {{ic|pacman -Sy}}. {{ic|pacman -Syy}} refreshes the list even if it appears to be up to date. ({{ic|pacman -Syy}} is a good idea when you change the repository mirror used by {{ic|pacman}}. Mirrors can be out of sync and the package list from the old mirror may not correspond to the package list of the new mirror, even though the dates of the lists may suggest that they do.)  
+
:testdb has been removed in pacman 5.0 [https://projects.archlinux.org/pacman.git/tree/NEWS?h=v5.0.0] -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 09:11, 1 February 2016 (UTC)
  
{{ic|pacman -S ''mypackage''}} installs {{ic|''mypackage''}} and all its dependencies. If {{ic|''mypackage''}} has been upgraded since the last refresh of the package list, then the required version of {{ic|''mypackage''}} will not be found in the repository and {{ic|pacman -S ''mypackage''}} fails with a message. {{ic|''mypackage''}}'s dependencies are listed in the '''Depends On''' entry of {{ic|''mypackage''}}'s ''metainformation''. ({{ic|''mypackage''}}'s ''metainformation'' can be listed with {{ic|pacman -Si ''mypackage''}} for packages in the package list and with {{ic|pacman -Qi ''mypackage''}} for installed packages). If {{ic|''mypackage''}} or its dependencies are already installed, they are upgraded to the version in the package list. If {{ic|pacman -S ''mypackage''}} finds any conflicts (installed packages which are listed in the '''Conflicts With''' entry of the {{ic|''mypackage''}}'s ''metainformation'') then it fails with a message. {{Warning|However, {{ic|pacman -S ''mypackage''}} does not check for broken dependencies which may appear from the possible upgrade of {{ic|''mypackage''}} or one of its dependencies. It is possible that an already installed package which depends on an upgraded package is unable to function with the new version of the upgraded package. This can happen if you have refreshed your package list but you have not upgraded all installed packges and it could break your system.}}
+
:Maybe we should add information about replacement of testdb aka 'Pacman -Dk' -- [[User:S777n|s777n]] ([[User talk:S777n|talk]]) 14:56, 15 April 2016 (UTC)
  
The solution is to never run {{ic|pacman -Sy}}, which could be followed by {{ic|pacman -S ''mypackage''}}, but to always run {{ic|pacman -Syu}}, which upgrades all packages after the refresh of the package list. This ensures that when you run {{ic|pacman -S ''mypackage''}} all packages installed on the system have compatible versions.  
+
== pacman.log ==
  
When you run {{ic|pacman -Syu}} there is a small chance that you will have to perform corrections on your system in order to have it running as you like. Important corrections are advertised here: [[Wiki News]]. They are very rare (three in 2012). However, you may like to run {{ic|pacman -Syu}} only when you have time to perform corrections and not when you rely on your system. It is a good idea to run {{ic|pacman -Syu}} often in order to minimize the difficulty of adjustment, whenever it arises.  
+
There are (as of this writing) two places on this page which say that <code>pacman</code>'s output is logged to <code>/var/log/pacman.log</code>. Obviously in the strictest sense this is false, as can easily be seen by anybody who's glanced at this file and at <code>pacman</code>'s on-screen output. Ordinarily, this wouldn't be a problem, as it's clear what is meant. But there's also some information which is ''not'' logged, and this fact is unclear.
  
{{ic|pacman -R ''mypackage''}} removes {{ic|''mypackage''}}. If other packages depend on {{ic|''mypackage''}}, then it fails with a message. In order to remove them too, run {{ic|pacman -Rc ''mypackage''}}. {{Warning|You should carefully check the list of packages to be removed before you remove them. Otherwise, you may remove packages required by your system to function.}} {{ic|pacman -R ''mypackage''}} does not remove {{ic|''mypackage''}}'s dependencies which have been installed as dependencies (not explicitly, '''Install Reason''' in {{ic|''mypackage''}}'s ''metainformation'') and are not required by other packages. In order to do that, you run {{ic|pacman -Rs ''mypackage''}}. The complete command would be {{ic|pacman -Rcs ''mypackage''}}.  
+
I'd edit the page to make it clear what is and isn't logged, but I'm not sure myself. It seems like the following things are logged:
  
{{Note|{{ic|pacman}} always lists packages to be installed or removed and asks for permission before it takes action. To inhibit any action, use {{ic|-p}}.}}
+
* Package installation complete
 +
* Most but not all of the per-package notices <code>pacman</code> prints.
  
As you can see, {{ic|pacman}} operates at a lower level compared to {{ic|yum}} and {{ic|apt}}. This requires more attention from you in using it, but it also empowers you with better control over your system.
+
It seems like the following things are not logged:
  
For those who have used other linux distributions before, there is a helpful [[Pacman Rosetta]].
+
* Progress bars (of course)
</pre>
+
* Package download
 +
* Package integrity and signature checks
 +
* File conflicts
 +
* Disk space checks
 +
* Optional dependencies
  
::::
+
Unless there's a problem (in which case they may be logged; I'm not sure), you really don't care about any of these except the optional dependencies, and those can be obtained with <code>pacman -Qi</code> or <code>expac</code>. However, I'm not sure if this list is exhaustive, and wouldn't want to find out the hard way that I'd missed important <code>pacman</code> output by assuming it'd be in the log.
# I know that I am not the first archlinux beginner user who has trouble learning how to use pacman. The forums hold a good set of discussions on this topic, even experienced users state that they did not know about the dangers of {{ic|pacman -Sy; pacman -S ''package''}}. In order for this situation to arise there must be a number of conditions fulfilled:
+
## elliptic and unclear manual. the first example that comes to my mind: <br /> ''UPGRADE OPTIONS (APPLY TO -S AND -U) <br /> --recursive <br /> Recursively reinstall all dependencies of the targets. This forces upgrades or <br /> reinstalls of all dependencies without requiring explicit version requirements. This <br /> is most useful in combination with the --needed flag, which will induce a deep <br /> dependency upgrade without any unnecessary reinstalls.'' <br /> Why does this exist, when {{ic|-S}} and {{ic|-U}} already include it? I am missing something. Something that should have been obvious, but it is not.
+
## elliptic and unclear [[pacman]] page. It seems that we have an agreement on this. However, I may be not the first rejected contributor.
+
### The Introduction must repeat the content. This is the point, to provide a friendly introduction to the content. The content must elaborate on evey point explained in the introduction.
+
### The manual and the pacman wiki, short and elliptic as they are, succeed to use inconsistent terminology for basic unexplained notions like "rolling archive" and "synchronizing repository databases". I believe that, contrary to the comment, I provide an explanation.
+
### Last but not least, I thought that this wiki is a place for mutual cooperation and not for mutual destruction. The comments refer to easy to fix issues, and I believe that preventing access of beginners to this introduction for the before mentioned problems is an exaggerated response.
+
# Yes, I did overuse the personal pronouns. In most cases the text improved when I changed this. However, in some cases, the text became less clear. There are two important agents in this story: the system and the user. When you take out the personal pronouns it becomes less clear who is the agent to which the text refers. When I say that the package list can be refreshed the question arises: by whom? It is vitally important for the beginner user to know immediately that only him can do that. I did my best.
+
# Thank you for the link to news. I remembered it overnight but still I appreciate the assistance.
+
# I completely oppose the proposition to remove all commands from the introduction. As a beginner, I know very well what I wanted to find on this page and I did not. If the commands are missing, visual memory will be unable to link the information provided in plain English to important symbols to remember and the page will become practically of no use to the newcomer. Please do not delete the paragraph again for this reason. Accept a wider based discussion with beginner users before a decision is taken. The rest of the page has many issues to present, like for example what is that {{ic|-S --recursive}} option doing. There are at least ten such unclear options in the manual.  
+
  
I am not going to start an editing war on this page. I thought that I should help beginners like me to easier enter this distribution of linux, which is based on a very effective philosophy. However, in case that I am not supported by any other user in my endeavour, you can delete everything you like. [[User:Doru001|Doru001]] ([[User talk:Doru001|talk]]) 11:39, 4 February 2013 (UTC)
+
Can somebody link to (or put here) a more comprehensive list of what is and isn't logged? I haven't been able to find one, and I think that it'd be much better to be clear than to simplify by saying "all the output is logged". [[User:DHouck|DHouck]] ([[User talk:DHouck|talk]]) 08:14, 22 February 2014 (UTC)
  
::I've looked at the revised introduction, and think Doru001 is on the right path.
+
== Exit codes ==
Some suggestions :
+
Use subsections to make the text more readable :
+
overview
+
databases
+
installing/upgrading
+
removing
+
  
In the installing/upgrading and removing sections add links to relevant parts with more detail further on the page.
+
I think that pacman exit codes should be also added here but don't know them. All I have noticed so far are only 0 when everything downloaded/installed without any problems and 1 when packages where skipped. Any special exit codes when at least one package was installed while other was skipped? And why error code is 0 when failed to connect to update mirrors {{ic|error: failed retrieving file}}, does it has the error codes when it was able to download all files to update from mirrors or not all repositories were available, e.g. only one? And may be some more exit codes for debugging?
example: the installing/upgrading subsection could have something like :
+
Partial upgrades are UNSUPPORTED, see https://wiki.archlinux.org/index.php/Pacman#Partial_upgrades_are_unsupported for details.
+
  
About pacman -Sy :
+
-- Andy Crowd 08:00, 9 January 2015 (UTC)
Mention it only in the databases subsection with its 2 use-cases (repo added, switching mirrors).
+
Make clear it's only a good choice for those cases, and a bad choice for all others.
+
([[User:Lone Wolf|Lone_Wolf]] ([[User talk:Lone Wolf|talk]]) 13:13, 4 February 2013 (UTC))
+
:::Thank you very much for your support. Your suggestions are very good (I suppose that you mean -Syy, no -Sy). I am short on time, so anybody is invited to put them into the text.
+
:::: Hi, Doru001 what you suggest is very usuful. But the way you push out the changes is wrong. Your edit is a major one on one of the most important ArchWiki page. So discussion on talk page is needed. Here is my suggestion:
+
::::Since most of your info is already exist in this page and it looks like some kind of tutorials. You can create a new [[Classroom]] page such as [[How to use pacman]].
+
:::: -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 03:04, 6 February 2013 (UTC)
+
:::::[[Pacman - An Introduction]] I am really short of time, so please move my paragraph there (mind the links).--[[User:Doru001|Doru001]] ([[User talk:Doru001|talk]]) 10:43, 6 February 2013 (UTC)
+
:::::OK, I did it. If you have suggestions then please offer to help, I am really short of time.--[[User:Doru001|Doru001]] ([[User talk:Doru001|talk]]) 10:50, 6 February 2013 (UTC)
+
:::::I don't know how to use this classroom. Please connect my [[Pacman - An Introduction]] page to this project. I understand that Classroom is melted into wiki.archlinux.org? [[User:Doru001|Doru001]] ([[User talk:Doru001|talk]]) 11:01, 6 February 2013 (UTC)
+
:::::: Thanks. It looks much better now.
+
::::::*[[Pacman]] will be the official source of information. Everyone should read it from top to down or they will have problem s sooner or later.
+
::::::*[[Pacman - An Introduction]] will be an easy tutorial. It will only cover the most frequently tasks the user has to perform.
+
::::::--[[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 11:35, 11 February 2013 (UTC)
+
:::::::So you are saying that there are no missing details on this page. Please remember to sign your comments. [[User:Doru001|Doru001]] ([[User talk:Doru001|talk]]) 11:20, 10 February 2013 (UTC)
+
:::::::: Skim through [[Pacman - An Introduction]], I do not see any info is not included here. If I miss something, please point them out and we find a suitable place for them. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 11:38, 11 February 2013 (UTC)
+
  
== Pacman refuses to delete corrupted package, because it is corrupted... ==
+
:This is something that belongs in the manual. I'd suggest [https://bugs.archlinux.org/index.php?project=3&do=index&switch=1 filing a bug]. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 17:20, 20 August 2015 (UTC)
  
I had this issue today with two packages (icu-4.4-2-x86_64.pkg.tar.xz and ttf-bitstream-vera-1.10-7-any.pkg.tar.xz). Got asked "<X> is corrupted. Do you want to delete it? [Y/n]" and then told "failed to commit transaction - <x> is invalid or corrupted". Some nice person should add in "Troubleshooting" that in this case one can delete said package manually as root in /var/cache/pacman/pkg. -- [[User:Misc|Misc]] 20:17, 17 April 2010 (EDT)
+
== Pacstrap issue ==
  
:I'm glad someone asked this.  And thanks for the pointer.  One of the most annoying things that I've found users have ever had to deal with in the last couple decades has been this sort of problem with automated package management methods, regardless of the OS used.  I have noticed, however, that the download process usually weeds out the corrupted downloads before committing them to the install process.  It might be that dumping a bad package might be something that is automated by the pacman routine in a better manner than it does now, but downloading again, and overwriting the bad one, should fix the problem without further effort. - [[User:KitchM|KitchM]] 23:01, 18 April 2010 (EDT)
+
:Moved from [[Beginners' guide]]. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 06:11, 20 February 2015 (UTC)
  
== Troubleshooting: manually reinstall pacman ==
+
I don't know how many others are experiencing trouble when issuing the {{ic|pacstrap -i /mnt base base-devel}} command but I got a series of {{ic|GPGME ERROR: no data}} errors. This post helped: https://bbs.archlinux.org/viewtopic.php?id=162216
 +
You need to run: {{ic|rm -R /mnt/var/lib/pacman/sync}}
 +
and try again the pacstrap command. {{Unsigned|11 February 2015|Sudoku}}
  
{{FAQ
+
== Don't rush updates ==
|question=Pacman searches very slow for updatable packages.
+
|answer=This is probably due to package list fragmentation. To fix this problem use 'pacman -Syy'
+
}}
+
  
== testdb ==
+
[https://wiki.archlinux.org/index.php?title=Pacman&diff=391408&oldid=390815 This edit] removed a warning that was, IMHO reasonably, suggesting not to upgrade a stable system without having the time to do possible post-upgrade maintenance. I agree that the warning wasn't very well worded and could have been simplified and given a more neutral tone, however I'd reintroduce it, thoughts? — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 08:05, 18 August 2015 (UTC)
  
IMO it should be added to this page. You can get text from [https://bbs.archlinux.org/viewtopic.php?pid=320958]. --[[User:Beroal|Beroal]] 13:13, 8 November 2010 (EST)
+
: I thought the wording was fine, and the example of giving a presentation was well-chosen to communicate the small but non-negligible amount of  time required to fix problems. [[User:Herodotus|Herodotus]] ([[User talk:Herodotus|talk]]) 20:10, 18 August 2015 (UTC)
 +
 
 +
::The original warning is anything but constructive though. Compare to [[Enhance_system_stability#Read_before_upgrading_the_system]]. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 03:30, 19 August 2015 (UTC)
 +
 
 +
:::How about [https://wiki.archlinux.org/index.php?title=Pacman&diff=391745&oldid=391589 this]. I'm not an expert so I mostly borrowed stuff from the deleted section and [[Enhance_system_stability#Arch_Specific_Tips_2]]. [[User:Herodotus|Herodotus]] ([[User talk:Herodotus|talk]]) 06:55, 19 August 2015 (UTC)
 +
 
 +
::::In my view, the new section had the same problems of the removed warning, plus it duplicated part of what is already written shortly above.
 +
::::[https://wiki.archlinux.org/index.php?title=Pacman&diff=392814&oldid=391745] (which replaces the new section) is my proposal instead.
 +
::::— [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 10:51, 20 August 2015 (UTC)
 +
 
 +
:::::Looks good to me. I do wonder if we should merge this to [[Enhance system stability#Read before upgrading the system]] and link from here. After all, potential issues on upgrade are not inherent to ''pacman'' (though resulting file system operations, or the interruption thereof, could damage the system), and [[Enhance system stability]] has some more notes on where upgrades could go wrong. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 17:10, 20 August 2015 (UTC)
 +
 
 +
::::::I think we need a new "Recommended package management practices" section/page to cover the parts related to Arch packaging specifics from the end-user's point of view. This would describe basically [[Pacman#Upgrading_packages]] (merged with [[Pacman#Package_updates_have_broken_my_system]]), [[System_maintenance#Package_tasks]], [[Enhance_system_stability#Arch_Specific_Tips]] and [[Enhance_system_stability#Arch_Specific_Tips_2]] unbiased from the "enhancing stability" requirements. For the description of "why" it should refer to [[Arch packaging standards]] (or a more general overview, which [https://wiki.archlinux.org/index.php?title=Talk:Pacman_-_An_Introduction&oldid=392978#Rolling_release_terms I think] belongs to [[Official repositories]]), rather than [[The Arch Way]]. If we can move there also the general parts of [[pacman#Troubleshooting]], either as another "recommended practices" or a justification for them, it would be even better.
 +
::::::Just to make it clear, the general idea behind moving the content out of [[pacman]] is to let the main page cover only the basics related to ''pacman'' itself and describe the packaging details on a separate (sub)page like [[Downgrading packages]] or [[pacman tips]]. Of course all the pages have to be properly interlinked.
 +
::::::-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 19:39, 20 August 2015 (UTC)
 +
 
 +
:::::::To emphasize on the "why" again, there's:
 +
:::::::# [[Arch_packaging_standards#Package_naming]] - Technical reference, somewhat cryptic
 +
:::::::# [[System maintenance#Partial upgrades are not supported]] - It links to [[Wikipedia:Rolling release]], but mostly focuses on the technical (soname bumps)
 +
:::::::# [[Frequently_asked_questions#Why_is_there_only_a_single_version_of_each_shared_library_in_the_official_repositories.3F]] - More explicit, but does this really belong in the [[FAQ]]? For now, I've linked it from the warning in [[Pacman#Installing packages]] anyway.
 +
:::::::I also agree that the actual [[Official repositories]] could be expanded. The brief mention in [[Arch_Linux#Modernity]] is enough for the scope of that article. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 12:06, 23 October 2015 (UTC)
 +
 
 +
:::::::[[Enhance system stability]] was cleaned and merged to [[System maintenance]]. I believe latter is the article where the recommended practices should be described. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 09:45, 23 October 2015 (UTC)
 +
:::::::[[Pacman#Package updates have broken my system]] was partly moved to [[System maintenance#Revert broken updates]]: [https://wiki.archlinux.org/index.php?title=System_maintenance&diff=406302&oldid=406294] [https://wiki.archlinux.org/index.php?title=Pacman&diff=406283&oldid=406281] -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 10:34, 23 October 2015 (UTC)
 +
:::::::[[Pacman#Partial upgrades are unsupported]] was moved to [[System maintenance#Partial upgrades are unsupported]]. [https://wiki.archlinux.org/index.php?title=System_maintenance&diff=406285&oldid=406270] A warning linking to it was added in its place. [https://wiki.archlinux.org/index.php?title=Pacman&diff=406290&oldid=406287] The [[Partial upgrade]] redirect(s) were updated, but awaiting further structure changes, only generally to [[System maintenance]]. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 10:12, 23 October 2015 (UTC)
 +
 
 +
=== New approach ===
 +
 
 +
::''Moved from the now closed [[#Pacman - An Introduction]] discussion. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 11:51, 23 October 2015 (UTC)''
  
== version comparision ==
+
:Right now, package management on the wiki is fragmented and duplicated, and it's clear that creating another page won't help in solving this. As pointed out in [[#Don't rush updates]], we have [[System maintenance]], [[Enhance system stability]], this article, [[Official repositories]], [[Arch Linux]], [[Arch packaging standards]], ... not even mentioning specialist articles, the [[FAQ]] linked from the [[Main page]] or [[General troubleshooting]]. To make things worse, these articles are in different categories.
 +
:A few suggestions:
 +
:* Pacman, while a prominent feature of Arch, is ''not'' a distribution-specific tool. [https://bbs.archlinux.org/viewtopic.php?pid=828254#p828254] As such, this page should limit it's scope to 1. providing an introduction to basic commands, 2. refer and introduce to [https://www.archlinux.org/pacman/pacman.8.html pacman(8)] and [https://www.archlinux.org/pacman/pacman.conf.5.html pacman.conf(5)], 3. clarify on the inner workings, per [[#Description of pacman internals (for new pacman programmers)]].
 +
::We should still make a clear relation to how it functions inside Arch, by linking to other articles, including a sufficient explanation.
 +
:* Configuration should indeed be expanded upon after basic usage, again keeping the manuals and other material in mind.
 +
:* I would suggest cleaning and merging the [[System maintenance]] and [[Enhance system stability]] articles, moving the most common Q/A to - or linking it in - the [[FAQ]] or similar article. Having a central location for "Recommended practices", as pointed out in [[#Don't rush updates]], is key here. See also [[ArchWiki:Requests#FAQ]].
 +
:* Specialist cases should be moved to subpages of [[Pacman]], for example [[Pacman/Tips and tricks]].
 +
-- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 03:14, 13 October 2015 (UTC)
  
I needed to know what pacman is doing with versions like 1.2.fb9 and 1.2.fb10. The documentation was not clear on that.
+
::Small update: pacman now has 4 subpages, [[Pacman/Tips and tricks]] (merge of [[pacman tips]] and [[Improve pacman performance]]), [[Pacman/Pacnew and Pacsave]] (from [[Pacnew and Pacsave files]]), [[Pacman/Rosetta]] (from [[Pacman Rosetta]]) and [[Pacman/Package signing]] (from [[pacman-key]]).
 +
::Haven't moved [[Downgrade packages]] yet, as it's equally related to [[Official repositories]]. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 16:39, 16 October 2015 (UTC)
  
Short: I found fb9 is really less than fb10.
+
::You did not answer any of my arguments. You could say ''"yes, it is true that many people come on this page to understand pacman and that pacman's functionality can't be understood without understanding rolling repositories and that there is no explanation or at least a link to an explanation of this, but I don't care."'' I don't argue here in favor of a new page. [[User:Doru001|Doru001]] ([[User talk:Doru001|talk]]) 19:49, 13 October 2015 (UTC)
  
It took me a while to find, so I place the links here: [http://code.toofishes.net/pacman/doc/version_8c_source.html version.c source] and [http://code.toofishes.net/pacman/doc/group__alpm__api__packages.html#gaa02179706f44681dd80c75f7fb8017b2 alpm_pkg_vercmp description]. This is what is used.
+
:I have actually been struggling with this same issue myself. Based on the number of problems reported on the mailing and list and forums that can be summarized as "User does not understand rolling release and good pacman practices," I think there is a pretty clear need for more directed documentation that increases the chance of new users learning the essential parts of maintaining an Arch system. '''However''', I'm not convinced that [[pacman]] is the right article for this information. Despite its importance, pacman is just another program distributed with Arch Linux and this article describes its technical ins and outs. You don't see [[Git]] including a discussion of the DVCS philosophy or [[Ruby]] including a treatise on object-oriented design, despite the fact that these are (arguably) essential skills for properly using such software.
It tries to split the version in only-numeric and only-alpha parts. --[[User:JonnyJD|JonnyJD]] 13:58, 1 March 2012 (EST)
+
:I think that the simplest solution would be to add a note right after the introductory paragraph, along the lines of {{Note|This article describes the technical aspects of package management with pacman. If you are looking for practical tips for updating/maintaining an Arch Linux system, see [[System maintenance#Package tasks]].}} However I think this also ties into the discussion from [[#Don't rush updates]], in that we need a good unified location for such information that the note could link to. Frankly, the [[System maintenance]] article is just as lacking for new users. [[User:Silverhammermba|Silverhammermba]] ([[User talk:Silverhammermba|talk]]) 15:55, 15 October 2015 (UTC)
  
== repositories section doesn't mention changing mirrors/adding repos ==
+
=== Drafts ===
  
The repositories section lacks information about what is needed after a repo is added, or you changed mirrors.
+
* I've made a draft to outline the merging of the aforementioned pages: [[User:Lahwaacz/Recommended package management practices]]. There is still long way to go, but I think it already contains everything relevant from [[System maintenance]] and [[Enhance system stability]]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 18:33, 17 October 2015 (UTC)
  
an unformatted example text :
+
* My (very similar) draft [[User:Silverhammermba/Recommended package management practices]]. I'm trying to take a different approach to the article, but right now it's not very significant. Perhaps they will diverge more as we expand them. [[User:Silverhammermba|Silverhammermba]] ([[User talk:Silverhammermba|talk]]) 15:15, 20 October 2015 (UTC)
If you added a repo to pacman.conf, you need to tell pacman to create/download the database for the new repo.
+
Pacman -Syu will do this, but you can also use pacman -Sy or pacman -Syy for this.
+
  
Incase you changed mirrors, pacman repo databases are often no longer correct and need refreshing.
+
=== Repository going offline ===
pacman -Syy is recommened for this.
+
  
Note that pacman -Sy and pacman -Syy should only be used for these special cases.
+
::''This comment is from an earlier, closed discussion -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 12:19, 23 October 2015 (UTC)''
[[User:Lone Wolf|Lone_Wolf]] ([[User talk:Lone Wolf|talk]]) 14:29, 13 February 2013 (UTC)
+
:what happens when your repository goes off line and you fallback on a repository not yet updated? I still don't know, I only use one repository at a time! [[User:Doru001|Doru001]] ([[User talk:Doru001|talk]]) 14:47, 15 October 2015 (UTC)
 +
::Most likely, nothing. pacman doesn't downgrade packages with {{ic|-Syu}} - it only does so with {{ic|-Syuu}}. Assuming by "repository" [[Mirrors]] is meant here. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 12:19, 23 October 2015 (UTC)

Latest revision as of 14:56, 15 April 2016

Description of pacman internals (for new pacman programmers)

Moderation note: The previous discussion on this subject (titled Detail missing) has been seriously derailed in the past. Please let's focus on the original topic, also presented by the current title, i.e. the description of pacman internals and its code base, targeting new pacman programmers. -- Lahwaacz (talk) 21:27, 11 October 2015 (UTC)

Can someone please add the details of pacman? There is no explanation of how it works. What are the components and their interaction? And how about related dependencies and libraries? Without that basic flow-chart concept in mind, it is very difficult to understand the roll that third-party additions or frontends might play.

This would be very interesting. libfetch, libalpm, etc. manolo 15:23, 15 November 2009 (EST)
There's a tiny bit on Allan's blog. Details regarding libalpm should be in a separate wiki article. -- Karol 13:13, 10 February 2012 (EST)
Some more, pretty low level, info, also from Allan's blog. -- Karol 13:24, 11 February 2012 (EST)

testdb

IMO it should be added to this page. You can get text from [1]. --Beroal 13:13, 8 November 2010 (EST)

testdb has been removed in pacman 5.0 [2] -- Lahwaacz (talk) 09:11, 1 February 2016 (UTC)
Maybe we should add information about replacement of testdb aka 'Pacman -Dk' -- s777n (talk) 14:56, 15 April 2016 (UTC)

pacman.log

There are (as of this writing) two places on this page which say that pacman's output is logged to /var/log/pacman.log. Obviously in the strictest sense this is false, as can easily be seen by anybody who's glanced at this file and at pacman's on-screen output. Ordinarily, this wouldn't be a problem, as it's clear what is meant. But there's also some information which is not logged, and this fact is unclear.

I'd edit the page to make it clear what is and isn't logged, but I'm not sure myself. It seems like the following things are logged:

  • Package installation complete
  • Most but not all of the per-package notices pacman prints.

It seems like the following things are not logged:

  • Progress bars (of course)
  • Package download
  • Package integrity and signature checks
  • File conflicts
  • Disk space checks
  • Optional dependencies

Unless there's a problem (in which case they may be logged; I'm not sure), you really don't care about any of these except the optional dependencies, and those can be obtained with pacman -Qi or expac. However, I'm not sure if this list is exhaustive, and wouldn't want to find out the hard way that I'd missed important pacman output by assuming it'd be in the log.

Can somebody link to (or put here) a more comprehensive list of what is and isn't logged? I haven't been able to find one, and I think that it'd be much better to be clear than to simplify by saying "all the output is logged". DHouck (talk) 08:14, 22 February 2014 (UTC)

Exit codes

I think that pacman exit codes should be also added here but don't know them. All I have noticed so far are only 0 when everything downloaded/installed without any problems and 1 when packages where skipped. Any special exit codes when at least one package was installed while other was skipped? And why error code is 0 when failed to connect to update mirrors error: failed retrieving file, does it has the error codes when it was able to download all files to update from mirrors or not all repositories were available, e.g. only one? And may be some more exit codes for debugging?

-- Andy Crowd 08:00, 9 January 2015 (UTC)

This is something that belongs in the manual. I'd suggest filing a bug. -- Alad (talk) 17:20, 20 August 2015 (UTC)

Pacstrap issue

Moved from Beginners' guide. -- Alad (talk) 06:11, 20 February 2015 (UTC)

I don't know how many others are experiencing trouble when issuing the pacstrap -i /mnt base base-devel command but I got a series of GPGME ERROR: no data errors. This post helped: https://bbs.archlinux.org/viewtopic.php?id=162216 You need to run: rm -R /mnt/var/lib/pacman/sync and try again the pacstrap command. —This unsigned comment is by Sudoku (talk) 11 February 2015. Please sign your posts with ~~~~!

Don't rush updates

This edit removed a warning that was, IMHO reasonably, suggesting not to upgrade a stable system without having the time to do possible post-upgrade maintenance. I agree that the warning wasn't very well worded and could have been simplified and given a more neutral tone, however I'd reintroduce it, thoughts? — Kynikos (talk) 08:05, 18 August 2015 (UTC)

I thought the wording was fine, and the example of giving a presentation was well-chosen to communicate the small but non-negligible amount of time required to fix problems. Herodotus (talk) 20:10, 18 August 2015 (UTC)
The original warning is anything but constructive though. Compare to Enhance_system_stability#Read_before_upgrading_the_system. -- Alad (talk) 03:30, 19 August 2015 (UTC)
How about this. I'm not an expert so I mostly borrowed stuff from the deleted section and Enhance_system_stability#Arch_Specific_Tips_2. Herodotus (talk) 06:55, 19 August 2015 (UTC)
In my view, the new section had the same problems of the removed warning, plus it duplicated part of what is already written shortly above.
[3] (which replaces the new section) is my proposal instead.
Kynikos (talk) 10:51, 20 August 2015 (UTC)
Looks good to me. I do wonder if we should merge this to Enhance system stability#Read before upgrading the system and link from here. After all, potential issues on upgrade are not inherent to pacman (though resulting file system operations, or the interruption thereof, could damage the system), and Enhance system stability has some more notes on where upgrades could go wrong. -- Alad (talk) 17:10, 20 August 2015 (UTC)
I think we need a new "Recommended package management practices" section/page to cover the parts related to Arch packaging specifics from the end-user's point of view. This would describe basically Pacman#Upgrading_packages (merged with Pacman#Package_updates_have_broken_my_system), System_maintenance#Package_tasks, Enhance_system_stability#Arch_Specific_Tips and Enhance_system_stability#Arch_Specific_Tips_2 unbiased from the "enhancing stability" requirements. For the description of "why" it should refer to Arch packaging standards (or a more general overview, which I think belongs to Official repositories), rather than The Arch Way. If we can move there also the general parts of pacman#Troubleshooting, either as another "recommended practices" or a justification for them, it would be even better.
Just to make it clear, the general idea behind moving the content out of pacman is to let the main page cover only the basics related to pacman itself and describe the packaging details on a separate (sub)page like Downgrading packages or pacman tips. Of course all the pages have to be properly interlinked.
-- Lahwaacz (talk) 19:39, 20 August 2015 (UTC)
To emphasize on the "why" again, there's:
  1. Arch_packaging_standards#Package_naming - Technical reference, somewhat cryptic
  2. System maintenance#Partial upgrades are not supported - It links to Wikipedia:Rolling release, but mostly focuses on the technical (soname bumps)
  3. Frequently_asked_questions#Why_is_there_only_a_single_version_of_each_shared_library_in_the_official_repositories.3F - More explicit, but does this really belong in the FAQ? For now, I've linked it from the warning in Pacman#Installing packages anyway.
I also agree that the actual Official repositories could be expanded. The brief mention in Arch_Linux#Modernity is enough for the scope of that article. -- Alad (talk) 12:06, 23 October 2015 (UTC)
Enhance system stability was cleaned and merged to System maintenance. I believe latter is the article where the recommended practices should be described. -- Alad (talk) 09:45, 23 October 2015 (UTC)
Pacman#Package updates have broken my system was partly moved to System maintenance#Revert broken updates: [4] [5] -- Alad (talk) 10:34, 23 October 2015 (UTC)
Pacman#Partial upgrades are unsupported was moved to System maintenance#Partial upgrades are unsupported. [6] A warning linking to it was added in its place. [7] The Partial upgrade redirect(s) were updated, but awaiting further structure changes, only generally to System maintenance. -- Alad (talk) 10:12, 23 October 2015 (UTC)

New approach

Moved from the now closed #Pacman - An Introduction discussion. -- Alad (talk) 11:51, 23 October 2015 (UTC)
Right now, package management on the wiki is fragmented and duplicated, and it's clear that creating another page won't help in solving this. As pointed out in #Don't rush updates, we have System maintenance, Enhance system stability, this article, Official repositories, Arch Linux, Arch packaging standards, ... not even mentioning specialist articles, the FAQ linked from the Main page or General troubleshooting. To make things worse, these articles are in different categories.
A few suggestions:
We should still make a clear relation to how it functions inside Arch, by linking to other articles, including a sufficient explanation.

-- Alad (talk) 03:14, 13 October 2015 (UTC)

Small update: pacman now has 4 subpages, Pacman/Tips and tricks (merge of pacman tips and Improve pacman performance), Pacman/Pacnew and Pacsave (from Pacnew and Pacsave files), Pacman/Rosetta (from Pacman Rosetta) and Pacman/Package signing (from pacman-key).
Haven't moved Downgrade packages yet, as it's equally related to Official repositories. -- Alad (talk) 16:39, 16 October 2015 (UTC)
You did not answer any of my arguments. You could say "yes, it is true that many people come on this page to understand pacman and that pacman's functionality can't be understood without understanding rolling repositories and that there is no explanation or at least a link to an explanation of this, but I don't care." I don't argue here in favor of a new page. Doru001 (talk) 19:49, 13 October 2015 (UTC)
I have actually been struggling with this same issue myself. Based on the number of problems reported on the mailing and list and forums that can be summarized as "User does not understand rolling release and good pacman practices," I think there is a pretty clear need for more directed documentation that increases the chance of new users learning the essential parts of maintaining an Arch system. However, I'm not convinced that pacman is the right article for this information. Despite its importance, pacman is just another program distributed with Arch Linux and this article describes its technical ins and outs. You don't see Git including a discussion of the DVCS philosophy or Ruby including a treatise on object-oriented design, despite the fact that these are (arguably) essential skills for properly using such software.
I think that the simplest solution would be to add a note right after the introductory paragraph, along the lines of
Note: This article describes the technical aspects of package management with pacman. If you are looking for practical tips for updating/maintaining an Arch Linux system, see System maintenance#Package tasks.
However I think this also ties into the discussion from #Don't rush updates, in that we need a good unified location for such information that the note could link to. Frankly, the System maintenance article is just as lacking for new users. Silverhammermba (talk) 15:55, 15 October 2015 (UTC)

Drafts

Repository going offline

This comment is from an earlier, closed discussion -- Alad (talk) 12:19, 23 October 2015 (UTC)
what happens when your repository goes off line and you fallback on a repository not yet updated? I still don't know, I only use one repository at a time! Doru001 (talk) 14:47, 15 October 2015 (UTC)
Most likely, nothing. pacman doesn't downgrade packages with -Syu - it only does so with -Syuu. Assuming by "repository" Mirrors is meant here. -- Alad (talk) 12:19, 23 October 2015 (UTC)