Talk:Pacman/Tips and tricks

From ArchWiki
Jump to navigation Jump to search
Note: Moderation — Any pacman frontend that does partial upgrades without explicit user intervention (i.e, specifying -Sy on the command line), has no place on this page or anywhere else on ArchWiki. No exceptions. -- Alad (talk) 14:03, 20 May 2017 (UTC)

pacman-optimize on SSD

[Moved from Talk:Improve pacman performance -- Alad (talk) 05:05, 16 October 2015 (UTC)]

pacman-optimize only tries to reduce fragmentation of the files right? If that is the case perhaps we should include a note that this probably won't help much on an SSD. —This unsigned comment is by F4hy (talk) 18:27, 29 March 2013‎. Please sign your posts with ~~~~!


[Moved from Talk:Improve pacman performance -- Alad (talk) 05:05, 16 October 2015 (UTC)]

Looks like the systemd-timer-pacman-optimize-git package is no longer maintained. [1]

Should the wiki no longer recommend this package? -- I'm guessing it shouldn't.

Also, is pacman-optimize less important than in the past? -- I am genuinely unsure about this.

--Matthew02 (talk) 05:40, 2 March 2015 (UTC)

The maintenance of systemd-timer-pacman-optimize-gitAUR has nothing to do with that of pacman itself, it is packaged separately and even in the AUR. Anyway, I'd keep the section until pacman-optimize is removed from pacman.
The reasons why it is not very important nowadays are improvements in pacman itself (mentioned in the ML post linked above), increased speeds of HDDs and the advent of SSDs.
-- Lahwaacz (talk) 22:18, 2 March 2015 (UTC)

Leading slash

Pacman/Tips_and_tricks#aria2 doesn't work without leading slash, i.e. -d / turning file names to //var/cache/.... The article mentions this, but it doesn't mention why. -- Alad (talk) 05:28, 16 October 2015 (UTC)

You would have to go way back to track this. It seems to have worked without -d / even in 2006: [2], [3]. I guess that simply nobody asked the right question... -- Lahwaacz (talk) 12:30, 16 October 2015 (UTC)
Oops, it does not work without -d /. Then the problem must be on aria's side, which expects a file name for the -o option, which is then catenated with -d into the full path. Assuming that -d defaults to the cwd, /var/cache/ would appear twice in the result. -- Lahwaacz (talk) 12:43, 16 October 2015 (UTC)

Listing optional dependencies of all installed packages

To show a list of optional dependencies of all installed packages you can use this script (requires expac). Usefull when you missed some scrolling by and the closed the terminal. Consider installing via pacman --asdeps -S $p to mark them as dependecies and then orphans when the package they get installed for is removed.
if [[ -t 1 ]]; then
	packagename=$(tput bold)
	installed=$(tput setf 2)
	normal=$(tput sgr0)

(for p in $(expac %n);do # every installed package
	if [[ -n $(expac %o $p) ]]; then # that has optional dependencies
		echo $p
done;) | (while read p; do
	echo $packagename$p$normal: # echo package name
	expac -l "\n" "%O" $p | while read dep; do # every opt-dep
		echo -n "    $dep"
		if [[ -n $(pacman -Q $(echo $dep | cut -d ":" -f 1) 2> /dev/null) ]]; then # if installed
			echo -n " $installed[Installed]$normal"
Note: To view optional dependencies for only one specific package use pacman -Qi $p

-- 08:38, 20 January 2017‎ M3t0r

Since the main interest is listing optional dependencies which are not installed, the above can be summarized to (also much faster):
join -v2 -o2.2,2.1 <(expac -Q '%n' | sort) <(expac -Qv '%n\t%o' -l '\t' | awk '$2 !~ /None/ { 
	for(i = 2; i <= NF; ++i) printf("%s\t%s\n", $i, $1) | "sort -k1,1"
}') | sort | column -t

--Alad (talk) 12:40, 20 January 2017 (UTC)
Yes, it's faster, but less intuitive reading of the code and the output. It's also missing the description what they would enable.
--M3t0r (talk) 22:04, 20 January 2017 (UTC)

pacman cache

I still think we should warn people not to symlink /var or anything under it. It leaves the whole system unusable because if the cache disappears during a pacman transaction, you're left with missing /usr/lib libraries, and nothing works, including pacman itself. This is a serious enough problem that it can take hours to figure out how to recover. If the wiki had mentioned this problem it would have saved me a lot of time and effort, and I'm not the only one who has run in to this. It is not, however, considered a bug. See JimRees (talk) 23:15, 29 April 2017 (UTC)

This revisions says that: [4]. But to make it more clear: [5] -- Rdeckard (talk) 00:13, 30 April 2017 (UTC)
Actually, I undid my change since I think that first change is more accurate (mentioning /var/cache/pacman/pkg and ancestors), so I went back to that but explicitly mentioned /var as an example. -- Rdeckard (talk) 01:11, 30 April 2017 (UTC)
Thanks for the background information. I was not aware of the bug report and now clearly understand why you altered the section the way you did. I hope the recent change is sufficient for you. Since every misbehaving program might leave a system unbootable if it plays a role in the boot process, it should be unnecessary to add this redundant information. However the problem you described is still severe and I hope you agree that the recent edits made to the article do the topic justice. Thanks for clarifying the topic and adding this to the article and sorry for reverting your edits at first. -- Edh (talk) 21:07, 30 April 2017 (UTC)

How to check if a pacman frontend is doing partial upgrades?

How to know that a pacman frontend like pamac or octopi is doing partial upgrades? Because I didn't know they were doing it. So how can I check?

I installed kulu finally but octopi has a octopi-notifier an can be used as notifier only for example. So I should be able to link octopi-notifier as it is harmless for the system?

Noraj (talk) 17:10, 20 May 2017 (UTC)

Not much you can do besides check the code, or find out that the sync db is in an inconsistent state after the partial upgrade was done (as in any .so bump causing programs to fail). For octopi there's this github issue which explains how the program does partial upgrades by design. Unsurprisingly, octopi-notifier does the exact same thing. [6] -- Alad (talk) 18:39, 20 May 2017 (UTC)