-
Notifications
You must be signed in to change notification settings - Fork 1
/
Pacman.txt
222 lines (162 loc) · 7.71 KB
/
Pacman.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2016-10-23T00:42:15+02:00
====== Pacman ======
Created søndag 23 oktober 2016
== Log files ==
**# Pacman's output is logged to** ///var/log/pacman.log//
===== Configuration file =====
**# The pacman configuration can be found at** ///etc/pacman.conf//
== Skip package from being upgraded ==
**# Add packages to the** IgnorePkg= **option. **
**#** **Additional packages can be added with a space-separated list.**
**# The same can be done for a group (Gnome ex.) with the** //IgnoreGroup=// **option.**
== 32-bit libraries (multilib) ==
**# Uncomment the multilib repository for 32-bit supported packages (Steam ex.)**
== A little extra sweetness ==
**# Add colors to your pacman output, by outcommenting **//#Color //**in **//#// //Misc Options//
**# Outcomment **//VerbosePkgLists//** to get a more detailed package overview when upgrading the system**
**# Also, a little nice Easter Egg is the pacman (game) imitation. Add **//ILoveCandy//** to **//#// //Misc Options//
{{{code: lang="texinfo" linenumbers="True"
Color
VerbosePkgLists
ILoveCandy
}}}
===== General Usage =====
**# You can install a single or multiple packages**
$ pacman -S //package1 package2//
**# Check if package came with a service file **
$ pacman -Qql //<PACKAGE_NAME>// | grep -Fe .service -e .socket
**#** **Remove packages**
$ pacman -Rs //<PACKAGE_NAME> //**#**// -s //**= remove dependencies not needed by other packages too**
$ pacman -Rn //<PACKAGE_NAME> //**#**// -n //**= don't create a **//.pacsave//** file**
**# Upgrade system**
$ pacman -Syyu
**#** **Searching packages**
$ pacman -Ss //<SEARCH_CRITERIA> //**# Search in names and descriptions**
$ pacman -Ss '^//<SEARCH_CRITERIA>' //**# Search in names only**
$ pacman -Qs //<SEARCH_CRITERIA> //**# Search installed packages**
**#** **Extensive information about a package **
$ pacman -Si //<PACKAGE_NAME>//
$ pacman -Qi //<PACKAGE_NAME> //**# Installed packages**
**#** **List all installed packages (not dependecies)**
$ pacman -Qet
**# List dependency tree for a package**
$ pactree //<PACKAGE_NAME>//
**#** **List all packages depending on a package**
$ pactree -r //<PACKAGE_NAME>//
**# List all orphans**
$ pacman -Qdt
===== Unofficial keys =====
**# You can add a key as trusted to the pacman-key, in 3 simple steps.**
**#** **First read the key **
$ pacman-key -r //keyid //**# Key from a server**
$ pacman-key --add /path/to/file **# Provided key-file**
**#** **Verify it **
$ pacman-key -f //keyid//
**#** **Sign it **
$ pacman-key --lsign-key //keyid//
**# If you get a dirmngr ERROR, run the following**
$ dirmngr < /dev/null
===== Tips and Tricks =====
**# Some random Tips and Tricks**
== Packages changelog ==
**# Update changes can be viewed by installing pacolog (AUR)**
$ yaourt -S pacolog
**# Invoke it with**
$ pacolog //<PACKAGE_NAME>//
== Save a list of installed packages ==
**# You can save a list of installed packages and speed up installation of same packages **
**#** **on a fresh install. Create a list with **
$ pacman -Qqen > pkglist.txt
**# To install the packages from the newly created list**
pacman -S < pkglist.txt
**# If the list include AUR packages, remove these from the list first **
$ pacman -S $(comm -12 <(pacman -Slq | sort) <(sort pkglist.txt))
== Optimize database access speed ==
$ pacman -Sc && sudo pacman-optimize
== Update notifier ==
**# If you'd like to be notified when there's an update, you can install **//Kalu//** (AUR)**
**# Though, you can expect there to be updates pretty much every day^**
$ yaourt -S kalu
== Help the developers at Arch ==
**# **//pkgstats//** sends a list of installed packages, kernels, architecture and mirrors you use (anonymous)**
**# to the Arch Linux developers. This is done once a week automatically. **
$ pacman -S pkgstat
===== Hooks =====
**# A hook is an action (or set of) to be run when pacman remove/upgrade/install is invoked.**
**# Hooks can be saved in** ///etc/pacman.d/hooks/// **Below is a default hook file**
**# Hooks must be saved with the** //.hook// **extension**
{{{code: lang="texinfo" linenumbers="True"
[Trigger]
Operation =
Type =
Target =
[Action]
Description =
When =
Exec =
Depends =
AbortOnFail
NeedsTarget
}}}
**#** **Triggers **
{{{object: aligns="left,left,left" wraps="0,0,0"
| | Description | Required/repeatable |
|:-----------------------------------------|:----------------------------------------|:-----------------------|
| Operation = Install \| Upgrade \| Remove | | # Required, Repeatable |
| Type = File \| Package | # Select Package | # Required |
| Target = <path> \| <package> | # Files in a directory or specific file | # Required, Repeatable |
}}}
**#** **Actions **
{{{object: aligns="left,left,left" wraps="0,0,0"
| | Description | Required/repeatable |
|:-----------------------------------------|:-------------------------------------------------------------------------|:--------------------|
| Description = | # description for front-end view | |
| Exec = <command> | # Command to run | # Required |
| When = PreTransaction \| PostTransaction | | # Required |
| Depends = <package> | # Packages that must be installed for hook to run | |
| AbortOnFail | # Cancel the transaction if error occurs. Only works with PreTransaction | |
| NeedsTarget | # Pass along if Trigger.Target is set | |
}}}
== Useful Hooks ==
**#** **Sync storage caches to reduce the risk of system corruption **
{{{code: lang="texinfo" linenumbers="True"
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Package
Target = *
[Action]
Depends = coreutils
When = PostTransaction
Exec = /bin/sync
}}}
===== Troubleshoot =====
**# A few troubleshoot examples **
== "Failed to commit transaction (conflicting files)" error : ==
error: could not prepare transaction
error: failed to commit transaction (conflicting files)
package: /path/to/file exists in filesystem
Errors occurred, no packages were upgraded.
**# The above indicates a conflict in packages. **
**#** **To fix this, first check if the file is owned by another package**
$ pacman -Qo ///path/to///file
**# If the file does not belong to any other package, it can be removed. **
**# If the file is owned, file a bug report.**
== "Failed to commit transaction (invalid or corrupted package)" error : ==
**# Caused by partially downloaded packages** **(***.part**)** **stored in** ///var/cache/pacman/pkg///
**# Remove them with**
$ find /var/cache/pacman/pkg/ -iname "*.part" -exec rm {} \;
== "Failed to init transaction (unable to lock database)" error : ==
**# Close all instances of pacman and run**
$ rm /var/lib/pacman/db.lck
== Key could not be looked up remotely ==
**# Ex.**
downloading required keys...
error: key "F22FB1D78A77AEAB" could not be looked up remotely
error: required key missing from keyring
**# Problems with the Keyring can be solved by re-installing the keyring**
$ pacman -Sy archlinux-keyring
$ pacman -Su