https://wiki.archlinux.org/api.php?action=feedcontributions&user=AraaX&feedformat=atomArchWiki - User contributions [en]2024-03-29T12:53:25ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=International_communities&diff=417600International communities2016-01-28T13:49:04Z<p>AraaX: /* Iran */</p>
<hr />
<div>[[Category:About Arch]]<br />
https://archlinux.org is the home of the official Arch Linux website, forums, and wiki. However, several unofficial community-run sites are available for international users who would rather communicate in their own language. You can find a list of these communities below.<br />
<br />
Please note that our official wiki also supports internationalized content. In addition, we have an international forum where you can post in your native language. These tools can be used in addition to, in parallel with, or as a part of the international communities listed below. <br />
<br />
==International Communities==<br />
This list is by no means complete. If you know of a community that is not listed, please feel free to add it. If you are looking for a community that doesn't have an existing community, start one or visit the [https://bbs.archlinux.org/viewforum.php?id=30 Other Languages forum]<br />
<br />
===Brazil===<br />
*Homepage: http://archlinux-br.org/<br />
*Forum: http://forum.archlinux-br.org/<br />
*Wiki: [[Main page (Português)]]<br />
<br />
===Chile===<br />
*Homepage (Chilean): http://archlinux.cl/<br />
*Homepage (Hispana): http://archlinux-es.org<br />
*Forum: http://foro.archlinux.cl/<br />
*Wiki: http://wiki.archlinux.cl/<br />
<br />
===China===<br />
*Homepage: https://www.archlinuxcn.org/<br />
*Forum: https://bbs.archlinuxcn.org/<br />
*Forum: https://forum.ubuntu.org.cn/viewforum.php?f=155<br />
*Forum: http://www.linuxsir.org/bbs/forum96.html<br />
*Forum: http://tieba.baidu.com/f?kw=archlinux<br />
*Wiki: [[Main page (简体中文)]]<br />
<br />
===Czech Republic===<br />
*Homepage: http://archlinux.cz/ {{Dead link|2013|12|08}}<br />
*Forum: http://www.archlinux.cz/forum/ {{Dead link|2013|12|08}}<br />
*Wiki: [[Main page (Česky)]]<br />
<br />
===Denmark===<br />
*Homepage: http://www.archlinux.dk/<br />
*Forum: http://forum.archlinux.dk/<br />
*Wiki: [[Main page (Dansk)]]<br />
<br />
===France===<br />
*Homepage: http://archlinux.fr/<br />
*Forum: http://forums.archlinux.fr/<br />
*Wiki: http://wiki.archlinux.fr/<br />
<br />
===Germany===<br />
*Homepage: https://www.archlinux.de/<br />
*Forum: https://bbs.archlinux.de/<br />
*Wiki: https://wiki.archlinux.de/<br />
<br />
===Greece===<br />
*Homepage: http://archlinux.gr<br />
*Wiki: [[Main page (Ελληνικά)]]<br />
<br />
===Hungary===<br />
*Homepage: http://archlinux.hu/<br />
*Forum: http://archlinux.hu/forum<br />
<br />
===Iran===<br />
*Homepage: http://www.archusers.ir/<br />
*Forums: http://bbs.archusers.ir/<br />
*Wiki: http://wiki.archusers.ir/<br />
<br />
===Italy===<br />
*Homepage: http://www.archlinux.it/<br />
*Forum: http://www.archlinux.it/forum<br />
*Wiki: [[Main page (Italiano)]]<br />
<br />
===Japan===<br />
*Homepage: https://www.archlinuxjp.org/<br />
*Forum: https://bbs.archlinuxjp.org/<br />
*Wiki: https://wiki.archlinuxjp.org/<br />
<br />
===Lithuania===<br />
*Homepage: http://www.archlinux.lt/<br />
*Forum: http://sls.archlinux.lt/<br />
*Wiki: [[Main Page (Lietuvi%C5%A1kai)]]<br />
<br />
===Poland===<br />
*Forum: http://forum.archlinux.org.pl/<br />
*Wiki: [[Main page (Polski)]]<br />
<br />
===Portugal===<br />
*Homepage: https://www.tuxpt.com<br />
*Forum: https://www.tuxpt.com/forum/Forum-Arch<br />
<br />
===Romania===<br />
*Homepage: http://archlinux.ro/<br />
*Forum: http://bbs.archlinux.ro/<br />
*Wiki: http://wiki.archlinux.ro/<br />
<br />
===Russia===<br />
*Homepage: http://archlinux.org.ru/<br />
*Forum: http://archlinux.org.ru/forum<br />
*Wiki: [[Main page (Русский)]]<br />
<br />
===Serbia===<br />
*Homepage: http://archlinux.rs/<br />
*Forum: http://bbs.archlinux.rs/<br />
*Wiki: http://wiki.archlinux.rs/<br />
<br />
===Spain and Latin America (España y América Latina)===<br />
*Homepage: http://www.archlinux-es.org/<br />
*Forum: http://foros.archlinux-es.org/<br />
*Wiki: [[Main Page (Espa%C3%B1ol)]]<br />
*Planet: http://planeta.archlinux-es.org<br />
<br />
===Sweden===<br />
*Homepage: http://archlinux.se/<br />
*Forum: http://forum.archlinux.se/<br />
*Wiki: http://wiki.archlinux.se/<br />
<br />
===Taiwan===<br />
*Homepage: http://archlinux.tw/<br />
*Forum: https://groups.google.com/forum/#!forum/archlinux-tw-general<br />
*Wiki: [[Main page (正體中文)]]<br />
<br />
===Turkey===<br />
*Homepage : http://archtr.org/<br />
*Forum : http://archtr.org/forum/<br />
*Wiki : http://archtr.org/wiki/<br />
<br />
===Ukraine===<br />
*Forum: http://archlinux.org.ua/<br />
*Wiki: [[Main page (Українська)]]<br />
<br />
===Vietnam===<br />
*Homepage: http://archlinuxvn.tuxfamily.org/ (vietnamese only)<br />
*Wiki: http://archlinuxvn.tuxfamily.org/<br />
*Projects: http://github.com/archlinuxvn/<br />
*Mailing list: http://groups.google.com/group/archlinuxvn/<br />
<br />
== Related Pages ==<br />
* [[IRC channels]]<br />
* [[Help:i18n#Languages]]</div>AraaXhttps://wiki.archlinux.org/index.php?title=Pacman&diff=413189Pacman2015-12-24T05:33:08Z<p>AraaX: Adding فارسی interlanguage</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Package management]]<br />
[[ar:Pacman]]<br />
[[cs:Pacman]]<br />
[[da:Pacman]]<br />
[[de:Pacman]]<br />
[[el:Pacman]]<br />
[[es:Pacman]]<br />
[[fa:Pacman]]<br />
[[fr:Pacman]]<br />
[[id:Pacman]]<br />
[[it:Pacman]]<br />
[[ja:Pacman]]<br />
[[ko:Pacman]]<br />
[[nl:Pacman]]<br />
[[pl:Pacman]]<br />
[[pt:Pacman]]<br />
[[ro:Pacman]]<br />
[[ru:Pacman]]<br />
[[sr:Pacman]]<br />
[[sv:Pacman]]<br />
[[tr:pacman]]<br />
[[uk:Pacman]]<br />
[[zh-CN:Pacman]]<br />
[[zh-TW:Pacman]]<br />
{{Related articles start}}<br />
{{Related|Creating packages}}<br />
{{Related|Downgrading packages}}<br />
{{Related|pacman/Package signing}}<br />
{{Related|pacman/Pacnew and Pacsave}}<br />
{{Related|pacman/Rosetta}}<br />
{{Related|pacman/Tips and tricks}}<br />
{{Related|FAQ#Package Management}}<br />
{{Related|System maintenance}}<br />
{{Related|Arch Build System}}<br />
{{Related|Official repositories}}<br />
{{Related|Arch User Repository}}<br />
{{Related articles end}}<br />
<br />
The [https://www.archlinux.org/pacman/ pacman] [[Wikipedia:Package management system|package manager]] is one of the major distinguishing features of Arch Linux. It combines a simple binary package format with an easy-to-use [[Arch Build System|build system]]. The goal of ''pacman'' is to make it possible to easily manage packages, whether they are from the [[official repositories]] or the user's own builds.<br />
<br />
''pacman'' keeps the system up to date by synchronizing package lists with the master server. This server/client model also allows the user to download/install packages with a simple command, complete with all required dependencies.<br />
<br />
''pacman'' is written in the C programming language and uses the ''.pkg.tar.xz'' package format.<br />
<br />
{{Tip|The {{Pkg|pacman}} package contains other useful tools such as '''makepkg''', '''pactree''', '''vercmp''', and [[checkupdates]]. Run {{ic|pacman -Qlq pacman <nowiki>|</nowiki> grep bin}} to see the full list.}}<br />
<br />
== Usage ==<br />
<br />
What follows is just a small sample of the operations that ''pacman'' can perform. To read more examples, refer to [https://www.archlinux.org/pacman/pacman.8.html man pacman].<br />
<br />
{{Tip|For those who have used other Linux distributions before, there is a helpful [[Pacman Rosetta]] article.}}<br />
<br />
=== Installing packages ===<br />
<br />
{{Note|Packages often have a series of [[PKGBUILD#optdepends|optional dependencies]] which are packages that provide additional functionality to the application, albeit not strictly required for running it. When installing a package, ''pacman'' will list its optional dependencies among the output messages, but they will not be found in {{ic|pacman.log}}: refer to [[#Querying package databases]] when you want to view the optional dependencies of an already installed package, together with short descriptions of their functionality.}}<br />
<br />
{{Warning|1=When installing packages in Arch, avoid refreshing the package list without [[#Upgrading packages|upgrading the system]] (for example, when a [[#Packages cannot be retrieved on installation|package is no longer found]] in the official repositories). In practice, do '''not''' run {{ic|pacman -Sy ''package_name''}} instead of {{ic|pacman -Sy'''u''' ''package_name''}}, as this could lead to dependency issues. See [[System maintenance#Partial upgrades are unsupported]] and [https://bbs.archlinux.org/viewtopic.php?id=89328 BBS#89328].}}<br />
<br />
==== Installing specific packages ====<br />
<br />
To install a single package or list of packages (including dependencies), issue the following command:<br />
<br />
# pacman -S ''package_name1'' ''package_name2'' ...<br />
<br />
To install a list of packages with regex (see [[pacman tips#Operations and Bash syntax]] and [https://bbs.archlinux.org/viewtopic.php?id=7179 this forum thread]):<br />
<br />
# pacman -S $(pacman -Ssq ''package_regex'')<br />
<br />
Sometimes there are multiple versions of a package in different repositories, e.g. ''extra'' and ''testing''. To install the former version, the repository needs to be defined in front:<br />
<br />
# pacman -S extra/''package_name''<br />
<br />
==== Installing package groups ====<br />
<br />
Some packages belong to a group of packages that can all be installed simultaneously. For example, issuing the command:<br />
<br />
# pacman -S gnome<br />
<br />
will prompt you to select the packages from the {{Grp|gnome}} group that you wish to install.<br />
<br />
Sometimes a package group will contain a large amount of packages, and there may be only a few that you do or do not want to install. Instead of having to enter all the numbers except the ones you do not want, it is sometimes more convenient to select or exclude packages or ranges of packages with the following syntax:<br />
<br />
Enter a selection (default=all): 1-10 15<br />
<br />
which will select packages 1 through 10 and 15 for installation, or:<br />
<br />
Enter a selection (default=all): ^5-8 ^2<br />
<br />
which will select all packages except 5 through 8 and 2 for installation.<br />
<br />
To see what packages belong to the gnome group, run:<br />
<br />
# pacman -Sg gnome<br />
<br />
Also visit https://www.archlinux.org/groups/ to see what package groups are available.<br />
<br />
{{Note|If a package in the list is already installed on the system, it will be reinstalled even if it is already up to date. This behavior can be overridden with the {{ic|--needed}} option.}}<br />
<br />
=== Removing packages ===<br />
<br />
To remove a single package, leaving all of its dependencies installed:<br />
<br />
# pacman -R ''package_name''<br />
<br />
To remove a package and its dependencies which are not required by any other installed package:<br />
<br />
# pacman -Rs ''package_name''<br />
<br />
To remove a package, its dependencies and all the packages that depend on the target package:<br />
<br />
{{Warning|This operation is recursive, and must be used with care since it can remove many potentially needed packages.}}<br />
<br />
# pacman -Rsc ''package_name''<br />
<br />
To remove a package, which is required by another package, without removing the dependent package:<br />
<br />
# pacman -Rdd ''package_name''<br />
<br />
''pacman'' saves important configuration files when removing certain applications and names them with the extension: ''.pacsave''. To prevent the creation of these backup files use the {{ic|-n}} option:<br />
<br />
# pacman -Rn ''package_name''<br />
<br />
{{Note|''pacman'' will not remove configurations that the application itself creates (for example "dotfiles" in the home folder).}}<br />
<br />
=== Upgrading packages ===<br />
<br />
{{Merge|System maintenance||Talk:Pacman#Don't rush upgrades}}<br />
{{Warning|Arch only supports full system upgrades. See [[System maintenance#Partial upgrades are unsupported]] and [[#Installing packages]] for details.}}<br />
<br />
It is recommended that users [[System_maintenance#Upgrading the system|upgrade their system regularly]]. When requesting support from the community, it will usually be assumed that the system is up to date.<br />
<br />
Before upgrading, users are expected to visit the [https://www.archlinux.org/ Arch Linux home page] to check the latest news, or alternatively subscribe to the [https://www.archlinux.org/feeds/news/ RSS feed], [https://mailman.archlinux.org/mailman/listinfo/arch-announce/ arch-announce mailing list], or follow [https://twitter.com/archlinux @archlinux] on Twitter: when updates require out-of-the-ordinary user intervention (more than what can be handled simply by following the instructions given by ''pacman''), an appropriate news post will be made. Users must equally be aware that upgrading packages can raise '''unexpected''' problems that could need immediate intervention, therefore it is discouraged to upgrade a stable system shortly before it is required for carrying out an important task: it is wise to wait instead to have enough time in order to be able to deal with possible post-upgrade issues.<br />
<br />
''pacman'' can update all packages on the system with just one command. This could take quite a while depending on how up-to-date the system is. This command can synchronize the repository databases ''and'' update the system's packages (excluding "local" packages that are not in the configured repositories):<br />
<br />
# pacman -Syu<br />
<br />
''pacman'' is a powerful package management tool, but it does not attempt to handle all corner cases. Users must be vigilant and take responsibility for maintaining their own system. '''When performing a system update, it is essential that users read all information output by ''pacman'' and use common sense.''' If a user-modified configuration file needs to be upgraded for a new version of a package, a ''.pacnew'' file will be created to avoid overwriting settings modified by the user. ''pacman'' will prompt the user to merge them. These files require manual intervention from the user and it is good practice to handle them right after every package upgrade or removal. See [[Pacnew and Pacsave files]] for more information.<br />
<br />
{{Tip|<br />
* Remember that ''pacman'''s output is logged in {{ic|/var/log/pacman.log}}.<br />
* You can use a log viewer such as {{AUR|wat-git}} to search the pacman logs.}}<br />
<br />
If one encounters problems that cannot be solved by these instructions, make sure to search the forum. It is likely that others have encountered the same problem and have posted instructions for solving it.<br />
<br />
=== Querying package databases ===<br />
<br />
''pacman'' queries the local package database with the {{ic|-Q}} flag; see:<br />
<br />
$ pacman -Q --help<br />
<br />
and queries the sync databases with the {{ic|-S}} flag; see:<br />
<br />
$ pacman -S --help<br />
<br />
''pacman'' can search for packages in the database, searching both in packages' names and descriptions:<br />
<br />
$ pacman -Ss ''string1'' ''string2'' ...<br />
<br />
To search for already installed packages:<br />
<br />
$ pacman -Qs ''string1'' ''string2'' ...<br />
<br />
To display extensive information about a given package:<br />
<br />
$ pacman -Si ''package_name''<br />
<br />
For locally installed packages:<br />
<br />
$ pacman -Qi ''package_name''<br />
<br />
Passing two {{ic|-i}} flags will also display the list of backup files and their modification states:<br />
<br />
$ pacman -Qii ''package_name''<br />
<br />
To retrieve a list of the files installed by a package:<br />
<br />
$ pacman -Ql ''package_name''<br />
<br />
For packages not installed, use [[pkgfile]].<br />
<br />
To verify the presence of the files installed by a package:<br />
<br />
$ pacman -Qk ''package_name''<br />
<br />
Passing the {{ic|k}} flag twice will perform a more thorough check.<br />
<br />
One can also query the database to know which package a file in the file system belongs to:<br />
<br />
$ pacman -Qo ''/path/to/file_name''<br />
<br />
To list all packages no longer required as dependencies (orphans):<br />
<br />
$ pacman -Qdt<br />
<br />
To list all packages explicitly installed and not required as dependencies:<br />
<br />
$ pacman -Qet<br />
<br />
To list a dependency tree of a package:<br />
<br />
$ pactree ''package_name''<br />
<br />
To list all the packages recursively depending on an ''installed'' package, use ''whoneeds'' from {{AUR|pkgtools}}:<br />
<br />
$ whoneeds ''package_name''<br />
<br />
or the reverse flag to ''pactree'':<br />
<br />
$ pactree -r ''package_name''<br />
<br />
See [[pacman tips]] for more examples.<br />
<br />
==== Database structure ====<br />
<br />
The pacman databases are normally located at {{ic|/var/lib/pacman/sync}}. For each repository specified in {{ic|/etc/pacman.conf}} there will be a corresponding database file located there. Database files are tar-gzipped archives containing one directory for each package, for example for the {{Pkg|which}} package:<br />
<br />
{{bc|<br />
% tree which-2.20-6 <br />
which-2.20-6<nowiki><br />
|-- depends<br />
`-- desc</nowiki><br />
}}<br />
<br />
The {{ic|depends}} file lists the packages this package depends on, while {{ic|desc}} has a description of the package such as the file size and the MD5 hash.<br />
<br />
=== Cleaning the package cache ===<br />
<br />
''pacman'' stores its downloaded packages in {{ic|/var/cache/pacman/pkg/}} and does not remove the old or uninstalled versions automatically, therefore it is necessary to deliberately clean up that folder periodically to prevent such folder to grow indefinitely in size.<br />
<br />
The built-in option to remove all the cached packages that are not currently installed is:<br />
<br />
# pacman -Sc<br />
<br />
{{Warning|<br />
* Only do this when certain that previous package versions are not required, for example for a later [[downgrade]]. {{ic|pacman -Sc}} only leaves the versions of packages which are ''currently installed'' available, older versions would have to be retrieved through other means, such as the [[Archive]].<br />
* It is possible to empty the cache folder fully with {{ic|pacman -Scc}}. In addition to the above, this also also prevents from reinstalling a package directly ''from'' the cache folder in case of need, thus requiring a new download. It should be avoided unless there is an immediate need for disk space.<br />
}}<br />
<br />
Because of the above limitations, consider an alternative for more control over which packages, and how many, are deleted from the cache:<br />
<br />
The ''paccache'' script, provided by the {{Pkg|pacman}} package itself, deletes all cached versions of each package, except for the most recent 3, by default:<br />
<br />
# paccache -r<br />
<br />
Used this way, it will ''not'' check whether a package is still installed or not, and uninstalled packages will remain in the cache. To remove all cached versions of uninstalled packages, re-run ''paccache'' with:<br />
<br />
# paccache -ruk0<br />
<br />
See {{ic|paccache -h}} for more options.<br />
<br />
{{AUR|pkgcacheclean}} and {{AUR|pacleaner}} are two further alternatives.<br />
<br />
=== Additional commands ===<br />
<br />
Download a package without installing it:<br />
<br />
# pacman -Sw ''package_name''<br />
<br />
Install a 'local' package that is not from a remote repository (e.g. the package is from the [[AUR]]):<br />
<br />
# pacman -U /path/to/package/package_name-version.pkg.tar.xz<br />
<br />
To keep a copy of the local package in ''pacman'''s cache, use:<br />
<br />
# pacman -U file:///path/to/package/package_name-version.pkg.tar.xz<br />
<br />
Install a 'remote' package (not from a repository stated in ''pacman'''s configuration files):<br />
<br />
# pacman -U <nowiki>http://www.example.com/repo/example.pkg.tar.xz</nowiki><br />
<br />
To inhibit the {{ic|-S}}, {{ic|-U}} and {{ic|-R}} actions, {{ic|-p}} can be used.<br />
<br />
''pacman'' always lists packages to be installed or removed and asks for permission before it takes action.<br />
<br />
== Configuration ==<br />
<br />
''pacman'''s settings are located in {{ic|/etc/pacman.conf}}. This is the place where the user configures the program to work in the desired manner. In-depth information about the configuration file can be found in [https://www.archlinux.org/pacman/pacman.conf.5.html man pacman.conf].<br />
<br />
=== General options ===<br />
<br />
General options are in the {{ic|[options]}} section. Read the [[man page]] or look in the default {{ic|pacman.conf}} for information on what can be done here.<br />
<br />
==== Skip package from being upgraded ====<br />
<br />
To have a specific package skipped when [[#Upgrading packages|upgrading]] the system, specify it as such:<br />
<br />
IgnorePkg=linux<br />
<br />
For multiple packages use a space-separated list, or use additional {{ic|IgnorePkg}} lines. Also, glob patterns can be used. If you want to skip packages just once, you can also use the {{ic|--ignore}} option on the command-line - this time with a comma-separated list.<br />
<br />
It will still be possible to upgrade the ignored packages using {{ic|pacman -S}}: in this case ''pacman'' will remind you that the packages have been included in an {{ic|IgnorePkg}} statement.<br />
<br />
==== Skip package group from being upgraded ====<br />
<br />
As with packages, skipping a whole package group is also possible:<br />
<br />
IgnoreGroup=gnome<br />
<br />
==== Skip files from being installed to system ====<br />
<br />
To always skip installation of specific directories list them under {{Ic|NoExtract}}. For example, to avoid installation of [[systemd]] units use this:<br />
<br />
NoExtract=usr/lib/systemd/system/*<br />
<br />
Or as a preemptive alternative to {{AUR|localepurge}}, to avoid installing non-English localizations:<br />
<br />
NoExtract = usr/share/help/* !usr/share/help/en*<br />
NoExtract = usr/share/locale/* !usr/share/locale/en*<br />
NoExtract = usr/share/man/* !usr/share/man/man*<br />
NoExtract = usr/share/vim/vim74/lang/*<br />
<br />
Later rules override previous ones, and you can negate a rule by prepending {{ic|!}} — this allows you to keep the locales you need.<br />
<br />
==== Maintain several configuration files ====<br />
<br />
If you have several configuration files (e.g. main configuration and configuration with [[testing]] repository enabled) and would have to share options between configurations you may use {{ic|Include}} option declared in the configuration files, e.g.:<br />
<br />
Include = /path/to/common/settings<br />
<br />
where {{ic|/path/to/common/settings}} file contains the same options for both configurations.<br />
<br />
=== Repositories ===<br />
<br />
{{Expansion|mirrorlist contains only official repositories, even though some [[unofficial user repositories]] also provide their own mirrors.}}<br />
<br />
This section defines which [[Official repositories|repositories]] to use, as referred to in {{ic|/etc/pacman.conf}}. They can be stated here directly or included from another file (such as {{ic|/etc/pacman.d/mirrorlist}}), thus making it necessary to maintain only one list. See [[Mirrors]] article for mirror configuration.<br />
<br />
=== Package security ===<br />
<br />
''pacman'' 4 supports package signatures, which add an extra layer of security to the packages. The default configuration, {{ic|1=SigLevel = Required DatabaseOptional}}, enables signature verification for all the packages on a global level: this can be overridden by per-repository {{ic|SigLevel}} lines as shown above. For more details on package signing and signature verification, take a look at [[pacman-key]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== "Failed to commit transaction (conflicting files)" error ===<br />
<br />
If you see the following error: [https://bbs.archlinux.org/viewtopic.php?id=56373]<br />
<br />
error: could not prepare transaction<br />
error: failed to commit transaction (conflicting files)<br />
''package'': ''/path/to/file'' exists in filesystem<br />
Errors occurred, no packages were upgraded.<br />
<br />
Why this is happening: ''pacman'' has detected a file conflict, and by design, will not overwrite files for you. This is a design feature, not a flaw.<br />
<br />
The problem is usually trivial to solve. A safe way is to first check if another package owns the file ({{ic|pacman -Qo ''/path/to/file''}}). If the file is owned by another package, [[Reporting bug guidelines|file a bug report]]. If the file is not owned by another package, rename the file which 'exists in filesystem' and re-issue the update command. If all goes well, the file may then be removed.<br />
<br />
If you had installed a program manually without using ''pacman'' or a frontend, for example through {{ic|make install}}, you have to remove it and all its files and reinstall properly using ''pacman''. See also [[Pacman tips#Identify files not owned by any package]].<br />
<br />
Every installed package provides a {{ic|/var/lib/pacman/local/''$package-$version''/files}} file that contains metadata about this package. If this file gets corrupted, is empty or goes missing, it results in {{ic|file exists in filesystem}} errors when trying to update the package. Such an error usually concerns only one package. Instead of manually renaming and later removing all the files that belong to the package in question, you may exceptionally run {{ic|pacman -S --force $package}} to force ''pacman'' to overwrite these files.<br />
<br />
{{Warning|Take care when using the {{ic|--force}} switch (for example {{ic|pacman -Syu --force}}) as it can cause major problems if used improperly. It is highly recommended to only use this option when the Arch news instructs the user to do so.}}<br />
<br />
=== "Failed to commit transaction (invalid or corrupted package)" error ===<br />
<br />
Look for ''.part'' files (partially downloaded packages) in {{ic|/var/cache/pacman/pkg}} and remove them (often caused by usage of a custom {{ic|XferCommand}} in {{ic|pacman.conf}}).<br />
<br />
# find /var/cache/pacman/pkg/ -iname "*.part" -exec rm {} \;<br />
<br />
=== "Failed to init transaction (unable to lock database)" error ===<br />
<br />
When ''pacman'' is about to alter the package database, for example installing a package, it creates a lock file at {{ic|/var/lib/pacman/db.lck}}. This prevents another instance of ''pacman'' from trying to alter the package database at the same time.<br />
<br />
If ''pacman'' is interrupted while changing the database, this stale lock file can remain. If you are certain that no instances of ''pacman'' are running then delete the lock file:<br />
<br />
# rm /var/lib/pacman/db.lck<br />
<br />
=== Packages cannot be retrieved on installation ===<br />
<br />
This error manifests as {{ic|Not found in sync db}}, {{ic|Target not found}} or {{ic|Failed retrieving file}}.<br />
<br />
Firstly, ensure the package actually exists (and watch out for typos!). If certain the package exists, your package list may be out-of-date or your repositories may be incorrectly configured. Try running {{ic|pacman -Syyu}} to force a refresh of all package lists and upgrade.<br />
<br />
It could also be that the repository containing the package is not enabled on your system, e.g. the package could be in the ''multilib'' repository, but ''multilib'' is not enabled in your ''pacman.conf''.<br />
<br />
See also [[FAQ#Why is there only a single version of each shared library in the official repositories?]].<br />
<br />
=== The same package is upgraded repeatedly ===<br />
<br />
{{Note|''pacman'' version 3.4 should display an error in case of duplicate entries, which should make this note obsolete.}}<br />
<br />
This is due to duplicate entries in {{ic|/var/lib/pacman/local/}}, such as two {{ic|linux}} instances. {{ic|pacman -Qi}} outputs the correct version, but {{ic|pacman -Qu}} recognizes the old version and therefore will attempt to upgrade.<br />
<br />
The solution is to delete the offending entry in {{ic|/var/lib/pacman/local/}}.<br />
<br />
=== Search for a package that contains a specific file ===<br />
<br />
Install [[pkgfile]] which uses a separate database with all files and their associated packages.<br />
<br />
=== pacman is broken beyond repair ===<br />
<br />
{{Accuracy|Any broken dependency of ''pacman'' also breaks ''pacman'', but many dependencies are not mentioned (run {{ic|<nowiki>pactree -l pacman | sort -u | cut -f 1 -d ' '</nowiki>}} to see them all). The info below is likely just a specific case where only two dependencies were broken.}}<br />
<br />
In the case that ''pacman'' is broken beyond repair, manually download the necessary packages ({{Pkg|openssl}}, {{Pkg|libarchive}}, and {{Pkg|pacman}}) and extract them to root. The ''pacman'' binary will be restored along with its default configuration file. Afterwards, reinstall these packages with ''pacman'' to maintain package database integrity. Additional information and an example (outdated) script that automates the process is available in [https://bbs.archlinux.org/viewtopic.php?id=95007 this] forum post.<br />
<br />
Alternatively, you can also use an Arch live media and follow [[#pacman crashes during an upgrade]] to re-install pacman.<br />
<br />
=== pacman crashes during an upgrade ===<br />
<br />
In the case that ''pacman'' crashes with a "database write" error while removing packages, and reinstalling or upgrading packages fails thereafter, do the following:<br />
<br />
# Boot using the Arch installation media. Preferably use a recent media so that the ''pacman'' version matches/is newer than the system. <br />
# Mount the system's root filesystem, e.g. {{ic|mount /dev/sdaX /mnt}} as root, and check the mount has sufficient space with {{ic|df -h}} <br />
# If the system uses default database and directory locations, you can now update the system's pacman database and upgrade it via {{ic|1=pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -Syyu}} as root. <br />
# After the upgrade, one way to double-check for not upgraded but still broken packages: {{ic|find /mnt/usr/lib -size 0}} <br />
# Followed by a re-install of any still broken package via {{ic|1=pacman --root /mnt --cachedir=/mnt/var/cache/pacman/pkg -S ''package''}}.<br />
<br />
=== pacman crashes the official installation media ===<br />
<br />
The official installation media (ISO) before version 10.2015 are not setup to be updated itself at runtime. Running {{ic|pacman -Syu}} from a booted install media console may crash unexpectedly any time, as soon as memory is depleted. This happens because the install media image build reports an arbitrary capacity (of 32GB) to pacman, regardless of available free memory.[https://bugs.archlinux.org/task/45618#comment137346] At the same time the ISO reserves only a low static memory allotment for operations ({{ic|/run/archiso/cowspace}} of {{ic|256MB}} RAM) of the live system, in order to allow installation on machines with low resources. If the machine has more RAM available, you can override the allotment by setting the {{ic|1=cow_spacesize=}} kernel option for the ISO manually, e.g. {{ic|1=cow_spacesize=2GB}}. <br />
<br />
If you use the install media to update an installed system, you simply have to use the {{ic|1=--root=}} option along with a {{ic|1=--cachedir=}} path to point pacman to available real storage. For example, see [[#pacman crashes during an upgrade]]. <br />
<br />
If you ''require'' an install media with persistent dataspace, the [[Archiso]] build script can be used to create one along with its [https://projects.archlinux.org/archiso.git/tree/docs/README.bootparams boot options].<br />
<br />
=== "Unable to find root device" error after rebooting ===<br />
<br />
Most likely your initramfs got broken during a kernel update (improper use of ''pacman'''s {{ic|--force}} option can be a cause). You have two options; first, try the ''Fallback'' entry:<br />
<br />
{{Tip|In case you removed this entry for whatever reason, you can always press the {{ic|Tab}} key when the bootloader menu shows up (for Syslinux) or {{ic|e}} (for GRUB or gummiboot), rename it {{ic|initramfs-linux-fallback.img}} and press {{ic|Enter}} or {{ic|b}} (depending on your bootloader) to boot with the new parameters.}}<br />
<br />
Once the system starts, run this command (for the stock {{Pkg|linux}} kernel) either from the console or from a terminal to rebuild the initramfs image:<br />
<br />
# mkinitcpio -p linux<br />
<br />
If that does not work, from a current Arch release (CD/DVD or USB stick), run:<br />
<br />
{{Note|If you do not have a current release or if you only have some other "live" Linux distribution laying around, you can [[chroot]] using the old fashioned way. Obviously, there will be more typing than simply running the {{ic|arch-chroot}} script.}}<br />
<br />
# mount /dev/sdxY /mnt # Your root partition.<br />
# mount /dev/sdxZ /mnt/boot # If you use a separate /boot partition.<br />
# arch-chroot /mnt<br />
# pacman -Syu mkinitcpio systemd linux<br />
<br />
{{Note|If ''pacman'' fails with {{ic|Could not resolve host}}, please [[Network_configuration#Check_the_connection|check your internet connection]].}}<br />
<br />
Reinstalling the kernel (the {{Pkg|linux}} package) will automatically re-generate the initramfs image with {{ic|mkinitcpio -p linux}}. There is no need to do this separately.<br />
<br />
Afterwards, it is recommended that you run {{ic|exit}}, {{ic|umount /mnt/{boot,} }} and {{ic|reboot}}.<br />
<br />
{{Note|If you cannot enter the arch-chroot or chroot environment but need to re-install packages you can use the command {{ic|pacman -r /mnt -Syu foo bar}} to use ''pacman'' on your root partition.}}<br />
<br />
=== Signature from "User <email@gmail.com>" is unknown trust, installation failed ===<br />
<br />
Follow [[pacman-key#Resetting all the keys]]. Or you can try to either:<br />
* update the known keys, i.e. {{ic|pacman-key --refresh-keys}};<br />
* or manually upgrade {{Pkg|archlinux-keyring}} package first, i.e. {{ic|pacman -S archlinux-keyring}}.<br />
<br />
=== Request on importing PGP keys ===<br />
<br />
If [[Installation guide|installing]] Arch with an outdated ISO, you are likely prompted to import PGP keys. Agree to download the key to proceed. If you are unable to add the PGP key successfully, update the keyring or upgrade {{Pkg|archlinux-keyring}} (see [[#Signature from "User <email@gmail.com>" is unknown trust, installation failed|above]]).<br />
<br />
=== Signature from "User <email@archlinux.org>" is invalid, installation failed ===<br />
<br />
When the system time is faulty, signing keys are considered expired (or invalid) and signature checks on packages will fail with the following error:<br />
<br />
error: ''package'': signature from "User <email@archlinux.org>" is invalid<br />
error: failed to commit transaction (invalid or corrupted package (PGP signature))<br />
Errors occured, no packages were upgraded.<br />
<br />
Make sure to correct the [[time]], for example with {{ic|ntpd -qg}} run as root, and run {{ic|hwclock -w}} as root before subsequent installations or upgrades.<br />
<br />
=== "Warning: current locale is invalid; using default "C" locale" error ===<br />
<br />
As the error message says, your locale is not correctly configured. See [[Locale]].<br />
<br />
=== pacman does not honor proxy settings ===<br />
<br />
Make sure that the relevant environment variables ({{ic|$http_proxy}}, {{ic|$ftp_proxy}} etc.) are set up. If you use ''pacman'' with [[sudo]], you need to configure sudo to [[sudo#Environment variables|pass these environment variables to pacman]].<br />
<br />
=== How do I reinstall all packages, retaining information on whether something was explicitly installed or as a dependency? ===<br />
<br />
To reinstall all the native packages: {{ic|<nowiki>pacman -Qnq | pacman -S -</nowiki>}} (the {{ic|-S}} option preserves the installation reason by default).<br />
<br />
You will then need to reinstall all the foreign packages, which can be listed with {{ic|pacman -Qmq}}.<br />
<br />
=== "Cannot open shared object file" error ===<br />
<br />
It looks like previous ''pacman'' transaction removed or corrupted shared libraries needed for pacman itself.<br />
<br />
To recover from this situation you need to unpack required libraries to your filesystem manually. First find what package contains the missed library and then locate it in the ''pacman'' cache ({{ic|/var/cache/pacman/pkg/}}). Unpack required shared library to the filesystem. This will allow to run ''pacman''.<br />
<br />
Now you need to [[#Installing specific packages|reinstall]] the broken package. Note that you need to use {{ic|--force}} flag as you just unpacked system files and ''pacman'' does not know about it. ''pacman'' will correctly replace our shared library file with one from package.<br />
<br />
That's it. Update the rest of the system.<br />
<br />
=== Freeze of package downloads ===<br />
<br />
Some issues have been reported regarding network problems that prevent ''pacman'' from updating/synchronizing repositories. [https://bbs.archlinux.org/viewtopic.php?id&#61;68944] [https://bbs.archlinux.org/viewtopic.php?id&#61;65728] When installing Arch Linux natively, these issues have been resolved by replacing the default ''pacman'' file downloader with an alternative (see [[Improve pacman performance]] for more details). When installing Arch Linux as a guest OS in [[VirtualBox]], this issue has also been addressed by using ''Host interface'' instead of ''NAT'' in the machine properties.<br />
<br />
=== Failed retrieving file 'core.db' from mirror ===<br />
<br />
If you receive this error message with correct [[mirrors]], try setting a different [[Resolv.conf|name server]].<br />
<br />
== See also ==<br />
<br />
* [https://www.archlinux.org/pacman/ Pacman's homepage]<br />
* [https://www.archlinux.org/pacman/libalpm.3.html libalpm(3) Manual Page]<br />
* [https://www.archlinux.org/pacman/pacman.8.html pacman(8) Manual Page]<br />
* [https://www.archlinux.org/pacman/pacman.conf.5.html pacman.conf(5) Manual Page]<br />
* [https://www.archlinux.org/pacman/repo-add.8.html repo-add(8) Manual Page]</div>AraaXhttps://wiki.archlinux.org/index.php?title=VLC_media_player&diff=411509VLC media player2015-12-11T14:54:22Z<p>AraaX: Adding فارسی interlanguage</p>
<hr />
<div>[[Category:Multimedia players]]<br />
[[de:VLC]]<br />
[[fa:پخشکننده_صوتیتصویری_VLC]]<br />
[[ja:VLC media player]]<br />
From the project [http://www.videolan.org/vlc/ home page]:<br />
: ''VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVD, Audio CD, VCD, and various streaming protocols.''<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|vlc}} from the [[official repositories]].<br />
<br />
Notable variants are:<br />
* {{AUR|vlc-git}} - Development branch.<br />
<br />
If you want to play audio CDs, you should also install {{Pkg|libcddb}}.<br />
<br />
== Language ==<br />
<br />
It seems VLC does not offer an option to change language in its ''Preferences'' menu. But you can use the ''LANGUAGE='' prefix. For instance, modify the {{ic|/usr/share/applications/vlc.desktop}} line:<br />
Exec=/usr/bin/vlc %U<br />
to:<br />
Exec=LANGUAGE=fr /usr/bin/vlc %U<br />
to switch VLC interface to French. <br />
<br />
== Skins ==<br />
<br />
VLC can be "skinned" for a different look and feel. You can obtain new skins for VLC from http://www.videolan.org/vlc/skins.php.<br />
<br />
Installation of skins is simple just download the skin you wish to use and copy it to:<br />
~/.local/share/vlc/skins2<br />
Open up VLC, click ''Tools > Preferences''. When the preferences window opens up you should be in the "Interface" tab<br />
<br />
Choose the "Use custom skin" radio button, and browse to the location of the downloaded skin.<br />
<br />
Restart VLC for the change to take effect.<br />
<br />
Note: You need to install {{Pkg|libtar}} from the [[official repositories]] to use the skinnable interface module.<br />
<br />
== Web interface ==<br />
<br />
Run VLC with the parameter {{ic|--extraintf&#61;http}} to use both the desktop and web interface. The {{ic|--http-host}} parameter specifies the address to, which is {{ic|localhost}} by default. To set a password, use {{ic|--http-password}}, otherwise VLC will not allow you to log in.<br />
# vlc --extraintf=http --http-host 0.0.0.0:8080 --http-password 'yourpasswordhere'<br />
<br />
Or you can enable this feature in the UI by navigating to ''View > Add Interface > Web Interface''.<br />
<br />
VLC defaults to port 8080: http://127.0.0.1:8080<br />
<br />
Edit {{ic|/usr/share/vlc/lua/http/.hosts}} to allow remote connections. You will need to restart VLC in order for changes to take effect.<br />
<br />
== Tips and tricks ==<br />
<br />
=== File association in GNOME ===<br />
<br />
Copy the system desktop file to the local one (local {{ic|.desktop}} files supersede the global ones):<br />
<br />
$ cp /usr/share/applications/vlc.desktop ~/.local/share/applications/<br />
<br />
Define its mime types (known playback file type abilities) by doing:<br />
<br />
{{bc|<nowiki><br />
sed -i 's|^Mimetype.*$|MimeType=video/dv;video/mpeg;video/x-mpeg;video/msvideo;video/quicktime;video/x-anim;video/x-avi;video/x-ms-asf;video/x-ms-wmv;video/x-msvideo;video/x-nsv;video/x-flc;video/x-fli;application/ogg;application/x-ogg;application/x-matroska;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-wav;audio/x-mpegurl;audio/x-scpls;audio/x-m4a;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;application/vnd.rn-realmedia;audio/x-real-audio;audio/x-pn-realaudio;application/x-flac;audio/x-flac;application/x-shockwave-flash;misc/ultravox;audio/vnd.rn-realaudio;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-wav;audio/x-pn-windows-acm;image/vnd.rn-realpix;video/vnd.rn-realvideo;audio/x-pn-realaudio-plugin;application/x-extension-mp4;audio/mp4;video/mp4;video/mp4v-es;x-content/video-vcd;x-content/video-svcd;x-content/video-dvd;x-content/audio-cdda;x-content/audio-player;|' ~/.local/share/applications/vlc.desktop<br />
</nowiki>}}<br />
<br />
Then in ''System Settings > Details > Default Applications '' and on the ''Video'' drop-down menu, select ''Open VLC media player''.<br />
<br />
=== Twitch.tv streaming over VLC ===<br />
<br />
See [[Livestreamer#Twitch]].<br />
<br />
=== Playing streamed content from a local DLNA server ===<br />
<br />
If you find that trying to play uPNP/DLNA content (by going to ''View > Playlist > Local Network > Universal Plug'n'Play''), that vlc fails to see the DLNA server on the local network, then make sure that the firewall is not blocking port 1900 UDP. It is essential that this port is open in order to play local uPNP/DLNA content.<br />
<br />
=== Control using hotkeys or cli ===<br />
<br />
Install {{Pkg|openbsd-netcat}}.<br />
<br />
Get script at: http://crunchbang.org/forums/viewtopic.php?pid=112035%23p112035#p112035<br />
<br />
Follow instructions in script to setup a socket for VLC.<br />
<br />
Either run the script from the command line or register the script with keyboard shortcuts through your desktop.<br />
<br />
=== Preventing multiple instances ===<br />
<br />
The default settings for VLC is to open a new instance of the program for each file that is opened. This can be annoying if you are using VLC for something like playing your music collection. You can disable this in ''Tools > Preferences > Interface > Instances > Allow only one instance''. Optionally. tick ''Enqueue files when in one instance mode'' which keeps current file playing and adds any newly opened files to the current playlist.<br />
<br />
=== Hardware acceleration support ===<br />
<br />
To enable hardware acceleration since version 2.1.x: ''Tools > Preferences > Input & Codecs'', then choose under ''Hardware-accelerated decoding'' the suitable item, e.g. {{ic|Video Acceleration (VA) API}} or {{ic|Video Decode and Presentation API for Unix (VDPAU)}}.<br />
<br />
To enable hardware acceleration in previous versions: ''Tools > Preferences > Input & Codecs'', then check {{ic|Use GPU accelerated decoding}}.<br />
<br />
=== systemd service ===<br />
<br />
{{Note|''cvlc'' is the ''Console VLC Player'', or VLC without graphical interface.}}<br />
<br />
{{Accuracy|{{ic|nobody}} is a valid user for daemons, should it still be changed?}}<br />
<br />
Change the {{ic|1=User=}} parameter.<br />
<br />
{{hc|/etc/systemd/system/vlc.service|<nowiki><br />
[Unit]<br />
Description=VideoOnLAN Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=nobody<br />
ExecStart=/usr/bin/cvlc --intf=lua --lua-intf=http --daemon --http-port 8090<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Video broken or other issue after upgrade ===<br />
<br />
Now and then VLC will have some issues with configuration even in minor releases. Before making bug reports, remove or rename your configuration located at {{ic|~/.config/vlc}} and confirm whether the issue is still there.<br />
<br />
If using a ffmpeg variant from the AUR, be sure that you have upgraded it as well. Pacman will not upgrade it when necessary and a mismatch will break VLC.<br />
<br />
=== Segmentation fault ===<br />
<br />
When starting VLC you can get a segfault, and ruling out general factors such as [[Microcode]], a possible workaround to this is running the following:<br />
<br />
# /usr/lib/vlc/vlc-cache-gen -f usr/lib/vlc/plugins<br />
<br />
Then reinstall VLC.<br />
<br />
Another workaround can be reinstalling vlc within an {{ic|LD_PRELOAD}} environment:<br />
<br />
# LD_PRELOAD=/usr/lib/libgobject-2.0.so.0 pacman -S vlc<br />
<br />
=== Missing icons in dropdown menus ===<br />
<br />
This can happen under XFCE, there will be no more icons in dropdown menus, like the or the PCI card icon.<br />
<br />
Execute these commands to reactivate these icons:<br />
{{bc|1=<br />
$ gconftool-2 --type boolean --set /desktop/gnome/interface/buttons_have_icons true<br />
$ gconftool-2 --type boolean --set /desktop/gnome/interface/menus_have_icons true<br />
}}<br />
<br />
=== Failed to open VDPAU backend ===<br />
<br />
By changing some VLC preferences, you can fix the following message:<br />
<br />
Failed to open VDPAU backend libvdpau_i965.so: cannot open shared object file: No such file or director<br />
<br />
In ''Tools'', ''Preferences'', ''Video'' tab (v2.2.0 menu) select "OpenGL video output (experimental)" for ''Output'' and, in ''Input/Codecs'', "VA-API video decoder via X11/DRM" (both are OK) in ''Hardware-accelerated decoding'' (''Codecs'' group).[https://bugs.archlinux.org/task/44569]<br />
<br />
=== No playback via SFTP of media files names containing spaces ===<br />
<br />
If vlc does not play any videos or audio files over SFTP first confirm you have sshfs installed.<br />
<br />
If it refuses to play any media files containing spaces via SFTP and always asks for authentication change the line<br />
<br />
Exec=/usr/bin/vlc --started-from-file %U<br />
<br />
to<br />
<br />
Exec=/usr/bin/vlc --started-from-file %F<br />
<br />
in the vlc.desktop file. [https://bugs.launchpad.net/ubuntu/+source/vlc/+bug/239431/comments/11]<br />
<br />
== See also ==<br />
<br />
* [[List of applications#Multimedia]]<br />
* [http://www.videolan.org/vlc/ VLC homepage]<br />
* [https://github.com/acrisci/playerctl playerctl]: A command-line utility and library for controlling media players<br />
* [http://wiki.videolan.org/Control_VLC_via_a_browser Control VLC via a browser]</div>AraaXhttps://wiki.archlinux.org/index.php?title=TeX_Live&diff=411508TeX Live2015-12-11T14:52:36Z<p>AraaX: Adding فارسی interlanguage</p>
<hr />
<div>[[Category:TeX]]<br />
[[fa:LaTeX]]<br />
[[it:TeX Live]]<br />
[[ja:TeX Live]]<br />
[[zh-cn:TeX Live]]<br />
{{Related articles start}}<br />
{{Related|TeX Live FAQ}}<br />
{{Related|TeX Live and CJK}}<br />
{{Related|Ooolatex}}<br />
{{Related|List of applications/Documents#Scientific_documents}}<br />
{{Related articles end}}<br />
[https://www.tug.org/texlive/ TeX Live] is an "easy way to get up and running with the [[Wikipedia:TeX|TeX]] document production system. It provides a comprehensive TeX system with binaries for most flavors of Unix, including GNU/Linux, and also Windows. It includes all the major TeX-related programs, macro packages, and fonts that are free software, including support for many languages around the world."<br />
<br />
TeX Live is one of the most popular distribution for [[Wikipedia:LaTeX|LaTeX]], [[Wikipedia:ConTeXt|ConTeXt]] and friends.<br />
<br />
== Installation ==<br />
The TeX Live packages are arranged into two groups in the [[official repositories]]: <br />
* {{grp|texlive-most}} includes TeX Live applications.<br />
* {{grp|texlive-lang}} provides various character sets and non-English features.<br />
<br />
The essential package {{Pkg|texlive-core}} contains the basic texmf-dist tree, while {{Pkg|texlive-bin}} contains the binaries, libraries, and the texmf tree. {{Pkg|texlive-core}} is based on the “medium” install scheme of the upstream distribution. All other packages are based on the eponymous collections in TeX Live. To determine which CTAN packages are included in each package, lookup the files:<br />
/var/lib/texmf/arch/installedpkgs/<package>_<revnr>.pkgs<br />
<br />
=== texlive-most ===<br />
{| width="100%"<br />
|- valign="top"<br />
|<br />
* {{Pkg|texlive-core}}<br />
* {{Pkg|texlive-bibtexextra}}<br />
* {{Pkg|texlive-fontsextra}}<br />
* {{Pkg|texlive-formatsextra}}<br />
* {{Pkg|texlive-games}}<br />
|<br />
* {{Pkg|texlive-genericextra}}<br />
* {{Pkg|texlive-htmlxml}}<br />
* {{Pkg|texlive-humanities}}<br />
* {{Pkg|texlive-latexextra}}<br />
* {{Pkg|texlive-music}}<br />
|<br />
* {{Pkg|texlive-pictures}}<br />
* {{Pkg|texlive-plainextra}}<br />
* {{Pkg|texlive-pstricks}}<br />
* {{Pkg|texlive-publishers}}<br />
* {{Pkg|texlive-science}}<br />
|}<br />
<br />
=== texlive-lang ===<br />
* {{Pkg|texlive-langchinese}}<br />
* {{Pkg|texlive-langcyrillic}}<br />
* {{Pkg|texlive-langgreek}}<br />
* {{Pkg|texlive-langjapanese}}<br />
* {{Pkg|texlive-langkorean}}<br />
* {{Pkg|texlive-langextra}}<br />
<br />
{{note|{{Pkg|texlive-langextra}} provides language support for African, Arabic, Armenian, Croatian, Hebrew, Indic, Mongolian, Tibetan and Vietnamese.}}<br />
<br />
=== Manual installation ===<br />
<br />
See the [https://en.wikibooks.org/wiki/LaTeX/Installation#Custom_installation_with_TeX_Live LaTeX Wikibook] and [https://tug.org/texlive/doc/texlive-en/texlive-en.html#x1-140003 TeX Live Guide]. For programs that require TeX Live to be installed (e.g. kile) you can use the {{AUR|texlive-dummy}} package.<br />
<br />
== Usage ==<br />
<br />
You can test your installation with<br />
<br />
$ tex '\empty Hello world!\bye'<br />
$ pdftex '\empty Hello world!\bye'<br />
<br />
You should get a DVI or a PDF file accordingly.<br />
<br />
You will probably want a [[List of applications/Documents#Scientific_documents|TeX editor]].<br />
<br />
{{Merge|Wikibooks:LaTeX/Installation#Online_solutions|Inappropriate here|section=LaTeX merge}}<br />
<br />
There are also a few online solutions that let you create TeX-based documents without TeX Live:<br />
<br />
* {{App|Authorea|Online collaborative editor for scientific, academic, and technical documents.|https://www.authorea.com/|}}<br />
* {{App|ShareLaTeX|An open source online LaTeX editor. You can either run your own local version where you can host, edit, collaborate in real-time, and compile your LaTeX documents, or simply use the version hosted on the official website.|https://www.sharelatex.com/|}}<br />
* {{App|Overleaf|(Previously writeLaTeX) Online collaborative LaTeX editor with integrated real-time preview.|https://www.overleaf.com/|}}<br />
* {{App|cloudTeX|Social TeX in the cloud.|https://cloud-tex.com/|}}<br />
* {{App|Papeeria|Online LaTeX editor.|http://papeeria.com/|}}<br />
<br />
Find more on the [https://en.wikibooks.org/wiki/LaTeX/Installation#Online_solutions LaTeX wikibook].<br />
<br />
== Important information ==<br />
* The way to handle font mappings for updmap was improved in September 2009, and installation should now be much more reliable than in the past. In the meantime, if you encounter error messages about unavailable map files, simply remove them by hand from the {{ic|updmap.cfg}} file (ideally using {{Ic|updmap-sys --edit}}). You can also run {{Ic|updmap-sys --syncwithtrees}} to automatically comment out outdated map lines from the config file.<br />
<br />
* The ConTeXt formats (for MKII and MKIV) are not automatically generated upon installation. See [http://wiki.contextgarden.net the ConTeXT wiki] for instructions on how to do this.<br />
<br />
* The packages containing the documentation and sources are '''no longer available''' in official repositories. You can locally build them with [[#TeXLive Local Manager|tllocalmgr]]. You can also consult documentation online at https://tug.org/texlive/Contents/live/doc.html or on CTAN. Another possibility is using the online documentation at {{ic|<nowiki>http://texdoc.net/pkg/packagename</nowiki>}} which resolves to the relevant pdf for {{ic|packagename}}, similar to the command line tool {{ic|texdoc}} (which is useless without locally installed documentation).<br />
<br />
* TeX Live (upstream) now provides a tool for incremental updates of CTAN packages. On that basis, we also plan to update our packages on a regular basis (we have written tools that almost automate that task).<br />
<br />
* Some tools and utilities included in TeX Live rely on {{Pkg|ghostscript}}, {{Pkg|perl}}, and {{Pkg|ruby}}. <br />
<br />
* For help and information about TeX Live see: https://tug.org/texlive/doc.html and https://tug.org/texlive/doc/texlive-en/texlive-en.html<br />
<br />
* System-wide configuration files are under {{ic|/usr/share/texmf-config}}. User-specific ones should be put under {{ic|~/.texlive/texmf-config}}. {{Ic|$TEXMFHOME}} is {{ic|~/texmf}} and {{Ic|$TEXMFVAR}} is {{ic|~/.texlive/texmf-var}}.<br />
<br />
* A skeleton of a local texmf tree is at {{ic|/usr/local/share/texmf}}: this directory is writable for members of the group '''tex'''.<br />
<br />
===Paper Size===<br />
If you would like to set the default page size to something other than A4 (such as "Letter"), run the following command:<br />
$ texconfig<br />
This command is also capable of changing other useful settings.<br />
<br />
===Error with "formats not generated" upon update===<br />
See [https://bugs.archlinux.org/task/16467 this bug report]. ('''Note that if you do not use the experimental engine ''LuaTeX'', you can ignore this.''') This situation typically occurs when the configuration files {{ic|language.def}} and/or {{ic|language.dat}} for hyphenation patterns contain references to files from earlier releases of {{Ic|texlive-core}}, in particular to the latest experimental hyphenation patterns for German, whose file name changes frequently. Currently they should point to {{ic|dehyph{n,t}-x-2009-06-19.tex}}. <br />
<br />
To solve this, you need to either remove these files: {{ic|/usr/share/texmf-config/tex/generic/config/language.<nowiki>{def,dat}</nowiki>}}<br />
or update them using the newest version under: {{ic|/usr/share/texmf/tex/generic/config/language.<nowiki>{def,dat}</nowiki>}}<br />
and then run<br />
# fmtutil-sys --missing<br />
<br />
===Fonts===<br />
By default, the fonts that come with the various TeX Live packages are not automatically available to Fontconfig. If you want to use them with, say XeTeX or [[LibreOffice]], the easiest approach is to make symlinks as follows:<br />
ln -s /usr/share/texmf-dist/fonts/opentype/public/<some_fonts_you_want> ~/.fonts/OTF/ (or TTF or Type1) <br />
<br />
To make them available to fontconfig, run: <br />
fc-cache ~/.fonts<br />
mkfontscale ~/.fonts/OTF (or TTF or Type1) <br />
mkfontdir ~/.fonts/OTF (or TTF or Type1)<br />
<br />
Alternatively, {{Pkg|texlive-core}} contains the file {{ic|/etc/fonts/conf.avail/09-texlive-fonts.conf}} that contains a list of the font directories used by TeX Live. You can use this file with:<br />
<br />
{{bc|# ln -s /etc/fonts/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/09-texlive-fonts.conf}}<br />
<br />
And then update fontconfig:<br />
<br />
{{bc|# fc-cache && mkfontscale && mkfontdir}}<br />
<br />
{{Note|This may cause conflicts with XeTeX/XeLaTeX if the same fonts are (separately) available to both TeX and Fontconfig, i.e. if multiple copies of the same font are available on the search path.}}<br />
<br />
== TeXLive Local Manager ==<br />
The TeXLive Local Manager is a utility provided by Firmicus which allows to conveniently manage a TeX Live installation on Arch Linux.<br />
See {{AUR|texlive-localmanager-git}} in the [[AUR]].<br />
<br />
Usage: tllocalmgr <br />
tllocalmgr [options] [command] [args]<br />
<br />
Running tllocalmgr alone starts the TeXLive local manager shell <br />
for Arch Linux. This shell is capable of command-line completion!<br />
There you can look at the available updates with the command 'status' <br />
and you can install individual CTAN packages using 'install' or 'update'<br />
under $TEXMFLOCAL. This is done by creating a package texlive-local-<pkg><br />
and installing it with pacman. Note that this won’t interfere with your <br />
standard texlive installation, but files under $TEXMFLOCAL will take<br />
precedence. <br />
<br />
Here are the commands available in the shell:<br />
<br />
Commands: <br />
status -- Current status of TeXLive installation<br />
shortinfo * -- Print a one-liner description of CTAN packages<br />
info * -- Print info on CTAN packages<br />
update * -- Locally update CTAN packages<br />
install * -- Locally install new CTAN packages<br />
installdoc * -- Locally install documentation of CTAN packages<br />
installsrc * -- Locally install sources of CTAN packages<br />
listfiles * -- List all files in CTAN packages<br />
search * -- Search info on CTAN packages<br />
searchfiles * -- Search for files in CTAN packages<br />
texhash -- Refresh the TeX file database<br />
clean -- Clean local build tree<br />
help -- Print helpful information<br />
quit -- Quit tllocalmgr<br />
<br />
The commands followed by * take one of more package names as arguments.<br />
Note that these can be completed automatically by pressing TAB.<br />
<br />
You can also run tllocalmgr as a standard command-line program, with<br />
one of the above commands as argument, then the corresponding task will<br />
be performed and the program will exit (except when the command is 'status').<br />
<br />
tllocalmgr accepts the following options:<br />
<br />
Options: --help Shows this help<br />
--version Show the version number<br />
--forceupdate Force updating the TeXLive database<br />
--skipupdate Skip updating the TeXLive database<br />
--localsearch Search only installed packages<br />
--location #TODO?<br />
--mirror CTAN mirror to use (default is mirror.ctan.org)<br />
--nocolor #TODO<br />
<br />
=== Recent "langukenglish" errors ===<br />
For problems involving this error when trying to run {{ic|tllocalmgr}} commands,<br />
Can't get object for collection-langukenglish at /usr/bin/tllocalmgr line 103<br />
See ary0's solution at the AUR: {{AUR|texlive-localmanager}}{{Broken package link|{{aur-mirror|texlive-localmanager}}}}. In summary, edit {{ic|/usr/share/texmf-var/arch/tlpkg/TeXLive/Arch.pm}} and remove "langukenglish" from the section of the file shown here:<br />
my @core_colls =<br />
qw/ basic context genericrecommended fontsrecommended langczechslovak<br />
langdutch langfrench langgerman langitalian langpolish langportuguese<br />
langspanish **langukenglish** latex latexrecommended luatex mathextra metapost<br />
texinfo xetex /;<br />
<br />
== Install .sty files == <br />
TeX Live (and teTeX) uses its own directory indexes (files named {{ic|ls-R}}), and you need to refresh them after you copy something into one of the TeX trees. Or TeX can not see them. Magic command:<br />
{{bc|# mktexlsr}}<br />
or<br />
{{bc|# texhash}}<br />
or<br />
{{bc|# texconfig[-sys] rehash}}<br />
A command line program to search through these indexes is<br />
kpsewhich<br />
Hence you can check that TeX can find a particular file by running<br />
kpsewhich <filename.sty><br />
The output should be the full path to that file.<br />
<br />
Alternatively, sty files that are intended only for a particular user should go in the {{ic|~/texmf/}} tree. For instance, the latex package wrapfig consists of the file {{ic|wrapfig.sty}} and would go in {{ic|~/texmf/tex/latex/wrapfig/wrapfig.sty}}. There is no need to run {{ic|mktexlsr}} or equivalent because {{ic|~/texmf}} is searched every time tex is run.<br />
<br />
=== Manual Installation ===<br />
Normally, new .sty files go in {{ic|/usr/share/texmf-dist/tex/latex/<package name>/*}}. Create this directory if you do not have it. This directory will automatically be searched when *tex is executed. Further discussion can be found here: https://bbs.archlinux.org/viewtopic.php?id=85757<br />
<br />
=== Using PKGBUILDs ===<br />
To install a LaTeX package on a global level, you should use a [[PKGBUILD]] for the sake of simplifying maintenance. Examples can be found in the [[AUR]], e.g. {{AUR|texlive-gantt}}.<br />
<br />
== Updating babelbib language definitions ==<br />
If you have the very specific problem of babelbib not having the latest language definitions that you need, and you do not want to recompile everything, you can get them manually from https://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/babelbib/ and put them in {{ic|/usr/share/texmf-dist/tex/latex/babelbib/}}. For example:<br />
<br />
{{bc|<br />
# cd /usr/share/texmf-dist/tex/latex/babelbib/ <br />
# wget https://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/babelbib/romanian.bdf<br />
# wget [...all-other-language-files...]<br />
# wget https://www.tug.org/texlive/devsrc/Master/texmf-dist/tex/latex/babelbib/babelbib.sty<br />
}}<br />
<br />
Afterwards, you need to run {{ic|texhash}} to update the TeX database:<br />
# texhash</div>AraaXhttps://wiki.archlinux.org/index.php?title=Help:Template&diff=411507Help:Template2015-12-11T14:49:53Z<p>AraaX: Adding فارسی interlanguage</p>
<hr />
<div>[[Category:Help]]<br />
[[es:Help:Template]]<br />
[[fa:راهنما:الگو]]<br />
[[ja:ヘルプ:テンプレート]]<br />
[[ru:Help:Template]]<br />
[[zh-CN:Help:Template]]<br />
[[zh-TW:Help:Template]]<br />
{{Related articles start}}<br />
{{Related|Help:Editing}}<br />
{{Related|Help:Reading}}<br />
{{Related|Help:Style}}<br />
{{Related articles end}}<br />
<br />
A template is a piece of predefined [[Wikipedia:Wikitext|wikitext]] that can be inserted into an article. Templates are primarily used to aid in formatting content.<br />
<br />
== Usage ==<br />
<br />
Templates are used by adding the following markup to an article:<br />
<br />
<nowiki>{{Template name}}</nowiki><br />
<br />
Most templates take additional arguments, such as [[Template:Note]]:<br />
<br />
<nowiki>{{Note|This text should be noted.}}</nowiki><br />
<br />
which produces:<br />
<br />
{{Note|This text should be noted.}}<br />
<br />
Some templates use named parameters, such as [[Template:hc]]:<br />
<br />
<nowiki>{{hc|head=/etc/rc.local|output=exit 0}}</nowiki><br />
<br />
which produces:<br />
<br />
{{hc|head=/etc/rc.local|output=exit 0}}<br />
<br />
The general format is:<br />
<br />
<nowiki>{{Template name|param1|param2|...|paramN}}</nowiki><br />
<br />
See each template's page for specific usage instructions.<br />
<br />
=== Style ===<br />
<br />
* Templates should be used with the capitalization shown in the examples in their pages, for example {{ic|&#123;{Pkg&#124;...}} and {{ic|&#123;{ic&#124;...}} are correct, while {{ic|&#123;{pkg&#124;...}} and {{ic|&#123;{Ic&#124;...}} are not.<br />
* There should be no spaces around the template name: {{ic|&#123;{Template name&#124;...}} is correct, while for example {{ic|&#123;{ Template name &#124;...}} is not.<br />
* Templates should not be categorized.<br />
<br />
=== Escape template-breaking characters ===<br />
<br />
There are some characters that, if used inside a template, will break its output: most frequently this happens with "=" (the equal sign) and "|" (the pipe sign). Solutions to this problem are described below.<br />
<br />
==== Named parameters ====<br />
<br />
If the problem is only with "=" signs, the recommended solution is to explicitly introduce template parameters with their names or positional numbers. This is very useful for variable definitions or [[Help:Editing#External_links|external links]] with query strings in URLs, but will not work for other offending characters, like "|". For example:<br />
<br />
<nowiki>{{Tip|1=https://www.archlinux.org/?foo=bar}}</nowiki><br />
<br />
{{Tip|1=https://www.archlinux.org/?foo=bar}}<br />
<br />
Or, with multiple parameters:<br />
<br />
<nowiki>{{hc|1=$ echo "="|2==}}</nowiki><br />
<br />
<nowiki>{{hc|head=$ echo "="|output==}}</nowiki><br />
<br />
{{hc|1=$ echo "="|2==}}<br />
<br />
==== nowiki tags ====<br />
<br />
If you are having problems with characters other than "=", e.g. "|", the recommended solution is to enclose the whole parameter in {{ic|<nowiki><nowiki></nowiki>}} tags. This method displays all kinds of characters, but completely prevents the wiki engine from processing text markup, such as links and other templates. For example:<br />
<br />
<nowiki>{{Tip|&lt;nowiki>= | }} https://www.archlinux.org/ {{ic|foo}}&lt;/nowiki>}}</nowiki><br />
<br />
{{Tip|<nowiki>= | }} https://www.archlinux.org/ {{ic|foo}}</nowiki>}}<br />
<br />
Enclosing only specific parts (or even single characters) in {{ic|<nowiki><nowiki></nowiki>}} tags still works of course, but for readability it is recommended to use such method only if links or other templates have to be normally displayed. For example:<br />
<br />
<nowiki>{{Tip|&lt;nowiki>= | }}&lt;/nowiki> https://www.archlinux.org/ {{ic|foo}}}}</nowiki><br />
<br />
{{Tip|<nowiki>= | }}</nowiki> https://www.archlinux.org/ {{ic|foo}}}}<br />
<br />
==== HTML entities ====<br />
<br />
Replacing the offending characters with their respective HTML entities always works, but since it reduces the readability of the source text, it is recommended only when the solutions above are not practicable. For example:<br />
<br />
<nowiki>{{Tip|&amp;#61; &amp;#124; &amp;#125;&amp;#125;}}</nowiki><br />
<br />
{{Tip|&#61; &#124; &#125;&#125;}}<br />
<br />
== Creation ==<br />
<br />
{{Note|<br />
* Before creating a template, discuss the idea in [[Help talk:Template]].<br />
* Only create relevant templates. If you are attempting to create a very specialized template that will likely only ever be used on a few articles, please do not bother, avoid cluttering up the templates namespace.<br />
* Only create concise templates. Remember [[The Arch Way]]: Keep It Simple, Stupid!<br />
}}<br />
<br />
The following template should be used when creating new templates to facilitate usage and editing:<br />
<br />
<nowiki><noinclude><br />
{{Template}}<br />
<br />
A brief description of the template<br />
<br />
== Usage ==<br />
<br />
&lt;nowiki&gt;{{Template name|param1|param2|...|paramN}}&lt;/nowiki&gt;<br />
<br />
== Example ==<br />
<br />
{{Template name|param1|param2|...|paramN}}</noinclude><includeonly>Template code goes here...</includeonly></nowiki><br />
<br />
To begin the creation process, simply visit [[:Template:Template name]] (substituting {{ic|Template name}} with the desired name of the template), [[Help:Editing|edit, and add the relevant wikitext]].<br />
<br />
== List of templates ==<br />
<br />
The templates that users can use directly in articles on the ArchWiki are listed below. Click on the links to see their detailed usage. For a list that also includes localizations and meta templates see [[Special:AllPages/Template:]], [[Special:PrefixIndex/Template:]] or [[Special:MostLinkedTemplates]].<br />
<br />
{{Warning|Please do not experiment with existing templates. If you want to edit a non-protected template, copy the text to [[Template:Sandbox]], edit and test it there, and copy it back when it works. It is strongly recommended (and necessary for protected templates) to suggest any modifications on discussion pages first.}}<br />
<br />
=== Testing ===<br />
<br />
* [[Template:Sandbox]]<br />
* [[Template:Lorem Ipsum]]<br />
<br />
=== Article status templates ===<br />
<br />
* [[Template:Accuracy]]<br />
* [[Template:Bad translation]]<br />
* [[Template:Deletion]]<br />
* [[Template:Expansion]]<br />
* [[Template:Laptop style]]<br />
* [[Template:Merge]]<br />
* [[Template:Move]]<br />
* [[Template:Out of date]]<br />
* [[Template:Stub]]<br />
* [[Template:Style]]<br />
* [[Template:Translateme]]<br />
<br />
=== Related articles templates ===<br />
<br />
* [[Template:Related articles start]]<br />
* [[Template:Related]]<br />
* [[Template:Related articles end]]<br />
<br />
=== Code formatting templates ===<br />
<br />
* [[Template:ic]]<br />
* [[Template:bc]]<br />
* [[Template:hc]]<br />
<br />
=== Note templates ===<br />
<br />
* [[Template:Note]]<br />
* [[Template:Tip]]<br />
* [[Template:Warning]]<br />
<br />
=== Miscellaneous templates ===<br />
<br />
* [[Template:App]]<br />
* [[Template:Bug]]<br />
* [[Template:Dead link]]<br />
* [[Template:Broken package link]]<br />
* [[Template:Unsigned]]<br />
<br />
=== Package templates ===<br />
<br />
* [[Template:Pkg]]<br />
* [[Template:Grp]]<br />
* [[Template:AUR]]<br />
<br />
=== Table templates ===<br />
<br />
* [[Template:R]]<br />
* [[Template:G]]<br />
* [[Template:B]]<br />
* [[Template:C]]<br />
* [[Template:M]]<br />
* [[Template:Y]]<br />
* [[Template:Yes]]<br />
* [[Template:No]]<br />
<br />
== See also ==<br />
<br />
* [[Template:Template]]<br />
* http://meta.wikimedia.org/wiki/Help:Template</div>AraaXhttps://wiki.archlinux.org/index.php?title=Creating_packages&diff=411505Creating packages2015-12-11T14:47:48Z<p>AraaX: Adding فارسی interlanguage</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package development]]<br />
[[cs:Creating packages]]<br />
[[es:Creating packages]]<br />
[[fa:ایجاد_بستهها]]<br />
[[fr:Standard paquetage]]<br />
[[it:Creating packages]]<br />
[[ja:パッケージの作成]]<br />
[[ru:Creating packages]]<br />
[[tr:Paket oluşturma]]<br />
[[zh-cn:Creating packages]]<br />
{{Related articles start}}<br />
{{Related|Arch Build System}}<br />
{{Related|Arch packaging standards}}<br />
{{Related|Arch User Repository}}<br />
{{Related|Creating packages for other distributions}}<br />
{{Related|makepkg}}<br />
{{Related|pacman}}<br />
{{Related|Patching in ABS}}<br />
{{Related|PKGBUILD}}<br />
{{Related|DeveloperWiki:Building in a Clean Chroot}}<br />
{{Related articles end}}<br />
<br />
This article aims to assist users creating their own packages using the Arch Linux "ports-like" [[Arch Build System|build system]], also for submission in [[AUR]]. It covers creation of a [[PKGBUILD]] &ndash; a package build description file sourced by {{ic|makepkg}} to create a binary package from source. If already in possession of a {{ic|PKGBUILD}}, see [[makepkg]]. For instructions regarding existing rules and ways to improve package quality see [[Arch packaging standards]].<br />
<br />
== Overview == <br />
<br />
Packages in Arch Linux are built using the [[makepkg]] utility and the information stored in a [[PKGBUILD]] file. When {{ic|makepkg}} is run, it searches for a {{ic|PKGBUILD}} in the current directory and follows the instructions therein to either compile or otherwise acquire the required files to be packaged within a package file ({{ic|pkgname.pkg.tar.xz}}). The resulting package contains binary files and installation instructions; readily installed with [[pacman]].<br />
<br />
An Arch package is no more than a tar archive, or 'tarball', compressed using xz, which contains the following files generated by makepkg:<br />
<br />
* The binary files to install.<br />
* {{ic|.PKGINFO}}: contains all the metadata needed by pacman to deal with packages, dependencies, etc.<br />
* {{ic|.MTREE}}: contains hashes and timestamps of the files, which are included in the local database so that pacman can verify the integrity of the package.<br />
* {{ic|.INSTALL}}: an optional file used to execute commands after the install/upgrade/remove stage. (This file is present only if specified in the {{ic|PKGBUILD}}.)<br />
* {{ic|.Changelog}}: an optional file kept by the package maintainer documenting the changes of the package. (It is not present in all packages.)<br />
<br />
== Preparation ==<br />
<br />
===Prerequisite software===<br />
<br />
First ensure that the necessary tools are installed. [[Install]]ing the package group {{Grp|base-devel}} should be sufficient; it includes '''make''' and additional tools needed for compiling from source.<br />
<br />
One of the key tools for building packages is [[makepkg]] (provided by {{Pkg|pacman}}) which does the following:<br />
<br />
#Checks if package dependencies are installed.<br />
#Downloads the source file(s) from the specified server(s).<br />
#Unpacks the source file(s).<br />
#Compiles the software and installs it under a fakeroot environment.<br />
#Strips symbols from binaries and libraries.<br />
#Generates the package meta file which is included with each package.<br />
#Compresses the fakeroot environment into a package file.<br />
#Stores the package file in the configured destination directory, which is the present working directory by default.<br />
<br />
=== Download and test the installation ===<br />
<br />
Download the source tarball of the software you want to package, extract it, and follow the author's steps to install the program. Make a note of all commands and/or steps needed to compile and install it. You will be repeating those same commands in the ''PKGBUILD'' file.<br />
<br />
Most software authors stick to the 3-step build cycle:<br />
<br />
./configure<br />
make<br />
make install<br />
<br />
This is a good time to make sure the program is working correctly.<br />
<br />
== Creating a PKGBUILD ==<br />
When you run {{ic|makepkg}}, it will look for a {{ic|PKGBUILD}} file in the present working directory. If a {{ic|PKGBUILD}} file is found it will download the software's source code and compile it according to the instructions specified in the {{ic|PKGBUILD}} file. The instructions must be fully interpretable by the [[Wikipedia:Bash_(Unix_shell)|Bash]] shell. After successful completion, the resulting binaries and metadata of the package, i.e. package version and dependencies, are packed in a {{ic|pkgname.pkg.tar.xz}} package file that can be installed with {{ic|pacman -U ''<package file>''}}.<br />
<br />
To begin with a new package, you should first create an empty working directory, (preferably {{ic|~/abs/'''pkgname'''}}), change into that directory, and create a {{ic|PKGBUILD}} file. You can either copy the prototype PKGBUILD {{ic|/usr/share/pacman/PKGBUILD.proto}} to your working directory or copy a {{ic|PKGBUILD}} from a similar package. The latter may be useful if you only need to change a few options.<br />
<br />
{{Warning|Use only the PKGBUILD prototypes provided in the {{Pkg|pacman}} package (PKGBUILD-split.proto, PKGBUILD-vcs.proto and PKGBUILD.proto). The prototypes files in the {{Pkg|abs}} package and in [https://projects.archlinux.org/abs.git/tree/prototypes the ABS git repository] are significantly out of date and should not be used. See {{Bug|34485}}.}}<br />
<br />
=== Defining PKGBUILD variables ===<br />
<br />
Example PKGBUILDs are located in {{Ic|/usr/share/pacman/}}. An explanation of possible {{ic|PKGBUILD}} variables can be found in the [[PKGBUILD]] article.<br />
<br />
''makepkg'' defines two variables that you should use as part of the build and install process:<br />
; {{ic|srcdir}}: This points to the directory where ''makepkg'' extracts or symlinks all files in the source array.<br />
; {{ic|pkgdir}}: This points to the directory where ''makepkg'' bundles the installed package, which becomes the root directory of your built package.<br />
All of them contain ''absolute'' paths, which means, you do not have to worry about your working directory if you use these variables properly.<br />
<br />
{{Note|''makepkg'', and thus the {{ic|build()}} and {{ic|package()}} functions, are intended to be non-interactive. Interactive utilities or scripts called in those functions may break ''makepkg'', particularly if it is invoked with build-logging enabled ({{ic|-L}}). (See {{Bug|13214}}.)}}<br />
<br />
{{Note|Apart from the current package Maintainer, there may be previous maintainers listed above as Contributors.}}<br />
<br />
=== PKGBUILD functions ===<br />
<br />
There are five functions, listed here in the order they are executed if all of them exist. If one does not exist, it is simply skipped.<br />
<br />
{{Note|This does not apply to the {{ic|package()}} function, as it is required in every PKGBUILD}}<br />
<br />
==== pkgver() ====<br />
<br />
Beginning with pacman 4.1, you can update the pkgver variable during a makepkg. {{ic|pkgver()}} is run right after the sources are fetched and extracted.<br />
<br />
This is particularly useful if you are [[VCS PKGBUILD Guidelines|making git/svn/hg/etc. packages]], where the build process may remain the same, but the source could be updated every day, even every hour. The old way of doing this was to put the date into the pkgver field which, if the software was not updated, makepkg would still rebuild it thinking the version had changed. Some useful commands for this are {{ic|git describe}}, {{ic|hg identify -ni}}, etc. Please test these before submitting a PKGBUILD, as a failure in the {{ic|pkgver()}} function can stop a build in its tracks. <br />
{{Note|pkgver cannot contain spaces or hyphens ({{ic|-}}). Using sed to correct this is common.}}<br />
<br />
==== prepare() ====<br />
<br />
Pacman 4.1 introduces the {{ic|prepare()}} function. In this function, commands that are used to prepare sources for building are run, such as [[Patching in ABS|patching]]. This function is run before the build function and after package extraction. If extraction is skipped ({{ic|makepkg -e}}), then {{ic|prepare()}} is not run. <br />
<br />
{{Note| (From {{ic|man PKGBUILD}}) The function is run in {{ic|bash -e}} mode, meaning any command that exits with a non-zero status will cause the function to exit.}}<br />
<br />
==== build() ====<br />
<br />
Now you need to implement the {{ic|build()}} function in the {{ic|PKGBUILD}} file. This function uses common shell commands in [[Wikipedia:Bash_(Unix_shell)|Bash]] syntax to automatically compile software and create a {{ic|pkg}} directory to install the software to. This allows ''makepkg'' to package files without having to sift through your file system.<br />
<br />
The first step in the {{ic|build()}} function is to change into the directory created by uncompressing the source tarball. ''makepkg'' will change the current directory to {{ic|$srcdir}} before executing the {{ic|build()}} function. Therefore, in most cases, like suggested in {{ic|/usr/share/pacman/PKGBUILD.proto}}, the first command will look like this:<br />
<br />
cd "$pkgname-$pkgver"<br />
<br />
Now, you need to list the same commands you used when you manually compiled the software. The {{ic|build()}} function in essence automates everything you did by hand and compiles the software in the fakeroot build environment. If the software you are packaging uses a configure script, it is good practice to use {{ic|1=--prefix=/usr}} when building packages for pacman. A lot of software installs files relative to the {{ic|/usr/local}} directory, which should only be done if you are manually building from source. All Arch Linux packages should use the {{ic|/usr}} directory. As seen in the {{ic|/usr/share/pacman/PKGBUILD.proto}} file, the next two lines often look like this:<br />
<br />
./configure --prefix=/usr<br />
make<br />
<br />
{{Note|If your software does not need to build anything, DO NOT use the {{ic|build()}} function. The {{ic|build()}} function is not required, but the {{ic|package()}} function is.}}<br />
<br />
==== check() ====<br />
<br />
Place for calls to {{Ic|make check}} and similar testing routines. It is highly recommended to have {{Ic|check()}} as it helps to make sure software has been built correctly and works fine with its dependencies.<br />
<br />
Users who do not need it (and occasionally maintainers who can not fix a package for this to pass) can disable it using {{ic|1=BUILDENV+=('!check')}} in PKGBUILD/makepkg.conf or call {{ic|makepkg}} with {{ic|--nocheck}} flag.<br />
<br />
==== package() ====<br />
<br />
The final step is to put the compiled files in a directory where ''makepkg'' can retrieve them to create a package. This by default is the {{ic|pkg}} directory—a simple fakeroot environment. The {{ic|pkg}} directory replicates the hierarchy of the root file system of the software's installation paths. If you have to manually place files under the root of your filesystem, you should install them in the {{ic|pkg}} directory under the same directory structure. For example, if you want to install a file to {{ic|/usr/bin}}, it should instead be placed under {{ic|$pkgdir/usr/bin}}. Very few install procedures require the user to copy dozens of files manually. Instead, for most software, calling {{ic|make install}} will do so. The final line should look like the following in order to correctly install the software in the {{ic|pkg}} directory:<br />
<br />
make DESTDIR="$pkgdir/" install<br />
<br />
{{Note|It is sometimes the case where {{ic|DESTDIR}} is not used in the {{ic|Makefile}}; you may need to use {{ic|prefix}} instead. If the package is built with ''autoconf'' / ''automake'', use {{ic|DESTDIR}}; this is what is [https://www.gnu.org/software/automake/manual/automake.html#Install documented] in the manuals. If {{ic|DESTDIR}} does not work, try building with {{ic|1=make prefix="$pkgdir/usr/" install}}. If that does not work, you will have to look further into the install commands that are executed by "{{ic|make <...> install}}".}}<br />
<br />
In some odd cases, the software expects to be run from a single directory. In such cases, it is wise to simply copy these to {{ic|$pkgdir/opt}}.<br />
<br />
More often than not, the installation process of the software will create sub-directories below the {{ic|pkg}} directory. If it does not, however, ''makepkg'' will generate a lot of errors and you will need to manually create sub-directories by adding the appropriate {{ic|mkdir -p}} commands in the {{ic|build()}} function before the installation procedure is run.<br />
<br />
In old packages, there was no {{ic|package()}} function. So, files were put into the ''pkg'' directory at the end of the {{ic|build()}} function. If {{ic|package()}} is not present, {{ic|build()}} runs via ''fakeroot''. In new packages, {{ic|package()}} is required and runs via ''fakeroot'' instead, and {{ic|build()}} runs without any special privileges. <br />
<br />
{{ic|makepkg --repackage}} runs only the {{ic|package()}} function, so it creates a {{ic|*.pkg.*}} file without compiling the package. This may save time e.g. if you just have changed the {{ic|depends}} variable of the package.<br />
<br />
{{Note|The {{ic|package()}} function is the only required function in a PKGBUILD. If you must only copy files into their respective directories to install a program, do not put it in the {{ic|build()}} function, put that in the {{ic|package()}} function.}}<br />
<br />
{{Note|Creating symlinks is a slightly awkward process in the {{ic|package()}} function. Using the naive approach {{ic|ln -s "${pkgdir}/from/foo" "${pkgdir}/to/goo"}} will result in a broken symlink to the build directory. The way to create a proper link is to create it pointing to an initially-broken source, {{ic|ln -s "/from/foo" "${pkgdir}/to/goo"}}. Once the package is installed, the link will point to the right place.}}<br />
<br />
== Testing the PKGBUILD and package ==<br />
<br />
As you are writing the {{ic|build()}} function, you will want to test your changes frequently to ensure there are no bugs. You can do this using the {{ic|makepkg}} command in the directory containing the {{ic|PKGBUILD}} file. With a properly formatted {{ic|PKGBUILD}}, makepkg will create a package; with a broken or unfinished {{ic|PKGBUILD}}, it will raise an error.<br />
<br />
If makepkg finishes successfully, it will place a file named {{ic|pkgname-pkgver.pkg.tar.xz}} in your working directory. This package can be installed with the {{ic|pacman -U}} command. However, just because a package file was built does not imply that it is fully functional. It might conceivably contain only the directory and no files whatsoever if, for example, a prefix was specified improperly. You can use pacman's query functions to display a list of files contained in the package and the dependencies it requires with {{ic|pacman -Qlp [package file]}} and {{ic|pacman -Qip [package file]}} respectively.<br />
<br />
If the package looks sane, then you are done! However, if you plan on releasing the {{ic|PKGBUILD}} file, it is imperative that you check and double-check the contents of the {{ic|depends}} array. <br />
<br />
Also ensure that the package binaries actually ''run'' flawlessly! It is annoying to release a package that contains all necessary files, but crashes because of some obscure configuration option that does not quite work well with the rest of the system. If you are only going to compile packages for your own system, though, you do not need to worry too much about this quality assurance step, as you are the only person suffering from mistakes, after all.<br />
<br />
=== Checking package sanity ===<br />
<br />
After testing package functionality check it for errors using [[namcap]]:<br />
$ namcap PKGBUILD<br />
$ namcap ''<package file name>''.pkg.tar.xz<br />
<br />
Namcap will:<br />
# Check PKGBUILD contents for common errors and package file hierarchy for unnecessary/misplaced files<br />
# Scan all ELF files in package using {{ic|ldd}}, automatically reporting which packages with required shared libraries are missing from {{Ic|depends}} and which can be omitted as transitive dependencies<br />
# Heuristically search for missing and redundant dependencies<br />
and much more.<br />
Get into the habit of checking your packages with namcap to avoid having to fix the simplest mistakes after package submission.<br />
<br />
== Submitting packages to the AUR ==<br />
<br />
Please read [[AUR User Guidelines#Submitting packages]] for a detailed description of the submission process.<br />
<br />
== Summary ==<br />
<br />
#Download the source tarball of the software you want to package.<br />
#Try compiling the package and installing it into an arbitrary directory.<br />
#Copy over the prototype {{ic|/usr/share/pacman/PKGBUILD.proto}} and rename it to {{ic|PKGBUILD}} in a temporary working directory -- preferably {{ic|~/abs/}}.<br />
#Edit the {{ic|PKGBUILD}} according to the needs of your package.<br />
#Run {{ic|makepkg}} and see whether the resulting package is built correctly.<br />
#If not, repeat the last two steps.<br />
<br />
=== Warnings ===<br />
<br />
* Before you can automate the package building process, you should have done it manually at least once unless you know ''exactly'' what you are doing ''in advance'', in which case you would not be reading this in the first place. Unfortunately, although a good bunch of program authors stick to the 3-step build cycle of "{{ic|./configure}}; {{ic|make}}; {{ic|make install}}", this is not always the case, and things can get real ugly if you have to apply patches to make everything work at all. Rule of thumb: If you cannot get the program to compile from the source tarball, and make it install itself to a defined, temporary subdirectory, you do not even need to try packaging it. There is not any magic pixie dust in {{ic|makepkg}} that makes source problems go away.<br />
* In a few cases, the packages are not even available as source and you have to use something like {{ic|sh installer.run}} to get it to work. You will have to do quite a bit of research (read READMEs, INSTALL instructions, man pages, perhaps ebuilds from Gentoo or other package installers, possibly even the MAKEFILEs or source code) to get it working. In some really bad cases, you have to edit the source files to get it to work at all. However, {{ic|makepkg}} needs to be completely autonomous, with no user input. Therefore if you need to edit the makefiles, you may have to bundle a custom patch with the {{ic|PKGBUILD}} and install it from inside the {{ic|prepare()}} function, or you might have to issue some {{ic|sed}} commands from inside the {{ic|prepare()}} function.<br />
<br />
== More detailed guidelines ==<br />
{{Package guidelines}}<br />
<br />
==See Also==<br />
* [https://bbs.archlinux.org/viewtopic.php?id=91408 How to correctly create a patch file].<br />
* [https://archwomen.org/media/project_classroom/classlogs/ Arch Linux Classroom IRC Logs of classes about creating PKGBUILDs].<br />
* [http://www.linuxfromscratch.org/hints/downloads/files/fakeroot.txt Fakeroot approach for package installation]</div>AraaXhttps://wiki.archlinux.org/index.php?title=Pkgfile&diff=411504Pkgfile2015-12-11T14:46:01Z<p>AraaX: Adding فارسی interlanguage</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Package development]]<br />
[[Category:Package management]]<br />
[[es:Pkgfile]]<br />
[[fa:Pkgfile]]<br />
[[ja:Pkgfile]]<br />
[[ko:Pkgfile]]<br />
[[ru:Pkgfile]]<br />
[[zh-CN:Pkgfile]]<br />
{{Related articles start}}<br />
{{Related|pacman}}<br />
{{Related articles end}}<br />
'''pkgfile''' is a tool for searching files from packages in the [[official repositories]].<br />
<br />
== Installation ==<br />
<br />
[[Install]] {{Pkg|pkgfile}} from the official repositories, or {{AUR|pkgfile-git}} from the [[AUR]].<br />
<br />
The ''pkgfile'' database can then be synced with:<br />
<br />
# pkgfile -u<br />
<br />
== Usage ==<br />
<br />
To search for a package that owns the file {{ic|makepkg}}:<br />
<br />
{{hc|$ pkgfile makepkg|<br />
core/pacman}}<br />
<br />
To list all files provided by {{Pkg|archlinux-keyring}}:<br />
<br />
{{hc|$ pkgfile -l archlinux-keyring|<br />
core/archlinux-keyring usr/<br />
core/archlinux-keyring usr/share/<br />
core/archlinux-keyring usr/share/pacman/<br />
core/archlinux-keyring usr/share/pacman/keyrings/<br />
core/archlinux-keyring usr/share/pacman/keyrings/archlinux-revoked<br />
core/archlinux-keyring usr/share/pacman/keyrings/archlinux-trusted<br />
core/archlinux-keyring usr/share/pacman/keyrings/archlinux.gpg}}<br />
<br />
Latter is comparable to {{ic|pacman -Ql}} (see [[pacman#Querying package databases]]), except it applies to remote packages.<br />
<br />
== Command not found ==<br />
<br />
{{Pkg|pkgfile}} includes a "command not found" hook for [[Bash]] and [[Zsh]] that will automatically search the official repositories, when entering an unrecognized command:<br />
<br />
{{hc|$ abiword|<br />
abiword may be found in the following packages:<br />
extra/abiword 2.8.6-7 usr/bin/abiword<br />
}}<br />
<br />
To enable it in all children shells, you need to source the hook from one of your shell initialization files.<br />
<br />
=== Bash ===<br />
<br />
{{hc|~/.bashrc|<br />
source /usr/share/doc/pkgfile/command-not-found.bash}}<br />
<br />
=== Zsh ===<br />
<br />
{{hc|~/.zshrc|<br />
source /usr/share/doc/pkgfile/command-not-found.zsh}}<br />
<br />
=== Fish ===<br />
<br />
Since [https://github.com/fish-shell/fish-shell/releases/tag/2.2.0 version 2.2] [[Fish]] has provided its own "command not found" hook for {{Pkg|pkgfile}}: [https://github.com/fish-shell/fish-shell/pull/1925 Add command-not-found handler for Arch Linux #1925]<br />
<br />
== Automatic updates ==<br />
<br />
'''pkgfile''' ships with a [[systemd]] service and [[systemd/Timers|timer]] for automatically synchronizing the pkgfile database. To activate automatic updates [[enable]] {{ic|pkgfile-update.timer}}.<br />
<br />
By default, pkgfile will be updated daily. To change this schedule, [[systemd#Editing_provided_unit_files|edit the unit file]].</div>AraaXhttps://wiki.archlinux.org/index.php?title=Makepkg&diff=411503Makepkg2015-12-11T14:44:21Z<p>AraaX: Adding فارسی interlanguage</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Package development]]<br />
[[Category:About Arch]]<br />
[[ar:Makepkg]]<br />
[[el:Makepkg]]<br />
[[es:Makepkg]]<br />
[[fa:Makepkg]]<br />
[[fr:makepkg]]<br />
[[it:Makepkg]]<br />
[[ja:Makepkg]]<br />
[[nl:Makepkg]]<br />
[[pt:Makepkg]]<br />
[[ru:Makepkg]]<br />
[[sr:Makepkg]]<br />
[[tr:Makepkg]]<br />
[[zh-CN:Makepkg]]<br />
{{Related articles start}}<br />
{{Related|Creating packages}}<br />
{{Related|PKGBUILD}}<br />
{{Related|Arch User Repository}}<br />
{{Related|pacman}}<br />
{{Related|Official repositories}}<br />
{{Related|Arch Build System}}<br />
{{Related articles end}}<br />
<br />
[https://projects.archlinux.org/pacman.git/tree/scripts/makepkg.sh.in makepkg] is a script to automate the building of packages. The requirements for using the script are a build-capable Unix platform and a [[PKGBUILD]].<br />
<br />
''makepkg'' is provided by the {{Pkg|pacman}} package.<br />
<br />
== Configuration ==<br />
<br />
See {{ic|man makepkg.conf}} for details on configuration options for makepkg.<br />
<br />
The system configuration is available in {{ic|/etc/makepkg.conf}}, but user-specific changes can be made in {{ic|$XDG_CONFIG_HOME/pacman/makepkg.conf}} or {{ic|~/.makepkg.conf}}. It is recommended to review the configuration prior to building packages.<br />
<br />
=== Packager information ===<br />
<br />
Each package is tagged with metadata identifying amongst others also the ''packager''. By default, user-compiled packages are marked with {{ic|Unknown Packager}}. If multiple users will be compiling packages on a system, or you are otherwise distributing your packages to other users, it is convenient to provide real contact. This can be done by setting the {{ic|PACKAGER}} variable in {{ic|makepkg.conf}}.<br />
<br />
To check this on an installed package:<br />
<br />
{{hc|$ pacman -Qi ''package''|<nowiki><br />
[...]<br />
Packager : John Doe <john@doe.com><br />
[...]<br />
</nowiki>}}<br />
<br />
To automatically produce signed packages, also set the {{ic|GPGKEY}} variable in {{ic|makepkg.conf}}.<br />
<br />
=== Package output ===<br />
<br />
By default, ''makepkg'' creates the package tarballs in the working directory and downloads source data directly to the {{ic|src/}} directory. Custom paths can be configured, for example to keep all built packages in {{ic|~/build/packages/}} and all sources in {{ic|~/build/sources/}}.<br />
<br />
Configure the following {{ic|makepkg.conf}} variables if needed:<br />
<br />
* {{ic|PKGDEST}} &mdash; directory for storing resulting packages<br />
* {{ic|SRCDEST}} &mdash; directory for storing [[PKGBUILD#source|source]] data (symbolic links will be placed to {{ic|src/}} if it points elsewhere)<br />
* {{ic|SRCPKGDEST}} &mdash; directory for storing resulting source packages (built with {{ic|makepkg -S}})<br />
<br />
=== Signature checking ===<br />
<br />
{{Expansion|Expand a bit on {{ic|validpgpkeys()}}, e.g: "''I then check the person who signed is expected from the software mailing list, check if they sign emails, look if the PGP fingerprint is published on their homepage, … That verifies the signature enough to add the validpgpkeys array for me.''"}}<br />
<br />
If a signature file in the form of {{ic|.sig}} is part of the [[PKGBUILD]] source array, ''makepkg'' validates the authenticity of source files. For example, the signature {{ic|''pkgname''-''pkgver''.tar.gz.sig}} is used to check the integrity of the file {{ic|''pkgname''-''pkgver''.tar.gz}} with the ''gpg'' program.<br />
<br />
If desired, signatures by other developers can be manually added to the GPG keyring. See [[GnuPG]] article for details. To temporarily disable signature checking, call the ''makepkg'' command with the {{ic|--skippgpcheck}} option.<br />
<br />
{{Note|The signature checking implemented in ''makepkg'' does not use pacman's keyring, relying on the user's keyring and the {{ic|validpgpkeys()}} array instead. [http://allanmcrae.com/2015/01/two-pgp-keyrings-for-package-management-in-arch-linux/]}}<br />
<br />
To show the current list of GPG keys, use the ''gpg'' command:<br />
<br />
$ gpg --list-keys<br />
<br />
If the {{ic|pubring.gpg}} file does not exist, it will be created for you immediately.<br />
<br />
The GPG keys are expected to be stored in the user's {{ic|~/.gnupg/pubring.gpg}} file. In case it does not contain the given signature, ''makepkg'' will abort the installation:<br />
<br />
{{hc|$ makepkg|2=<br />
[...]<br />
==> Verifying source file signatures with gpg...<br />
pkgname-pkgver.tar.gz ... FAILED (unknown public key ''1234567890'')<br />
==> ERROR: One or more PGP signatures could not be verified!<br />
}}<br />
<br />
Make sure that a keyserver is configured in {{ic|dirmngr.conf}}, for example:<br />
<br />
{{hc|~/.gnupg/dirmngr.conf|<br />
keyserver hkp://keys.gnupg.net<br />
}}<br />
<br />
If {{ic|hkp://keys.gnupg.net}} does not work, try {{ic|hkp://pool.sks-keyservers.net}}.<br />
<br />
Now you can inspect the missing key using:<br />
<br />
$ gpg --search-keys ''1234567890''<br />
<br />
If the key seems to be trustworthy, you can import it from the server using:<br />
<br />
$ gpg --recv-keys ''1234567890''<br />
<br />
To automate the process, duplicate the keyserver line from {{ic|dirmngr.conf}}, and add the following option.<br />
Once this [https://bugs.gnupg.org/gnupg/issue2147 gpg bug] is fixed, you should move the <br />
keyserver-options line to {{ic|dirmngr.conf}}, and remove the keyserver line.<br />
<br />
{{hc|~/.gnupg/gpg.conf|<br />
keyserver hkp://keys.gnupg.net<br />
keyserver-options auto-key-retrieve<br />
}}<br />
<br />
== Usage ==<br />
<br />
{{Warning|Only build or install packages from trusted sources.}}<br />
<br />
Before continuing, [[install]] the {{Grp|base-devel}} group. Packages belonging to this group are '''not''' required to be listed as build-time dependencies (''makedepends'') in [[PKGBUILD]] files. In addition, the {{Grp|base}} group is assumed to be installed on '''all''' Arch systems.<br />
<br />
{{Note|<br />
* Make sure [[sudo]] is configured properly for commands passed to [[pacman]].<br />
* Running ''makepkg'' itself as root is [https://lists.archlinux.org/pipermail/pacman-dev/2014-March/018911.html disallowed] as of v4.2.[https://projects.archlinux.org/pacman.git/tree/NEWS] Besides how a {{ic|PKGBUILD}} may contain arbitrary commands, building as root is generally considered unsafe.[https://bbs.archlinux.org/viewtopic.php?id&#61;67561] Users who have no access to a regular user account should run makepkg as the [http://allanmcrae.com/2015/01/replacing-makepkg-asroot/ nobody user].<br />
}}<br />
<br />
To build a package, one must first create a [[PKGBUILD]], or build script, as described in [[Creating packages]]. Existing scripts are available from the [[Arch Build System|ABS tree]] or the [[AUR]]. Once in possession of a {{ic|PKGBUILD}}, change to the directory where it is saved and issue the following command to build the package described by said {{ic|PKGBUILD}}:<br />
<br />
$ makepkg<br />
<br />
If required dependencies are missing, ''makepkg'' will issue a warning before failing. To build the package and install needed dependencies, add the flag {{ic|-s}}/{{ic|--syncdeps}}:<br />
<br />
$ makepkg -s<br />
<br />
Adding the {{ic|-r}}/{{ic|--rmdeps}} flag causes ''makepkg'' to remove the make dependencies later, which are no longer needed. If constantly building packages, consider using [[Pacman tips#Removing orphaned packages]] once in a while instead.<br />
<br />
{{Note|<br />
* These dependencies must be available in the configured repositories; see [[pacman#Repositories]] for details. Alternatively, one can manually install dependencies prior to building ({{ic|pacman -S --asdeps ''dep1'' ''dep2''}}).<br />
* Only global values are used when installing dependencies, i.e any override done in a split package's packaging function will not be used. [https://patchwork.archlinux.org/patch/2271/]}}<br />
<br />
Once all dependencies are satisfied and the package builds successfully, a package file ({{ic|''pkgname''-''pkgver''.pkg.tar.xz}}) will be created in the working directory. To install, use {{ic|-i}}/{{ic|--install}} (same as {{ic|pacman -U ''pkgname''-''pkgver''.pkg.tar.xz}}):<br />
<br />
$ makepkg -i<br />
<br />
To clean up leftover files and folders, such as files extracted to the {{ic|$srcdir}}, add the option {{ic|-c}}/{{ic|--clean}}. This is useful for multiple builds of the same package or updating the package version, while using the same build folder. It prevents obsolete and remnant files from carrying over to the new builds:<br />
<br />
$ makepkg -c<br />
<br />
For more, see [https://www.archlinux.org/pacman/makepkg.8.html makepkg(8)].<br />
<br />
== Tips and Tricks ==<br />
<br />
=== Creating optimized packages ===<br />
<br />
A performance improvement of the packaged software can be achieved by enabling compiler optimizations for the host machine. The downside is that packages compiled for a specific processor architecture will not run correctly on other machines. On x86_64 machines, there are rarely significant enough real world performance gains that would warrant investing the time to rebuild official packages.<br />
<br />
The options passed to a C/C++ compiler (e.g. {{Pkg|gcc}} or {{Pkg|clang}}) are controlled by the {{ic|CFLAGS}}, {{ic|CXXFLAGS}}, and {{ic|CPPFLAGS}} environment variables. Similarly, the {{Pkg|make}} build system uses {{ic|MAKEFLAGS}}. For use in the Arch build system, ''makepkg'' exposes these environment variables as configuration options in {{ic|makepkg.conf}}. The default values are configured to produce generic packages that can be installed on a wide range of machines.<br />
<br />
{{Note|Keep in mind that not all build systems use the variables configured in {{ic|makepkg.conf}}. For example, ''cmake'' disregards the preprocessor options environment variable, {{ic|CPPFLAGS}}. Consequently, many [[PKGBUILD]]s contain workarounds with options specific to the build system used by the packaged software.}}<br />
<br />
However, it is very easy to reduce performance by using "nonstandard" compiler flags. Many compiler optimizations are only useful in certain situations and should not be indiscriminately applied to every package. Unless you can verify/benchmark that something is faster, there is a very good chance it is not! The Gentoo [http://www.gentoo.org/doc/en/gcc-optimization.xml Compilation Optimization Guide] and [http://wiki.gentoo.org/wiki/Safe_CFLAGS Safe CFLAGS] wiki article provide more in-depth information about compiler optimization.<br />
<br />
As of version 4.3.0, GCC can automatically detect and enable safe architecture-specific optimizations. To use this feature, first remove any {{ic|-march}} and {{ic|-mtune}} flags, then add {{ic|1=-march=native}}. For example,<br />
<br />
CFLAGS="-march=native -O2 -pipe -fstack-protector-strong"<br />
CXXFLAGS="${CFLAGS}"<br />
<br />
To see what flags this enables on your machine, run:<br />
<br />
$ gcc -march=native -v -Q --help=target<br />
<br />
{{Note|To see what architecture GCC detects on your system (rather than which specific flags {{ic|1=-march=native}} sets) you can use the script [https://github.com/pixelb/scripts/blob/master/scripts/gcccpuopt gcccpuopt].}}<br />
<br />
Optimizing for CPU type may enhance performance because {{ic|1=-march=native}} enables all available instruction sets and improves scheduling for a particular CPU. This could be noticeable with applications that take advantage of newer instructions sets not enabled with the default options provided by Arch Linux (e.g. audio/video encoding tools, scientific applications, math-heavy programs, etc.).<br />
<br />
==== MAKEFLAGS ====<br />
<br />
The {{ic|MAKEFLAGS}} option can be used to specify additional options for make. Users with multi-core/multi-processor systems can specify the number of jobs to run simultaneously. This can be accomplished with the use of ''nproc'' to determine the number of available processors, e.g. {{ic|1=MAKEFLAGS="-j$(nproc)"}}. Some [[PKGBUILD]]s specifically override this with {{ic|-j1}}, because of race conditions in certain versions or simply because it is not supported in the first place. Packages that fail to build because of this should be [[Reporting bug guidelines|reported]] on the bug tracker (or in the case of [[AUR]] packages, to the package maintainer) after making sure that the error is indeed being caused by your {{ic|MAKEFLAGS}}.<br />
<br />
See {{ic|man make}} for a complete list of available options.<br />
<br />
=== Improving compile times ===<br />
<br />
==== tmpfs ====<br />
<br />
As compiling requires many I/O operations and handling of small files, moving the working directory to a [[tmpfs]] may bring improvements in build times. <br />
<br />
The {{ic|BUILDDIR}} variable can be temporarily exported to ''makepkg'' to set the build directory to an existing tmpfs. For example:<br />
<br />
$ BUILDDIR=/tmp/makepkg makepkg<br />
<br />
{{Warning|Avoid compiling larger packages in tmpfs to prevent running out of memory.}}<br />
<br />
Persistent configuration can be done in {{ic|makepkg.conf}} by uncommenting the {{ic|BUILDDIR}} option, which is found at the end of the {{ic|BUILD ENVIRONMENT}} section in the default {{ic|/etc/makepkg.conf}} file. Setting its value to e.g. {{ic|1=BUILDDIR=/tmp/makepkg}} will make use of the Arch's default {{ic|/tmp}} [[tmpfs]].<br />
<br />
{{Note|<br />
* The [[tmpfs]] folder must be mounted without the {{ic|noexec}} option, else it will prevent build scripts or utilities from being executed.<br />
* Keep in mind that any package compiled in [[tmpfs]] will not persist across reboot. Consider setting the [[#Package output|PKGDEST]] option appropriately to move the built package automatically to another (persistent) directory.<br />
}}<br />
<br />
==== ccache ====<br />
<br />
The use of [[ccache]] can improve build times by caching the results of compilations.<br />
<br />
=== Generate new checksums ===<br />
Since [http://allanmcrae.com/2013/04/pacman-4-1-released/ pacman 4.1], {{ic|makepkg -g >> PKGBUILD}} is no longer required because pacman-contrib was [https://projects.archlinux.org/pacman.git/tree/NEWS merged into upstream pacman], including the {{ic|updpkgsums}} script that will generate new checksums and/or replace them in the PKGBUILD. In the same directory as the PKGBUILD file, run the following command:<br />
$ updpkgsums<br />
<br />
=== Create uncompressed packages ===<br />
If you do not mind having larger package files, you can speed up both packaging and installation by having makepkg produce uncompressed packages. Set {{ic|1=PKGEXT='.pkg.tar'}} in {{ic|/etc/makepkg.conf}}.<br />
<br />
=== Utilizing multiple cores on compression ===<br />
{{pkg|xz}} supports [[Wikipedia:Symmetric multiprocessing|symmetric multiprocessing (SMP)]] via the {{ic|--threads}} flag to speed up compression. For example, to let makepkg use as many CPU cores as possible to compress packages, edit {{ic|COMPRESSXZ}} array in {{ic|/etc/makepkg.conf}}:<br />
<br />
COMPRESSXZ=(xz -c -z - '''--threads=0''')<br />
<br />
== Troubleshooting ==<br />
<br />
=== Makepkg sometimes fails to sign a package without asking for signature passphrase ===<br />
<br />
{{Style|Vague instructions}}<br />
<br />
With [https://www.gnupg.org/faq/whats-new-in-2.1.html gnupg 2.1], gpg-agent no longer has to be started manually and will be started automatically on the first invokation of gpg. Thus if you do not manually start gpg-agent, makepkg will start it. <br />
<br />
The problem is that makepkg runs gpg inside a fakeroot, so gpg-agent is also started in that same environment. This leads<br />
to bad behavior. The obvious remedy is to manually start the gpg-agent, either on boot or by command, before you run makepkg.<br />
<br />
See [[GnuPG#gpg-agent]] for ways to do this.<br />
<br />
=== CFLAGS/CXXFLAGS/CPPFLAGS in makepkg.conf do not work for QMAKE based packages ===<br />
Qmake automatically sets the variable {{ic|CFLAGS}} and {{ic|CXXFLAGS}} according to what it thinks should be the right configuration. In order to let qmake use the variables defined in the makepkg configuration file, you must edit the PKGBUILD and pass the variables [http://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-cflags-release QMAKE_CFLAGS_RELEASE] and [http://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-cxxflags-release QMAKE_CXXFLAGS_RELEASE] to qmake. For example:<br />
<br />
{{hc|PKGBUILD|<nowiki><br />
...<br />
<br />
build() {<br />
cd "$srcdir/$_pkgname-$pkgver-src"<br />
qmake-qt4 "$srcdir/$_pkgname-$pkgver-src/$_pkgname.pro" \<br />
PREFIX=/usr \<br />
CONFIG+=LINUX_INTEGRATED \<br />
INSTALL_ROOT_PATH="$pkgdir"\<br />
QMAKE_CFLAGS_RELEASE="${CFLAGS}"\<br />
QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}"<br />
<br />
make<br />
}<br />
<br />
...<br />
</nowiki>}}<br />
<br />
Alternatively, for a system wide configuration, you can create your own {{ic|qmake.conf}} and set the [http://doc.qt.io/qt-5/qmake-environment-reference.html#qmakespec QMAKESPEC] environment variable.<br />
<br />
=== WARNING: Package contains reference to $srcdir ===<br />
<br />
Somehow, the literal strings {{ic|$srcdir}} or {{ic|$pkgdir}} ended up in one of the installed files in your package.<br />
<br />
To identify which files, run the following from the ''makepkg'' build directory:<br />
$ grep -R "$(pwd)/src" pkg/<br />
<br />
[http://www.mail-archive.com/arch-general@archlinux.org/msg15561.html Link] to discussion thread.<br />
<br />
== See also ==<br />
<br />
* [https://www.archlinux.org/pacman/makepkg.8.html makepkg(8) Manual Page]<br />
* [https://www.archlinux.org/pacman/makepkg.conf.5.html makepkg.conf(5) Manual Page]<br />
* [https://gist.github.com/Earnestly/bebad057f40a662b5cc3 A Brief Tour of the Makepkg Process]</div>AraaXhttps://wiki.archlinux.org/index.php?title=Beginners%27_guide&diff=411502Beginners' guide2015-12-11T14:42:02Z<p>AraaX: updating فارسی interlanguage</p>
<hr />
<div>[[Category:Getting and installing Arch]]<br />
[[ar:Beginners' guide]]<br />
[[bg:Beginners' guide]]<br />
[[cs:Beginners' guide]]<br />
[[da:Beginners' guide]]<br />
[[de:Anleitung für Einsteiger]]<br />
[[el:Beginners' guide]]<br />
[[es:Beginners' guide]]<br />
[[fa:راهنمای_تازهکاران]]<br />
[[fr:Installation]]<br />
[[he:Beginners' guide]]<br />
[[hr:Beginners' guide]]<br />
[[hu:Beginners' guide]]<br />
[[id:Beginners' guide]]<br />
[[it:Beginners' guide]]<br />
[[ja:ビギナーズガイド]]<br />
[[ko:Beginners' guide]]<br />
[[lt:Beginners' guide]]<br />
[[nl:Beginners' guide]]<br />
[[pl:Beginners' guide]]<br />
[[pt:Beginners' guide]]<br />
[[ro:Ghidul începătorilor]]<br />
[[ru:Beginners' guide]]<br />
[[sk:Beginners' guide]]<br />
[[sr:Beginners' guide]]<br />
[[sv:Nybörjarguiden]]<br />
[[tr:Yeni başlayanlar rehberi]]<br />
[[uk:Beginners' guide]]<br />
[[zh-cn:Beginners' guide]]<br />
[[zh-tw:Beginners' guide]]<br />
{{Related articles start}}<br />
{{Related|:Category:Accessibility}}<br />
{{Related|Help:Reading}}<br />
{{Related|Installation guide}}<br />
{{Related|General recommendations}}<br />
{{Related|General troubleshooting}}<br />
{{Related|Boot debugging}}<br />
{{Related|pacman#Troubleshooting}}<br />
{{Related|pacman-key#Troubleshooting}}<br />
{{Related articles end}}<br />
This document will guide you through the process of installing [[Arch Linux]] using the [https://projects.archlinux.org/arch-install-scripts.git/ Arch Install Scripts]. Before installing, you are advised to skim over the [[FAQ]].<br />
<br />
The community-maintained [[Main page|ArchWiki]] is the primary resource that should be consulted if issues arise. The [[IRC channel]] (irc://irc.freenode.net/#archlinux) and the [https://bbs.archlinux.org/ forums] are also excellent resources if an answer cannot be found elsewhere. In accordance with [[the Arch Way]], you are encouraged to type {{ic|man ''command''}} to read the [[man page]] of any command you are unfamiliar with.<br />
<br />
== Preparation ==<br />
<br />
Arch Linux should run on any [[Wikipedia:P6 (microarchitecture)|i686]] compatible machine with a minimum of 256 MB RAM. A basic installation with all packages from the {{Grp|base}} group should take less than 800 MB of disk space.<br />
<br />
See [[:Category:Getting and installing Arch]] for instructions on downloading the installation medium, and methods for booting it to the target machine(s). This guide assumes you use the latest available version.<br />
<br />
== Boot the installation medium ==<br />
<br />
Point the current boot device to the drive containing the Arch installation media. This is typically achieved by pressing a key during the [[Wikipedia:Power-on self test|POST]] phase, as indicated on the splash screen. Refer to your motherboard's manual for details.<br />
<br />
When the Arch menu appears, select ''Boot Arch Linux'' and press {{ic|Enter}} to enter the installation environment. See [https://projects.archlinux.org/archiso.git/tree/docs/README.bootparams README.bootparams] for a list of [[Kernel parameters#Configuration|boot parameters]].<br />
<br />
You will be logged in as the root user and presented with a [[Zsh]] shell prompt. ''Zsh'' provides advanced [http://zsh.sourceforge.net/Guide/zshguide06.html tab completion] and other features as part of the [http://grml.org/zsh/ grml config]. For modifying or creating configuration files, typically in {{ic|/etc}}, [[nano#Usage|nano]] and [[vim#Usage|vim]] are suggested.<br />
<br />
=== UEFI mode ===<br />
<br />
In case you have a [[UEFI]] motherboard with UEFI mode enabled, the CD/USB will automatically launch Arch Linux via [http://www.freedesktop.org/wiki/Software/systemd/systemd-boot/ systemd-boot].<br />
<br />
To verify you are booted in UEFI mode, check that the following directory is populated:<br />
<br />
# ls /sys/firmware/efi/efivars<br />
<br />
See [[UEFI#UEFI Variables]] for details.<br />
<br />
=== Set the keyboard layout ===<br />
<br />
The default [[Keyboard_configuration_in_console|console keymap]] is set to [[Wikipedia:File:KB United States-NoAltGr.svg|us]]. Available choices can be listed with {{ic|localectl list-keymaps}}. <br />
<br />
For example, to change the layout to {{ic|de-latin1}}, run:<br />
<br />
# loadkeys ''de-latin1''<br />
<br />
If certain characters appear as white squares or other symbols, change the [[Console fonts|console font]]. For example:<br />
<br />
# setfont ''lat9w-16''<br />
<br />
=== Connect to the Internet ===<br />
<br />
; Wired<br />
<br />
The [[dhcpcd]] daemon is enabled on boot for wired devices, and will attempt to start a connection. To access captive portal login forms, use the [[ELinks]] browser. <br />
<br />
Verify a connection was established, for example with ''ping''. If none is available, proceed to [[Network configuration|configure the network]]; the examples below use [[netctl]] to this purpose. To prevent conflicts, stop the ''dhcpcd'' service (replacing {{ic|enp0s25}} with the correct wired interface):<br />
<br />
# systemctl stop dhcpcd@''enp0s25''.service<br />
<br />
[[Network configuration#Device names|Interfaces]] can be listed using {{ic|ip link}}, or {{ic|iw dev}} for wireless devices. They are prefixed with {{ic|en}} (ethernet), {{ic|wl}} (WLAN), or {{ic|ww}} (WWAN).<br />
<br />
; Wireless<br />
<br />
List [[Wireless_network_configuration#Getting_some_useful_information|available networks]], and make a connection for a specified interface:<br />
<br />
# wifi-menu -o ''wlp2s0''<br />
<br />
The resulting configuration file is stored in {{ic|/etc/netctl}}. For networks which require both a username and password, see [[WPA2 Enterprise#netctl]].<br />
<br />
; Other<br />
<br />
Several example profiles, such as for configuring a [[Network configuration#Static IP address|static IP address]], are available. Copy the required one to {{ic|/etc/netctl}}, for example {{ic|ethernet-static}}:<br />
<br />
# cp /etc/netctl/examples/''ethernet-static'' /etc/netctl<br />
<br />
Adjust the copy as needed, and enable it:<br />
<br />
# netctl start ''ethernet-static''<br />
<br />
=== Update the system clock ===<br />
<br />
Use [[systemd-timesyncd]] to ensure that your system clock is accurate. To start it:<br />
<br />
# timedatectl set-ntp true<br />
<br />
To check the service status, use {{ic|timedatectl status}}.<br />
<br />
== Prepare the storage devices ==<br />
<br />
{{Warning|<br />
* In general, partitioning or formatting will make existing data inaccessible and subject to being overwritten, i.e. destroyed, by subsequent operations. For this reason, all data that needs to be preserved must be backed up before proceeding.<br />
* If dual-booting with an existing installation of Windows on a UEFI/GPT system, avoid reformatting the UEFI partition, as this includes the Windows ''.efi'' file required to boot it. Furthermore, Arch must follow the same firmware boot mode and partitioning combination as Windows. See [[Dual boot with Windows#Important information]].}}<br />
<br />
In this step, the storage devices that will be used by the new system will be prepared. Read [[Partitioning]] for a more general overview.<br />
<br />
Users intending to create stacked block devices for [[LVM]], [[disk encryption]] or [[RAID]], should keep those instructions into consideration when preparing the partitions. If intending to install to a USB flash key, see [[Installing Arch Linux on a USB key]].<br />
<br />
=== Identify the devices ===<br />
<br />
The first step is to identify the devices where the new system will be installed. The following command will show all the available devices:<br />
<br />
# lsblk<br />
<br />
This will list all devices connected to your system along with their partition schemes, including that used to host and boot live Arch installation media (e.g. a USB drive). Not all devices listed will therefore be viable or appropriate mediums for installation. Results ending in {{ic|rom}}, {{ic|loop}} or {{ic|airoot}} can be ignored.<br />
<br />
Devices (e.g. hard disks) will be listed as {{ic|sd''x''}}, where {{ic|''x''}} is a lower-case letter starting from {{ic|a}} for the first device ({{ic|sda}}), {{ic|b}} for the second device ({{ic|sdb}}), and so on. Existing partitions on those devices will be listed as {{ic|sd''xY''}}, where {{ic|''Y''}} is a number starting from {{ic|1}} for the first partition, {{ic|2}} for the second, and so on. In the example below, only one device is available ({{ic|sda}}), and that device uses only one partition ({{ic|sda1}}):<br />
<br />
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT<br />
sda 8:0 0 80G 0 disk<br />
└─sda1 8:1 0 80G 0 part<br />
<br />
The {{ic|sd''xY''}} convention will be used in the examples provided below for partition tables, partitions, and file systems. As they are just examples, it is important to ensure that any necessary changes to device names, partition numbers, and/or partition sizes (etc.) are made. Do not just blindly copy and paste the commands.<br />
<br />
If the existing partition scheme does not need to be changed, skip to [[#File systems and swap]], otherwise continue reading the following section.<br />
<br />
=== Partition table types ===<br />
<br />
If you are installing alongside an existing installation (i.e. dual-booting), a partition table will already be in use. If the devices are not partitioned, or the current partitions table or scheme needs to be changed, you will first have to determine the partition tables (one for each device) in use or to be used.<br />
<br />
There are two types of partition table:<br />
<br />
* [[GPT]]<br />
* [[MBR]]<br />
<br />
Any existing partition table can be identified with the following command for each device:<br />
<br />
# parted /dev/sd''x'' print<br />
<br />
=== Partitioning tools ===<br />
<br />
{{Warning|Using a partitioning tool that is incompatible with your partition table type will likely result in the destruction of that table, along with any existing partitions/data.}}<br />
<br />
For each device to be partitioned, a proper tool must be chosen according to the partition table to be used. Several partitioning tools are provided by the Arch installation medium, including:<br />
<br />
* [[parted]]: GPT and MBR<br />
* [[fdisk#Fdisk usage summary|fdisk]], '''cfdisk''', '''sfdisk''': GPT and MBR<br />
* [[gdisk#Gdisk usage summary|gdisk]], '''cgdisk''', '''sgdisk''': GPT<br />
<br />
Devices may also be partitioned before booting the installation media, for example through tools such as [[GParted]] (also provided as a [http://gparted.sourceforge.net/livecd.php live CD]).<br />
<br />
==== Using parted in interactive mode ====<br />
<br />
All the examples provided below make use of ''parted'', as it can be used for both UEFI/GPT and BIOS/MBR. It will be launched in ''interactive mode'', which simplifies the partitioning process and reduces unnecessary repetition by automatically applying all partitioning commands to the specified device.<br />
<br />
In order to start operating on a device, execute:<br />
<br />
# parted /dev/sd''x''<br />
<br />
You will notice that the command-line prompt changes from a hash ({{ic|#}}) to {{ic|(parted)}}: this also means that the new prompt is not a command to be manually entered when running the commands in the examples.<br />
<br />
To see a list of the available commands, enter:<br />
<br />
(parted) help<br />
<br />
When finished, or if wishing to implement a partition table or scheme for another device, exit from parted with:<br />
<br />
(parted) quit<br />
<br />
After exiting, the command-line prompt will change back to {{ic|#}}.<br />
<br />
=== Create new partition table ===<br />
<br />
You need to (re)create the partition table of a device when it has never been partitioned before, or when you want to change the type of its partition table. Recreating the partition table of a device is also useful when the partition scheme needs to be restructured from scratch.<br />
<br />
Open each device whose partition table must be (re)created with:<br />
<br />
# parted /dev/sd''x''<br />
<br />
To then create a new GPT partition table for UEFI systems, use the following command:<br />
<br />
(parted) mklabel gpt<br />
<br />
To create a new MBR/msdos partition table for BIOS systems instead, use:<br />
<br />
(parted) mklabel msdos<br />
<br />
=== Partition schemes ===<br />
<br />
You can decide the number and size of the partitions the devices should be split into, and which directories will be used to mount the partitions in the installed system (also known as ''mount points''). The mapping from partitions to directories is the [[Partitioning#Partition scheme|partition scheme]], which must comply with the following requirements:<br />
<br />
* At least a partition for the {{ic|/}} (''root'') directory '''must''' be created.<br />
* When using a UEFI motherboard, one [[Unified Extensible Firmware Interface#EFI System Partition|EFI System Partition]] '''must''' be created.<br />
<br />
In the examples below it is assumed that a new and contiguous partitioning scheme is applied to a single device. Some optional partitions will also be created for the {{ic|/boot}} and {{ic|/home}} directories: see also [[Arch filesystem hierarchy]] for an explanation of the purpose of the various directories; if separate partitions for directories like {{ic|/boot}} or {{ic|/home}} are not created, these will simply be contained in the {{ic|/}} partition. Also the creation of an optional partiton for [[swap space]] will be illustrated.<br />
<br />
If not already open in a ''parted'' interactive session, open each device to be partitioned with:<br />
<br />
# parted /dev/sd''x''<br />
<br />
The following command will be used to create partitions:<br />
<br />
(parted) mkpart ''part-type'' ''fs-type'' ''start'' ''end''<br />
<br />
* {{ic|''part-type''}} is one of {{ic|primary}}, {{ic|extended}} or {{ic|logical}}, and is meaningful only for MBR partition tables.<br />
* {{ic|''fs-type''}} is an identifier chosen among those listed by entering {{ic|help mkpart}} as the closest match to the file system that you will use in [[#File systems and swap]]. The ''mkpart'' command does not actually create the file system: the {{ic|''fs-type''}} parameter will simply be used by ''parted'' to set a 1-byte code that is used by boot loaders to "preview" what kind of data is found in the partition, and act accordingly if necessary. See also [[Wikipedia:Disk partitioning#PC partition types]].<br />
: {{Tip|Most [[Wikipedia:File_system#Linux|Linux native file systems]] map to the same partition code ([[Wikipedia:Partition type#PID_83h|0x83]]), so it is perfectly safe to e.g. use {{ic|ext2}} for an ''ext4''-formatted partition.}}<br />
* {{ic|''start''}} is the beginning of the partition from the start of the device. It consists of a number followed by a [http://www.gnu.org/software/parted/manual/parted.html#unit unit], for example {{ic|1M}} means start at 1MiB.<br />
* {{ic|''end''}} is the end of the partition from the start of the device (''not'' from the {{ic|''start''}} value). It has the same syntax as {{ic|''start''}}, for example {{ic|100%}} means end at the end of the device (use all the remaining space).<br />
<br />
{{Warning|It is important that the partitions do not overlap each other: if you do not want to leave unused space in the device, make sure that each partition starts where the previous one ends.}}<br />
<br />
{{Note|''parted'' may issue a warning like:<br />
<br />
Warning: The resulting partition is not properly aligned for best performance.<br />
Ignore/Cancel?<br />
<br />
In this case, read [[Partitioning#Partition alignment]] and follow [[GNU Parted#Alignment]] to fix it.}}<br />
<br />
The following command will be used to flag the partition that contains the {{ic|/boot}} directory as bootable:<br />
<br />
(parted) set ''partition'' boot on<br />
<br />
* {{ic|''partition''}} is the number of the partition to be flagged (see the output of the {{ic|print}} command).<br />
<br />
==== UEFI/GPT examples ====<br />
<br />
In every instance, a special bootable [[Unified Extensible Firmware Interface#EFI System Partition|EFI System Partition]] is required.<br />
<br />
If creating a new EFI System Partition, use the following commands (a size of 512MiB is suggested):<br />
<br />
(parted) mkpart ESP fat32 1MiB 513MiB<br />
(parted) set 1 boot on<br />
<br />
The remaining partition scheme is entirely up to you. For one other partition using 100% of remaining space:<br />
<br />
(parted) mkpart primary ext4 513MiB 100%<br />
<br />
For separate {{ic|/}} (20GiB) and {{ic|/home}} (all remaining space) partitions:<br />
<br />
(parted) mkpart primary ext4 513MiB 20.5GiB<br />
(parted) mkpart primary ext4 20.5GiB 100%<br />
<br />
And for separate {{ic|/}} (20GiB), swap (4GiB), and {{ic|/home}} (all remaining space) partitions:<br />
<br />
(parted) mkpart primary ext4 513MiB 20.5GiB<br />
(parted) mkpart primary linux-swap 20.5GiB 24.5GiB<br />
(parted) mkpart primary ext4 24.5GiB 100%<br />
<br />
==== BIOS/MBR examples ====<br />
<br />
For a minimum single primary partition using all available disk space, the following command would be used:<br />
<br />
(parted) mkpart primary ext4 1MiB 100%<br />
(parted) set 1 boot on<br />
<br />
In the following instance, a 20GiB {{ic|/}} partition will be created, followed by a {{ic|/home}} partition using all the remaining space:<br />
<br />
(parted) mkpart primary ext4 1MiB 20GiB<br />
(parted) set 1 boot on<br />
(parted) mkpart primary ext4 20GiB 100%<br />
<br />
In the final example below, separate {{ic|/boot}} (100MiB), {{ic|/}} (20GiB), swap (4GiB), and {{ic|/home}} (all remaining space) partitions will be created:<br />
<br />
(parted) mkpart primary ext4 1MiB 100MiB<br />
(parted) set 1 boot on<br />
(parted) mkpart primary ext4 100MiB 20GiB<br />
(parted) mkpart primary linux-swap 20GiB 24GiB<br />
(parted) mkpart primary ext4 24GiB 100%<br />
<br />
=== File systems and swap ===<br />
<br />
Once the partitions have been created, each must be formatted with an appropriate [[file system]], ''except'' for swap partitions. All available partitions on the intended installation device can be listed with the following command:<br />
<br />
# lsblk /dev/sd''x''<br />
<br />
With the exceptions noted below, it is recommended to use the {{ic|ext4}} file system:<br />
<br />
# mkfs.ext4 /dev/sd''xY''<br />
<br />
''If'' a new UEFI system partition has been created on a UEFI/GPT system, it '''must''' be formatted with a {{ic|fat32}} file system:<br />
<br />
# mkfs.fat -F32 /dev/sd''xY''<br />
<br />
''If'' a swap partition has been created, it must be set up and activated with:<br />
<br />
# mkswap /dev/sd''xY''<br />
# swapon /dev/sd''xY''<br />
<br />
Mount the root partition to the {{ic|/mnt}} directory of the live system:<br />
<br />
# mount /dev/sd''xY'' /mnt<br />
<br />
Remaining [[Partitioning#Partition_scheme|partitions]] (except ''swap'') may be mounted in any order, after creating the respective mount points. For example, when using a {{ic|/boot}} partition:<br />
<br />
# mkdir -p /mnt/boot<br />
# mount /dev/sd''xZ'' /mnt/boot<br />
<br />
{{ic|/boot}} is also recommended for mounting the EFI System Partition on a UEFI/GPT system. See [[EFISTUB]] and related articles for alternatives.<br />
<br />
== Installation ==<br />
<br />
=== Select the mirrors ===<br />
<br />
Packages to be installed must be downloaded from mirror servers, which are defined in {{ic|/etc/pacman.d/mirrorlist}}. On the live system, all mirrors are enabled, and sorted by their synchronization status and speed at the time the installation image was created.<br />
<br />
The higher a mirror is placed in the list, the more priority it is given when downloading a package. You may want to edit the file accordingly, and move the geographically closest mirrors to the top of the list, although other criteria should be taken into account. See [[Mirrors]] for details.<br />
<br />
''pacstrap'' will also install a copy of this file to the new system, so it is worth getting right.<br />
<br />
=== Install the base packages ===<br />
<br />
The ''pacstrap'' script installs the base system. To build packages from the [[AUR]] or with [[ABS]], the {{Grp|base-devel}} group is also required.<br />
<br />
Not all tools from the live installation (see [https://projects.archlinux.org/archiso.git/tree/configs/releng/packages.both packages.both]) are part of the base group. Packages can later be [[install]]ed with ''pacman'', or by appending their names to the ''pacstrap'' command.<br />
<br />
# pacstrap -i /mnt base base-devel<br />
<br />
The {{ic|-i}} switch ensures prompting before package installation.<br />
<br />
== Configuration ==<br />
<br />
=== fstab ===<br />
<br />
Generate an [[fstab]] file. The {{ic|-U}} option indicates UUIDs: see [[Persistent block device naming]]. Labels can be used instead through the {{ic|-L}} option.<br />
<br />
# genfstab -U /mnt > /mnt/etc/fstab<br />
<br />
Check the resulting file in {{ic|/mnt/etc/fstab}} afterwards, and edit it in case of errors.<br />
<br />
=== Change root ===<br />
<br />
Copy any other configuration files to the new system in {{ic|/mnt}} (such as netctl profiles in {{ic|/etc/netctl}}), then [[chroot]] to it:<br />
<br />
# arch-chroot /mnt /bin/bash<br />
<br />
=== Locale ===<br />
<br />
The [[Locale]] defines which language the system uses, and other regional considerations such as currency denomination, numerology, and character sets.<br />
<br />
Possible values are listed in {{ic|/etc/locale.gen}}. Uncomment {{ic|en_US.UTF-8 UTF-8}}, as well as other needed localisations. Save the file, and generate the new locales:<br />
<br />
# locale-gen<br />
<br />
Create {{ic|/etc/locale.conf}}, where {{ic|LANG}} refers to the ''first column'' of an uncommented entry in {{ic|/etc/locale.gen}}:<br />
<br />
{{hc|1=/etc/locale.conf|2=<br />
LANG=''en_US.UTF-8''<br />
}}<br />
<br />
If you [[#Set the keyboard layout|set the keyboard layout]], make the changes persistent in {{ic|/etc/vconsole.conf}}. For example, if {{ic|de-latin1}} was set with ''loadkeys'', and {{ic|lat9w-16}} with ''setfont'', assign the {{ic|KEYMAP}} and {{ic|FONT}} variables accordingly:<br />
<br />
{{hc|1=/etc/vconsole.conf|2=<br />
KEYMAP=''de-latin1''<br />
FONT=''lat9w-16''<br />
}}<br />
<br />
=== Time ===<br />
<br />
Select a [[time zone]]:<br />
<br />
# tzselect<br />
<br />
Create the symbolic link {{ic|/etc/localtime}}, where {{ic|Zone/Subzone}} is the {{ic|TZ}} value from ''tzselect'':<br />
<br />
# ln -s /usr/share/zoneinfo/''Zone''/''SubZone'' /etc/localtime<br />
<br />
It is recommended to adjust the time skew, and set the time standard to UTC:<br />
<br />
# hwclock --systohc --utc<br />
<br />
If other operating systems are installed on the machine, they must be configured accordingly. See [[Time]] for details.<br />
<br />
=== Initramfs ===<br />
<br />
As [[mkinitcpio]] was run on installation of {{Pkg|linux}} with ''pacstrap'', most users can use the defaults provided in {{ic|mkinitcpio.conf}}.<br />
<br />
For special configurations, set the correct [[Mkinitcpio#HOOKS|hooks]] in {{ic|/etc/mkinitcpio.conf}} and [[Mkinitcpio#Image_creation_and_activation|re-generate]] the initramfs image:<br />
<br />
# mkinitcpio -p linux<br />
<br />
=== Install a boot loader ===<br />
<br />
See [[Boot loaders]] for available choices and configurations. If you have an Intel CPU, install the {{Pkg|intel-ucode}} package, and [[Microcode#Enabling_Intel_microcode_updates|enable microcode updates]].<br />
<br />
==== UEFI/GPT ====<br />
<br />
Here, the installation drive is assumed to be GPT-partioned, and have the [[Unified Extensible Firmware Interface#EFI System Partition|EFI System Partition]] (gdisk type {{ic|EF00}}, formatted with FAT32) mounted at {{ic|/boot}}.<br />
<br />
''bootctl'' is part of systemd, and as such part of the base installation.<br />
<br />
# bootctl install<br />
<br />
Create a boot entry in {{ic|/boot/loader/entries/arch.conf}}, replacing {{ic|/dev/sda2}} with the '''root''' partition:<br />
<br />
{{hc|1=/boot/loader/entries/arch.conf|2=<br />
title Arch Linux<br />
linux /vmlinuz-linux<br />
initrd /initramfs-linux.img<br />
options root='''/dev/sda2''' rw<br />
}}<br />
<br />
Modify {{ic|/boot/loader/loader.conf}} to select the default entry (without {{ic|.conf}}) suffix:<br />
<br />
{{hc|1=/boot/loader/loader.conf|2=<br />
timeout 3<br />
default arch<br />
}}<br />
<br />
See [[systemd-boot]] for more information.<br />
<br />
==== BIOS/MBR ====<br />
<br />
Install the {{Pkg|grub}} package. To search for other operating systems, also install {{Pkg|os-prober}}:<br />
<br />
# pacman -S grub os-prober<br />
<br />
Install the bootloader to the ''drive'' Arch was installed to:<br />
<br />
# grub-install --recheck ''/dev/sda''<br />
<br />
Generate {{ic|grub.cfg}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
See [[GRUB]] for more information.<br />
<br />
=== Configure the network ===<br />
<br />
The procedure is similar to [[#Connect to the Internet]], except made persistent for subsequent boots. Select '''one''' daemon to handle the network.<br />
<br />
==== Hostname ====<br />
<br />
Set the [[hostname]] to your liking:<br />
<br />
{{hc|1=/etc/hostname|2=<br />
''myhostname''<br />
}}<br />
<br />
It is recommended to append the same hostname to {{ic|localhost}} entries in {{ic|/etc/hosts}}. See [[Network configuration#Local network hostname resolution]].<br />
<br />
==== Wired ====<br />
<br />
When only requiring a single wired connection, enable the [[dhcpcd]] service:<br />
<br />
# systemctl enable dhcpcd@''interface''.service<br />
<br />
Where {{ic|''interface''}} is an ethernet [[Network_configuration#Device_names|device name]].<br />
<br />
See [[Network configuration#Configure the IP address]] for other available methods.<br />
<br />
==== Wireless ====<br />
<br />
Install {{Pkg|iw}}, {{Pkg|wpa_supplicant}}, and (for ''wifi-menu'') {{Pkg|dialog}}:<br />
<br />
# pacman -S iw wpa_supplicant dialog<br />
<br />
Additional [[Wireless#Installing driver/firmware|firmware packages]] may also be required.<br />
<br />
If you used ''wifi-menu'' priorly, repeat the steps '''after''' finishing the rest of this installation and rebooting, to prevent conflicts with the existing processes.<br />
<br />
See [[Netctl]] and [[Wireless#Wireless management]] for more information.<br />
<br />
== Unmount the partitions and reboot ==<br />
<br />
Set the root [[password]] with:<br />
<br />
# passwd<br />
<br />
Exit from the chroot environment by running {{ic|exit}} or pressing {{ic|Ctrl+D}}. <br />
<br />
Partitions will be unmounted automatically by ''systemd'' on shutdown. You may however unmount manually as a safety measure:<br />
<br />
# umount -R /mnt<br />
<br />
If the partition is "busy", you can find the cause with [[fuser]]. Reboot the computer. <br />
<br />
# reboot<br />
<br />
Remove the installation media, or you may boot back into it. You can log into your new installation as ''root'', using the password you specified with ''passwd''.<br />
<br />
== Post-installation ==<br />
<br />
Your new Arch Linux base system is now a functional GNU/Linux environment ready to be built into whatever you wish or require for your purposes. You are now ''strongly'' advised to read the [[General recommendations]] article, especially the first two sections. Its other sections provide links to post-installation tutorials like setting up a graphical user interface, sound or a touchpad.<br />
<br />
For a list of applications that may be of interest, see [[List of applications]].</div>AraaXhttps://wiki.archlinux.org/index.php?title=Help:Editing&diff=410138Help:Editing2015-11-25T19:21:43Z<p>AraaX: Update Persian interlanguage link</p>
<hr />
<div>[[Category:Help]]<br />
[[cs:Help:Editing]]<br />
[[es:Help:Editing]]<br />
[[fa:راهنما:راهنمای_ویرایش_ویکی_آرچ]]<br />
[[fr:Aide:Redaction]]<br />
[[it:Help:Editing]]<br />
[[ja:Help:編集]]<br />
[[pl:Help:Editing]]<br />
[[pt:Help:Editing]]<br />
[[ru:Help:Editing]]<br />
[[sk:Help:Editing]]<br />
[[sr:Help:Editing]]<br />
[[tr:Wikiye yazı yazmak]]<br />
[[uk:Help:Editing]]<br />
[[zh-CN:Help:Editing]]<br />
[[zh-TW:Help:Editing]]<br />
{{Related articles start}}<br />
{{Related|ArchWiki:About}}<br />
{{Related|Help:Cheatsheet}}<br />
{{Related|Help:Style}}<br />
{{Related|Help:Reading}}<br />
{{Related|Help:Template}}<br />
{{Related|Help:Discussion}}<br />
{{Related|ArchWiki:Sandbox}}<br />
{{Related|Wiki Monkey}}<br />
{{Related articles end}}<br />
<br />
ArchWiki is powered by [https://www.mediawiki.org/wiki/MediaWiki MediaWiki], a free software wiki package written in PHP, originally designed for use on Wikipedia. More in-depth help can be found at [https://www.mediawiki.org/wiki/Help:Contents Help:Contents on MediaWiki] and [[wikipedia:Help:Contents|Help:Contents on Wikipedia]].<br />
<br />
This is a short tutorial about editing the [[ArchWiki:About|ArchWiki]]. Before editing or creating pages, users are encouraged to familiarize themselves with the general tone, layout, and style of existing articles. An effort should be made to maintain a level of consistency throughout the wiki. See [[Help:Reading]] for an overview of common stylistic conventions. See [[Help:Style]] for more detail.<br />
<br />
You must be logged-in to edit pages. Visit [[Special:UserLogin]] to log in or create an account. To experiment with editing, please use the [[sandbox]]. For an overview of wiki markup, see [[Help:Cheatsheet]]. For wiki tasks, see [[ArchWiki:Contributing]].<br />
<br />
== Editing ==<br />
<br />
To begin editing a page, click the '''edit''' tab at the top of the page. Alternatively, users may edit a specific section of an article by clicking the '''edit''' link to the right of the section heading. The ''Editing'' page will be displayed, which consists of the following elements:<br />
<br />
* Edit toolbar (optional)<br />
* Edit box<br />
* Edit summary box<br />
* ''Save page'', ''Show preview'', ''Show changes'', and ''Cancel'' links<br />
<br />
The edit box will contain the '''wikitext''' (the editable source code from which the server produces the web page) for the current revision of the page or section. To perform an edit:<br />
<br />
# Modify the wikitext as needed (see [[#Formatting]] below for details).<br />
# Explain the edit in the '''Summary''' box (e.g. "fixed typo" or "added info on xyz" (see [[Wikipedia:Help:Edit summary|Help:Edit summary]] for details)). {{Note|'''All edits should be accompanied by a descriptive summary.''' The summary allows administrators and other maintainers to easily identify controversial edits and vandalism.}}<br />
# Use the '''Show preview''' button to facilitate proofreading and verify formatting before saving. <br />
# Mark the edit as [[Wikipedia:Wikipedia:Minor edit|minor]] by checking the '''This is a minor edit''' box if the edit is superficial and indisputable.<br />
# Save changes by clicking '''Save page'''. If unsatisfied, click '''Cancel''' instead (or repeat the process until satisfied).<br />
<br />
{{Note|<br />
* If you are not going to use an external editor like [[vim]], you may want to consider using [https://secure.wikimedia.org/wikipedia/en/wiki/User:Cacycle/wikEd wikEd], which adds syntax highlighting, regex search and replace and other nice features to the standard MediaWiki editor. The greasemonkey script works flawlessly with the ArchWiki. Remember to always double-check any automated tasks!<br />
* Articles should '''not''' be signed because they are ''shared'' works; one editor should not be singled out above others.<br />
}}<br />
<br />
=== Reverting edits ===<br />
<br />
If a page was edited incorrectly, the following procedures describe how to revert an article to a previous version. To revert a single edit:<br />
<br />
# Click the '''history''' tab at the top of the page to be modified (beside the '''edit''' tab). A list of revisions is displayed.<br />
# Click the '''undo''' link to the right of the unwanted edit. An edit preview is displayed, showing the current revision on the left and the text to be saved on the right.<br />
# Write the reason why you are undoing this edit to the edit summary field.<br />
# If satisfied, click the '''Save page''' button at the bottom of the page.<br />
<br />
The wiki page should now be back in its original state.<br />
<br />
Occasionally, it is necessary to revert several last edits at once. To revert an article to a previous version:<br />
<br />
# Click the '''history''' tab at the top of the page to be modified (beside the '''edit''' tab). A list of revisions is displayed.<br />
# View the desired revision (i.e. the last ''good'' version) by clicking on the appropriate timestamp. That revision is displayed.<br />
# Click the '''edit''' tab at the top of the page. A warning is displayed: '''You are editing an out-of-date revision of this page.'''<br />
# Write the revision timestamp (displayed at the top of page) and a reason why you are reverting page state to the edit summary field.<br />
# If satisfied, simply click the '''Save page''' button to revert to this version. <br />
<br />
{{Note|'''Avoid combining an undo and an edit!''' Revert the edit first, then make additional changes; do not edit the revision preview.}}<br />
<br />
== Creating pages ==<br />
<br />
Before creating a new page, please consider the following:<br />
<br />
# ''Is your topic relevant to Arch Linux?'' Irrelevant or unhelpful articles will be deleted.<br />
# ''Is your topic of interest to others?'' Consider not only what you wish to write about, but also what others may wish to read. Personal notes belong on your ''user'' page.<br />
# ''Is your topic worthy of a new page?'' Search the wiki for similar articles. If they exist, consider improving or adding a section to an existing article instead.<br />
# ''Will your contribution be significant?'' Avoid creating stubs unless planning to expand them shortly thereafter.<br />
<br />
Creating a new page requires selection of a descriptive '''title''' and an appropriate '''category'''.<br />
<br />
Please read [[Help:Article naming guidelines]] and [[Help:Style#Title]] for article naming advice. Do not include "Arch Linux" or variations in page titles. This is the Arch Linux wiki; it is assumed that articles will be related to Arch Linux (e.g., "Installing Openbox"; not "Installing Openbox in Arch Linux").<br />
<br />
Visit the [[Table of contents]] to help choose an appropriate category. Articles may belong to multiple categories.<br />
<br />
To add a new page to some category (say "My new page" to "Some category") you need to:<br />
<br />
# Create a page with your new title by browsing to https://wiki.archlinux.org/index.php/My_new_page (remember to replace "My_new_page" with the intended title!)<br />
# Add {{ic|<nowiki>[[Category:Some category]]</nowiki>}} to the '''top''' of your page<br />
<br />
{{Note|'''Do not create uncategorized pages!''' All pages must belong to at least one category. If you cannot find a suitable category, consider creating a new one.}}<br />
<br />
== Formatting ==<br />
<br />
Text formatting is accomplished with wiki markup whenever possible; learning HTML is not necessary. Various templates are also available for common formatting tasks; see [[Help:Template]] for information about templates. The [[Help:Cheatsheet]] summarizes the most common formatting options.<br />
<br />
=== Headings and subheadings ===<br />
<br />
Headings and subheadings are an easy way to improve the organization of an article. If you can see distinct topics being discussed, you can break up an article by inserting a heading for each section. See [[Help:Style#Section headings]] and [[Help:Effective use of headers]] for style information.<br />
<br />
Headings must start from second level, and can be created like this:<br />
<br />
== Second-level heading ==<br />
<br />
=== Third-level heading ===<br />
<br />
==== Fourth-level heading ====<br />
<br />
===== Fifth-level heading =====<br />
<br />
====== Sixth-level heading ======<br />
<br />
{{Note|First-level headings are not allowed, their formatting is reserved for the article title.}}<br />
<br />
If an article has at least four headings, a table of contents (TOC) will be automatically generated. If this is not desired, place {{ic|<nowiki>__NOTOC__</nowiki>}} in the article. Try creating some headings in the [[Sandbox]] and see the effect on the TOC.<br />
<br />
=== Line breaks ===<br />
<br />
An empty line is used to start a new paragraph while single line breaks have no effect in regular paragraphs.<br />
<br />
The HTML {{ic|<nowiki><br></nowiki>}} tag can be used to manually insert line breaks, but should be avoided. A manual break may be justified with other formatting elements, such as lists.<br />
<br />
{| width="79%" class="wikitable"<br />
! scope="col" width="50%" | wikitext<br />
! scope="col" width="50%" | rendering<br />
|-<br />
|<br />
This sentence<br />
is broken into<br />
three lines.<br />
|<br />
This sentence<br />
is broken into<br />
three lines.<br />
|-<br />
|<br />
This is paragraph number one.<br />
<br />
This is paragraph number two.<br />
|<br />
This is paragraph number one.<br />
<br />
This is paragraph number two.<br />
|-<br />
|<br />
* This point <nowiki><br></nowiki> spans multiple lines<br />
* This point<br />
ends the list<br />
|<br />
* This point <br> spans multiple lines<br />
* This point<br />
ends the list<br />
|-<br />
|}<br />
<br />
See [[Help:Style/White space]] for information on proper use of whitespace characters.<br />
<br />
=== Bold and italics ===<br />
<br />
'''Bold''' and ''italics'' are added by surrounding a word or phrase with two, three or five apostrophes ({{ic|'}}):<br />
<br />
{| width="79%" class="wikitable"<br />
! scope="col" width="50%" | wikitext<br />
! scope="col" width="50%" | rendering<br />
|-<br />
|<br />
{{ic|<nowiki>''italics''</nowiki>}}<br />
|<br />
''italics''<br />
|-<br />
|<br />
{{ic|<nowiki>'''bold'''</nowiki>}}<br />
|<br />
'''bold'''<br />
|-<br />
|<br />
{{ic|<nowiki>'''''bold and italics'''''</nowiki>}}<br />
|<br />
'''''bold and italics'''''<br />
|-<br />
|}<br />
<br />
=== Strike-out ===<br />
<br />
Use strike-out text to show that the text no longer applies or has relevance.<br />
<br />
{| width="79%" class="wikitable"<br />
! scope="col" width="50%" | wikitext<br />
! scope="col" width="50%" | rendering<br />
|-<br />
|<br />
{{bc|<nowiki><s>Strike-out text</s></nowiki>}}<br />
|<br />
<s>Strike-out text</s><br />
|-<br />
|}<br />
<br />
=== Indenting ===<br />
<br />
To indent text, place a colon ({{ic|:}}) at the beginning of a line. The more colons you put, the further indented the text will be. A newline marks the end of the indented paragraph.<br />
<br />
{| width="79%" class="wikitable"<br />
! scope="col" width="50%" | wikitext<br />
! scope="col" width="50%" | rendering<br />
|-<br />
|<br />
This is not indented at all.<br />
:This is indented slightly.<br />
::This is indented more.<br />
|<br />
This is not indented at all.<br />
:This is indented slightly.<br />
::This is indented more.<br />
|-<br />
|}<br />
<br />
{{Note|Use indentation only when strictly necessary to obtain the desired layout. In talk pages, use it to indent replies (see [[Help:Discussion]]).}}<br />
<br />
=== Lists ===<br />
<br />
Remember that wiki syntax does not support multi-line list items; every newline character ends the list item definition. To start a new line inside a list item, use the {{ic|&lt;br>}} tag. To enter a multi-line code block inside a list item, use [[Template:bc]] and escape the content using {{ic|&lt;nowiki>}} tags. See also [[Help:Style/White space]] and [[Help:Template]].<br />
<br />
==== Bullet points ====<br />
<br />
Bullet points have no apparent order of items.<br />
<br />
To insert a bullet, use an asterisk ({{ic|*}}). Multiple {{ic|*}}s will increase the level of indentation.<br />
<br />
{| width="79%" class="wikitable"<br />
! scope="col" width="50%" | wikitext<br />
! scope="col" width="50%" | rendering<br />
|-<br />
|<br />
* First item <br />
* Second item <br />
** Sub-item<br />
* Third item <br />
|<br />
* First item <br />
* Second item <br />
** Sub-item<br />
* Third item<br />
|-<br />
|}<br />
<br />
==== Numbered lists ====<br />
<br />
Numbered lists introduce numbering and thus order the list items. You should generally use unordered lists as long as the order in which items appear is not the primary concern.<br />
<br />
To create numbered lists, use the number sign or hash symbol ({{ic|#}}). Multiple {{ic|#}}s will increase the level of indentation.<br />
<br />
{| width="79%" class="wikitable"<br />
! scope="col" width="50%" | wikitext<br />
! scope="col" width="50%" | rendering<br />
|-<br />
|<br />
# First item <br />
# Second item <br />
## Sub-item<br />
# Third item <br />
|<br />
# First item<br />
# Second item<br />
## Sub-item<br />
# Third item<br />
|-<br />
|<br />
# First item<br />
# Second item<br />
#* Sub-item<br />
# Third item<br />
|<br />
# First item<br />
# Second item<br />
#* Sub-item<br />
# Third item<br />
|-<br />
|}<br />
<br />
==== Definition lists ====<br />
<br />
Definition lists are defined with a leading semicolon ({{ic|;}}) and a colon ({{ic|:}}) following the term. <br />
<br />
{| width="79%" class="wikitable"<br />
! scope="col" width="50%" | wikitext<br />
! scope="col" width="50%" | rendering<br />
|-<br />
|<br />
Definition lists:<br />
; Keyboard: Input device with buttons or keys<br />
; Mouse: Pointing device for two-dimensional input<br />
or<br />
; Keyboard<br />
: Input device with buttons or keys<br />
; Mouse<br />
: Pointing device for two-dimensional input<br />
|<br />
Definition lists:<br />
; Keyboard: Input device with buttons or keys<br />
; Mouse: Pointing device for two-dimensional input<br />
or<br />
; Keyboard<br />
: Input device with buttons or keys<br />
; Mouse<br />
: Pointing device for two-dimensional input<br />
|-<br />
|<br />
Use additional colons if a definition has multiple definitions:<br />
; Term<br />
: First definition<br />
: Second definition<br />
|<br />
Use additional colons if a definition has multiple definitions:<br />
; Term<br />
: First definition<br />
: Second definition<br />
|-<br />
|}<br />
<br />
Definition lists must not be simply used for formatting, see [http://www.w3.org/TR/html4/struct/lists.html#edef-DL W3's examples].<br />
<br />
=== Code ===<br />
<br />
To add code to the wiki, use one of the [[Help:Template#Code formatting templates|code formatting templates]]. Alternatively, simply start each line with a single whitespace character, for example:<br />
<span style="border:1px dashed #a9abb0;">&nbsp;</span>$ echo Hello World<br />
<br />
See also [[Help:Style#Code formatting]].<br />
<br />
=== Tables ===<br />
<br />
{{Tip|See [http://www.tablesgenerator.com/mediawiki_tables Mediawiki Tables Generator] to automatically generate tables.}}<br />
<br />
Used effectively, tables can help organize and summarize swaths of data. For advanced table syntax and formatting, see [[Wikipedia:Help:Table|Help:Table]].<br />
<br />
{| width="79%" class="wikitable"<br />
! scope="col" width="50%" | wikitext<br />
! scope="col" width="50%" | rendering<br />
|-<br />
|<br />
{{bc|<nowiki><br />
{| class="wikitable"<br />
|+ Tabular data<br />
! Distro !! Color<br />
|-<br />
| Arch || Blue<br />
|-<br />
| Gentoo || Purple<br />
|-<br />
| Ubuntu || Orange<br />
|}<br />
</nowiki>}}<br />
|<br />
{| class="wikitable"<br />
|+ Tabular data<br />
! Distro !! Color<br />
|-<br />
| Arch || Blue<br />
|-<br />
| Gentoo || Purple<br />
|-<br />
| Ubuntu || Orange<br />
|}<br />
|-<br />
|<br />
{{bc|<nowiki>{| class="wikitable"<br />
! Filesystem !! Size !! Used !! Avail !! Use% !! Mounted on<br />
|-<br />
| rootfs || 922G || 463G || 413G || 53% || /<br />
|-<br />
| /dev || 1.9G || 0 || 1.9G || 0% || /dev<br />
|}</nowiki>}}<br />
|<br />
{| class="wikitable"<br />
! Filesystem !! Size !! Used !! Avail !! Use% !! Mounted on<br />
|-<br />
| rootfs || 922G || 463G || 413G || 53% || /<br />
|-<br />
| /dev || 1.9G || 0 || 1.9G || 0% || /dev<br />
|}<br />
|-<br />
|}<br />
<br />
== Links ==<br />
<br />
Links are essential to help readers navigate the site. In general, editors should ensure that every article contains ''outgoing'' links to other articles (avoid [[Special:DeadendPages|dead-end pages]]) and is referenced by ''incoming'' links from other articles (the [[Special:WhatLinksHere|what links here]] special page can be used to display incoming links).<br />
<br />
=== Internal links ===<br />
<br />
You can extensively cross-reference wiki pages using internal links. You can add links to existing titles, and also to titles you think ought to exist in future.<br />
<br />
To make a link to another page on the same wiki, just put the title in double square brackets.<br />
<br />
For example, if you want to make a link to, say, the [[pacman]] article, use:<br />
<br />
<nowiki>[[pacman]]</nowiki><br />
<br />
If you want to use words other than the article title as the text of the link, you can add an alternative name after the pipe "|" divider ({{ic|Shift}} + {{ic|\}} on English-layout and similar keyboards).<br />
<br />
For example:<br />
<br />
The <nowiki>[[ArchWiki:About|ArchWiki]]</nowiki> is the primary documentation source for Arch Linux. <br />
<br />
...is rendered as:<br />
<br />
:The [[ArchWiki:About|ArchWiki]] is the primary documentation source for Arch Linux.<br />
<br />
When you want to use the plural of an article title (or add any other suffix) for your link, you can add the extra letters directly outside the double square brackets.<br />
<br />
For example:<br />
<br />
makepkg is used in conjunction with <nowiki>[[PKGBUILD]]s</nowiki>.<br />
<br />
...is rendered as:<br />
<br />
:makepkg is used in conjunction with [[PKGBUILD]]s.<br />
<br />
==== Links to sections of a document ====<br />
<br />
To create a link to a section of a document, simply add a {{ic|#}} followed by the section's heading.<br />
<br />
For example:<br />
<br />
<nowiki>[[Help:Editing#Links to sections of a document]]</nowiki><br />
<br />
...is rendered as:<br />
<br />
:[[Help:Editing#Links to sections of a document]]<br />
<br />
{{Tip|If linking to a section within the same page, the page name can be omitted (e.g. {{ic|<nowiki>[[#Links to sections of a document]]</nowiki>}}). Do not needlessly reformat same-page section links to hide the anchor symbol (e.g. {{ic|<nowiki>[[#Links to sections of a document|Links to sections of a document]]</nowiki>}}).}}<br />
<br />
==== Pipe trick ====<br />
<br />
In some cases, it is possible to use the [[wikipedia:Help:Pipe trick|pipe trick]] to save writing the label of wiki links. The most important cases usable on ArchWiki are:<br />
<br />
# In article titles, it allows to hide the language suffix. For example, {{ic|<nowiki>[[Main Page (Česky)|]]</nowiki>}} is turned into [[Main Page (Česky)|Main Page]].<br />
# In links to different namespace or wiki, the pipe trick hides the prefix. For example, {{ic|<nowiki>[[ArchWiki:About|]]</nowiki>}} is turned into [[ArchWiki:About|About]] and {{ic|<nowiki>[[wikipedia:Help:Pipe trick|]]</nowiki>}} is turned into [[wikipedia:Help:Pipe trick|Help:Pipe trick]].<br />
<br />
When the page is saved, the pipe trick will automatically generate the alternative text for the link and change the wikitext accordingly.<br />
<br />
=== Interlanguage links ===<br />
<br />
See [[Help:i18n#Interlanguage links]]<br />
<br />
=== Interwiki links ===<br />
<br />
So-called ''interwiki links'' can be used to easily link to articles in other external Wikis, like Wikipedia for example. The syntax for this link type is the wiki name followed by a colon and the article you want to link to enclosed in double square brackets.<br />
<br />
If you want to create link to the [[Wikipedia:Arch Linux]] article you can use the following:<br />
<br />
<nowiki>[[Wikipedia:Arch Linux]]</nowiki><br />
<br />
Or you can create a piped link with an alternate link label to the [[Wikipedia:Arch Linux|Arch Linux Wikipedia article]]:<br />
<br />
<nowiki>[[Wikipedia:Arch Linux|Arch Linux Wikipedia article]]</nowiki><br />
<br />
{{Note|Using a piped link with an alternative link label should be reserved for abbreviating longer URLs.}}<br />
<br />
See: [[Wikipedia:Interwiki links]]<br />
<br />
The list of all interwiki links working on ArchWiki can be viewed [https://wiki.archlinux.org/api.php?action=query&meta=siteinfo&siprop=interwikimap here].<br />
<br />
{{Tip|By default, all interwiki links to pages in Wikipedia are considered as a links to English pages. If you want to create a link to a page on some other language, you should add language prefix to the name of page. For example, to create a link to Russian page, prefix its name with {{ic|ru}}:<br />
<br />
<nowiki>[[Wikipedia:ru:Arch Linux]]</nowiki><br />
<br />
result: [[Wikipedia:ru:Arch Linux]].<br />
<br />
Note that it depends on the [[ArchWiki_talk:Administrators#Interwiki|interwiki configuration]] for the target wiki, so it does not work on every wiki. It works for Wikipedia though.}}<br />
<br />
=== External links ===<br />
<br />
If you want to link to an external site, just type the full URL for the page you want to link to.<br />
<br />
<nowiki>http://www.google.com/</nowiki><br />
<br />
It is often more useful to make the link display something other than the URL, so use one square bracket at each end, with the alternative title after the address separated by a '''space''' (''not'' a pipe). So if you want the link to appear as [http://www.google.com/ Google search engine], just type:<br />
<br />
<nowiki>[http://www.google.com/ Google search engine]</nowiki><br />
<br />
{{Note|If linking to another ArchWiki or Wikipedia page, '''use [[#Internal links]] or [[#Interwiki links]] rather than external links!''' That is, if your link starts with https://wiki.archlinux.org/ '''use an internal link;''' if your link starts with http://en.wikipedia.org/ '''use an interwiki link!'''}}<br />
<br />
== Redirects ==<br />
<br />
{{Expansion|Should be split into subsections to clearly describe 1) what is a redirect, 2) when to redirect a page, 3) how to redirect a page.}}<br />
<br />
To redirect automatically from one page to another, add {{ic|<nowiki>#REDIRECT</nowiki>}} and an internal link to the page to be redirected to at the beginning of a page. <br />
<br />
For example, you could redirect from "Cats" to "Cat":<br />
<br />
<nowiki>#REDIRECT [[Cat]]</nowiki><br />
<br />
Thus, anyone typing either version in the search box will automatically go to "Cat".<br />
<br />
Note that redirects are resolved internally by the server and will not make it any slower to open an article.<br />
<br />
See also [[Help:Procedures#Deal with talk pages after redirecting a page to another]].<br />
<br />
Note that redirecting an existing page to another can create [[Special:DoubleRedirects|double redirects]]: see [[Help:Procedures#Fix double redirects]] for fixing them.<br />
<br />
== Wiki variables, magic words, and templates ==<br />
<br />
MediaWiki recognizes certain special strings within an article that alter standard behavior. For example, adding the word {{ic|<nowiki>__NOTOC__</nowiki>}} anywhere in an article will prevent generation of a table of contents. Similarly, the word {{ic|<nowiki>__TOC__</nowiki>}} can be used to alter the default position of the table of contents. See [[mw:Help:Magic words|Help:Magic words]] for details.<br />
<br />
Templates and variables are predefined portions of wikitext that can be inserted into an article to aid in formatting content. <br />
<br />
[[mw:Help:Magic_words#Variables|Variables]] are defined by the system and can be used to display information about the current page, wiki, or date. For example, use {{ic|<nowiki>{{SITENAME}}</nowiki>}} to display the wiki's site name (here it displayed as "{{SITENAME}}"). To set an alternate title header for the current page, another wiki variable can be used: {{ic|<nowiki>{{DISPLAYTITLE:New Title}}</nowiki>}}. (But it's very restricted: you are only allowed to change first letter to lowercase and replace spaces with underscores — normalized title string must match with real page name, otherwise it will not work; use {{ic|<nowiki>{{Lowercase title}}</nowiki>}} template to display first letter of title in lower case).<br />
<br />
Templates, on the other hand, are user-defined. The content of ''any'' page can be included in another page by adding {{ic|<nowiki>{{Namespace:Page Name}}</nowiki>}} to an article, but this is rarely used with pages outside the ''Template'' namespace. (If the namespace is omitted, ''Template'' is assumed.) For example, [[Template:Note]], which can be included in an article with the following wikitext:<br />
<br />
<nowiki>{{Note|This is a note.}}</nowiki><br />
<br />
...is rendered as:<br />
<br />
{{Note|This is a note.}}<br />
<br />
See [[Help:Template]] for more information.</div>AraaXhttps://wiki.archlinux.org/index.php?title=Systemd&diff=409814Systemd2015-11-22T10:06:26Z<p>AraaX: Adding فارسی interlanguage</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
[[ar:Systemd]]<br />
[[de:Systemd]]<br />
[[el:Systemd]]<br />
[[es:Systemd]]<br />
[[fa:Systemd]]<br />
[[fr:Systemd]]<br />
[[it:Systemd]]<br />
[[ja:Systemd]]<br />
[[pt:Systemd]]<br />
[[ru:Systemd]]<br />
[[zh-CN:Systemd]]<br />
[[zh-TW:Systemd]]<br />
{{Related articles start}}<br />
{{Related|systemd/User}}<br />
{{Related|systemd/Timers}}<br />
{{Related|systemd FAQ}}<br />
{{Related|init}}<br />
{{Related|init Rosetta}}<br />
{{Related|Daemons#List of daemons}}<br />
{{Related|udev}}<br />
{{Related|Improve boot performance}}<br />
{{Related|Allow users to shutdown}}<br />
{{Related articles end}}<br />
<br />
From the [http://freedesktop.org/wiki/Software/systemd project web page]:<br />
<br />
:''systemd'' is a system and service manager for Linux, compatible with SysV and LSB init scripts. systemd provides aggressive parallelization capabilities, uses socket and [[D-Bus]] activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux [[control groups]], supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic.<br />
<br />
{{Note|1=For a detailed explanation as to why Arch has moved to ''systemd'', see [https://bbs.archlinux.org/viewtopic.php?pid=1149530#p1149530 this forum post].}}<br />
<br />
== Basic systemctl usage ==<br />
<br />
The main command used to introspect and control ''systemd'' is ''systemctl''. Some of its uses are examining the system state and managing the system and services. See {{ic|man 1 systemctl}} for more details.<br />
<br />
{{Tip|<br />
* You can use all of the following ''systemctl'' commands with the {{ic|-H ''user''@''host''}} switch to control a ''systemd'' instance on a remote machine. This will use [[SSH]] to connect to the remote ''systemd'' instance.<br />
* ''systemadm'' is the official graphical frontend for ''systemctl''. It is provided by {{Pkg|systemd-ui}} from the [[official repositories]] or by {{AUR|systemd-ui-git}}{{Broken package link|{{aur-mirror|systemd-ui-git}}}} from the [[AUR]] for the development version.}}<br />
<br />
=== Analyzing the system state ===<br />
<br />
'''List running''' units:<br />
<br />
$ systemctl<br />
<br />
or:<br />
<br />
$ systemctl list-units<br />
<br />
'''List failed''' units:<br />
<br />
$ systemctl --failed<br />
<br />
The available unit files can be seen in {{ic|/usr/lib/systemd/system/}} and {{ic|/etc/systemd/system/}} (the latter takes precedence). '''List installed''' unit files with:<br />
<br />
$ systemctl list-unit-files<br />
<br />
=== Using units ===<br />
<br />
Units can be, for example, services (''.service''), mount points (''.mount''), devices (''.device'') or sockets (''.socket'').<br />
<br />
When using ''systemctl'', you generally have to specify the complete name of the unit file, including its suffix, for example {{ic|sshd.socket}}. There are however a few short forms when specifying the unit in the following ''systemctl'' commands:<br />
<br />
* If you do not specify the suffix, systemctl will assume ''.service''. For example, {{ic|netctl}} and {{ic|netctl.service}} are equivalent.<br />
* Mount points will automatically be translated into the appropriate ''.mount'' unit. For example, specifying {{ic|/home}} is equivalent to {{ic|home.mount}}.<br />
* Similar to mount points, devices are automatically translated into the appropriate ''.device'' unit, therefore specifying {{ic|/dev/sda2}} is equivalent to {{ic|dev-sda2.device}}.<br />
<br />
See {{ic|man systemd.unit}} for details.<br />
<br />
{{Note|Some unit names contain an {{ic|@}} sign (e.g. {{ic|name@''string''.service}}): this means that they are [http://0pointer.de/blog/projects/instances.html instances] of a ''template'' unit, whose actual file name does not contain the {{ic|''string''}} part (e.g. {{ic|name@.service}}). {{ic|''string''}} is called the ''instance identifier'', and is similar to an argument that is passed to the template unit when called with the ''systemctl'' command: in the unit file it will substitute the {{ic|%i}} specifier. <br />
<br />
To be more accurate, ''before'' trying to instantiate the {{ic|name@.suffix}} template unit, ''systemd'' will actually look for a unit with the exact {{ic|name@string.suffix}} file name, although by convention such a "clash" happens rarely, i.e. most unit files containing an {{ic|@}} sign are meant to be templates. Also, if a template unit is called without an instance identifier, it will just fail, since the {{ic|%i}} specifier cannot be substituted.<br />
}}<br />
<br />
{{Tip|<br />
* Most of the following commands also work if multiple units are specified, see {{ic|man systemctl}} for more information.<br />
* Since [https://github.com/systemd/systemd/blob/master/NEWS#L323-L326 systemd 220], a {{ic|--now}} switch can be used in conjunction with {{ic|enable}}, {{ic|disable}} and {{ic|mask}} to respectively start or stop the unit all at once.<br />
* A package may offer units for different purposes. If you just installed a package, {{ic|pacman -Qql ''package'' <nowiki>|</nowiki> grep -Fe .service -e .socket}} can be used to check and find them.}}<br />
<br />
'''Start''' a unit immediately:<br />
<br />
# systemctl start ''unit''<br />
<br />
'''Stop''' a unit immediately:<br />
<br />
# systemctl stop ''unit''<br />
<br />
'''Restart''' a unit:<br />
<br />
# systemctl restart ''unit''<br />
<br />
Ask a unit to '''reload''' its configuration:<br />
<br />
# systemctl reload ''unit''<br />
<br />
Show the '''status''' of a unit, including whether it is running or not:<br />
<br />
$ systemctl status ''unit''<br />
<br />
'''Check''' whether a unit is already enabled or not:<br />
<br />
$ systemctl is-enabled ''unit''<br />
<br />
'''Enable''' a unit to be started on '''bootup''':<br />
<br />
# systemctl enable ''unit''<br />
<br />
'''Disable''' a unit to not start during bootup:<br />
<br />
# systemctl disable ''unit''<br />
<br />
'''Mask''' a unit to make it impossible to start it:<br />
<br />
# systemctl mask ''unit''<br />
<br />
'''Unmask''' a unit:<br />
<br />
# systemctl unmask ''unit''<br />
<br />
Show the '''manual page''' associated with a unit (this has to be supported by the unit file):<br />
<br />
$ systemctl help ''unit''<br />
<br />
Reload ''systemd'', scanning for '''new or changed units''':<br />
<br />
# systemctl daemon-reload<br />
<br />
=== Power management ===<br />
<br />
[[polkit]] is necessary for power management as an unprivileged user. If you are in a local ''systemd-logind'' user session and no other session is active, the following commands will work without root privileges. If not (for example, because another user is logged into a tty), ''systemd'' will automatically ask you for the root password.<br />
<br />
Shut down and reboot the system:<br />
<br />
$ systemctl reboot<br />
<br />
Shut down and power-off the system:<br />
<br />
$ systemctl poweroff<br />
<br />
Suspend the system:<br />
<br />
$ systemctl suspend<br />
<br />
Put the system into hibernation:<br />
<br />
$ systemctl hibernate<br />
<br />
Put the system into hybrid-sleep state (or suspend-to-both):<br />
<br />
$ systemctl hybrid-sleep<br />
<br />
== Writing unit files ==<br />
<br />
The syntax of ''systemd'''s [http://www.freedesktop.org/software/systemd/man/systemd.unit.html unit files] is inspired by XDG Desktop Entry Specification ''.desktop'' files, which are in turn inspired by Microsoft Windows ''.ini'' files. Unit files are loaded from two locations. From lowest to highest precedence they are:<br />
<br />
* {{ic|/usr/lib/systemd/system/}}: units provided by installed packages<br />
* {{ic|/etc/systemd/system/}}: units installed by the system administrator<br />
<br />
{{Note|<br />
* The load paths are completely different when running ''systemd'' in [[systemd/User#How it works|user mode]].<br />
* systemd unit names may only contain ASCII alphanumeric characters, underscores and periods. All other characters must be replaced by C-style "\x2d" escapes. See {{ic|man systemd.unit}} and {{ic|man systemd-escape}} for more information.}}<br />
<br />
Look at the units installed by your packages for examples, as well as the [http://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples annotated example section] of {{ic|man systemd.service}}.<br />
<br />
{{Tip|Comments prepended with {{ic|#}} may be used in unit-files as well, but only in new lines. Do not use end-line comments after ''systemd'' parameters or the unit will fail to activate.}}<br />
<br />
=== Handling dependencies ===<br />
<br />
With ''systemd'', dependencies can be resolved by designing the unit files correctly. The most typical case is that the unit ''A'' requires the unit ''B'' to be running before ''A'' is started. In that case add {{ic|1=Requires=''B''}} and {{ic|1=After=''B''}} to the {{ic|[Unit]}} section of ''A''. If the dependency is optional, add {{ic|1=Wants=''B''}} and {{ic|1=After=''B''}} instead. Note that {{ic|1=Wants=}} and {{ic|1=Requires=}} do not imply {{ic|1=After=}}, meaning that if {{ic|1=After=}} is not specified, the two units will be started in parallel.<br />
<br />
Dependencies are typically placed on services and not on targets. For example, {{ic|network.target}} is pulled in by whatever service configures your network interfaces, therefore ordering your custom unit after it is sufficient since {{ic|network.target}} is started anyway.<br />
<br />
=== Service types ===<br />
<br />
There are several different start-up types to consider when writing a custom service file. This is set with the {{ic|1=Type=}} parameter in the {{ic|[Service]}} section:<br />
<br />
* {{ic|1=Type=simple}} (default): ''systemd'' considers the service to be started up immediately. The process must not fork. Do not use this type if other services need to be ordered on this service, unless it is socket activated.<br />
* {{ic|1=Type=forking}}: ''systemd'' considers the service started up once the process forks and the parent has exited. For classic daemons use this type unless you know that it is not necessary. You should specify {{ic|1=PIDFile=}} as well so ''systemd'' can keep track of the main process.<br />
* {{ic|1=Type=oneshot}}: this is useful for scripts that do a single job and then exit. You may want to set {{ic|1=RemainAfterExit=yes}} as well so that ''systemd'' still considers the service as active after the process has exited.<br />
* {{ic|1=Type=notify}}: identical to {{ic|1=Type=simple}}, but with the stipulation that the daemon will send a signal to ''systemd'' when it is ready. The reference implementation for this notification is provided by ''libsystemd-daemon.so''.<br />
* {{ic|1=Type=dbus}}: the service is considered ready when the specified {{ic|BusName}} appears on DBus's system bus.<br />
* {{ic|1=Type=idle}}: ''systemd'' will delay execution of the service binary until all jobs are dispatched. Other than that behavior is very similar to {{ic|1=Type=simple}}. <br />
<br />
See the [http://www.freedesktop.org/software/systemd/man/systemd.service.html#Type= systemd.service(5)] man page for a more detailed explanation of the {{ic|Type}} values.<br />
<br />
=== Editing provided unit files ===<br />
<br />
There are two ways to edit a unit file provided by a package: replace the entire unit file with a new one or create drop-in snippets which are applied on top of the existing unit file. For both methods, you must reload the unit afterwards to apply your changes. This can be done either by editing the unit with {{ic|systemctl edit}} (which reloads the unit automatically) or by reloading all units with:<br />
<br />
# systemctl daemon-reload<br />
<br />
{{Tip|<br />
* You can use ''systemd-delta'' to see which unit files have been overridden or extended and what exactly has been changed.<br />
* Use {{ic|systemctl cat ''unit''}} to view the content of a unit file and all associated drop-in snippets.<br />
* Syntax highlighting for ''systemd'' unit files within [[Vim]] can be enabled by installing {{Pkg|vim-systemd}}.<br />
}}<br />
<br />
==== Replacement unit files ====<br />
<br />
To replace the unit file {{ic|/usr/lib/systemd/system/''unit''}}, create the file {{ic|/etc/systemd/system/''unit''}} and reenable the unit to update the symlinks:<br />
<br />
# systemctl reenable ''unit''<br />
<br />
Alternatively, run:<br />
<br />
# systemctl edit --full ''unit''<br />
<br />
This opens {{ic|/etc/systemd/system/''unit''}} in your editor (copying the installed version if it does not exist yet) and automatically reloads it when you finish editing.<br />
<br />
{{Note|Pacman does not update the replacement unit files when the originals are updated, so this method can make system maintenance more difficult. For this reason the next approach is recommended.}}<br />
<br />
==== Drop-in snippets ====<br />
<br />
To create drop-in snippets for the unit file {{ic|/usr/lib/systemd/system/''unit''}}, create the directory {{ic|/etc/systemd/system/''unit''.d/}} and place ''.conf'' files there to override or add new options. ''systemd'' will parse these ''.conf'' files and apply them on top of the original unit.<br />
<br />
The easiest way to do this is to run:<br />
<br />
# systemctl edit ''unit''<br />
<br />
This opens the file {{ic|/etc/systemd/system/''unit''.d/override.conf}} in your text editor (creating it if necessary) and automatically reloads the unit when you are done editing.<br />
<br />
==== Examples ====<br />
<br />
For example, if you simply want to add an additional dependency to a unit, you may create the following file:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/customdependency.conf|2=<br />
[Unit]<br />
Requires=''new dependency''<br />
After=''new dependency''<br />
}}<br />
<br />
As another example, in order to replace the {{ic|ExecStart}} directive for a unit that is not of type {{ic|oneshot}}, create the following file:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/customexec.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=''new command''<br />
}}<br />
<br />
Note how {{ic|ExecStart}} must be cleared before being re-assigned ([https://bugzilla.redhat.com/show_bug.cgi?id=756787#c9]).<br />
<br />
One more example to automatically restart a service:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/restart.conf|2=<br />
[Service]<br />
Restart=always<br />
RestartSec=30<br />
}}<br />
<br />
== Targets ==<br />
<br />
{{Style|Unclear description, copy-pasted content (explicitly mentions "Fedora").|section=Make section "Targets" more clearly}}<br />
<br />
''systemd'' uses ''targets'' which serve a similar purpose as runlevels but act a little different. Each ''target'' is named instead of numbered and is intended to serve a specific purpose with the possibility of having multiple ones active at the same time. Some ''target''s are implemented by inheriting all of the services of another ''target'' and adding additional services to it. There are ''systemd'' ''target''s that mimic the common SystemVinit runlevels so you can still switch ''target''s using the familiar {{ic|telinit RUNLEVEL}} command.<br />
<br />
=== Get current targets ===<br />
<br />
The following should be used under ''systemd'' instead of running {{ic|runlevel}}:<br />
<br />
$ systemctl list-units --type=target<br />
<br />
=== Create custom target ===<br />
<br />
The runlevels that are assigned a specific purpose on vanilla Fedora installs; 0, 1, 3, 5, and 6; have a 1:1 mapping with a specific ''systemd'' ''target''. Unfortunately, there is no good way to do the same for the user-defined runlevels like 2 and 4. If you make use of those it is suggested that you make a new named ''systemd'' ''target'' as {{ic|/etc/systemd/system/''your target''}} that takes one of the existing runlevels as a base (you can look at {{ic|/usr/lib/systemd/system/graphical.target}} as an example), make a directory {{ic|/etc/systemd/system/''your target''.wants}}, and then symlink the additional services from {{ic|/usr/lib/systemd/system/}} that you wish to enable.<br />
<br />
=== Targets table ===<br />
<br />
{| class="wikitable"<br />
! SysV Runlevel !! systemd Target !! Notes<br />
|-<br />
| 0 || runlevel0.target, poweroff.target || Halt the system.<br />
|-<br />
| 1, s, single || runlevel1.target, rescue.target || Single user mode.<br />
|-<br />
| 2, 4 || runlevel2.target, runlevel4.target, multi-user.target || User-defined/Site-specific runlevels. By default, identical to 3.<br />
|-<br />
| 3 || runlevel3.target, multi-user.target || Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.<br />
|-<br />
| 5 || runlevel5.target, graphical.target || Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.<br />
|-<br />
| 6 || runlevel6.target, reboot.target || Reboot<br />
|-<br />
| emergency || emergency.target || Emergency shell<br />
|-<br />
|}<br />
<br />
=== Change current target ===<br />
<br />
In ''systemd'' targets are exposed via ''target units''. You can change them like this:<br />
<br />
# systemctl isolate graphical.target<br />
<br />
This will only change the current target, and has no effect on the next boot. This is equivalent to commands such as {{ic|telinit 3}} or {{ic|telinit 5}} in Sysvinit.<br />
<br />
=== Change default target to boot into ===<br />
<br />
The standard target is {{ic|default.target}}, which is aliased by default to {{ic|graphical.target}} (which roughly corresponds to the old runlevel 5). To change the default target at boot-time, append one of the following [[kernel parameters]] to your bootloader:<br />
<br />
* {{ic|1=systemd.unit=multi-user.target}} (which roughly corresponds to the old runlevel 3),<br />
* {{ic|1=systemd.unit=rescue.target}} (which roughly corresponds to the old runlevel 1).<br />
<br />
Alternatively, you may leave the bootloader alone and change {{ic|default.target}}. This can be done using ''systemctl'':<br />
<br />
# systemctl set-default multi-user.target<br />
<br />
To be able to override the previously set {{ic|default.target}}, use the force option:<br />
<br />
# systemctl set-default -f multi-user.target<br />
<br />
The effect of this command is output by ''systemctl''; a symlink to the new default target is made at {{ic|/etc/systemd/system/default.target}}.<br />
<br />
== Temporary files ==<br />
<br />
"''systemd-tmpfiles'' creates, deletes and cleans up volatile and temporary files and directories." It reads configuration files in {{ic|/etc/tmpfiles.d/}} and {{ic|/usr/lib/tmpfiles.d/}} to discover which actions to perform. Configuration files in the former directory take precedence over those in the latter directory.<br />
<br />
Configuration files are usually provided together with service files, and they are named in the style of {{ic|/usr/lib/tmpfiles.d/''program''.conf}}. For example, the [[Samba]] daemon expects the directory {{ic|/run/samba}} to exist and to have the correct permissions. Therefore, the {{Pkg|samba}} package ships with this configuration:<br />
<br />
{{hc|/usr/lib/tmpfiles.d/samba.conf|<br />
D /run/samba 0755 root root}}<br />
<br />
Configuration files may also be used to write values into certain files on boot. For example, if you used {{ic|/etc/rc.local}} to disable wakeup from USB devices with {{ic|echo USBE > /proc/acpi/wakeup}}, you may use the following tmpfile instead:<br />
<br />
{{hc|/etc/tmpfiles.d/disable-usb-wake.conf|<br />
w /proc/acpi/wakeup - - - - USBE}}<br />
<br />
See the {{ic|systemd-tmpfiles(8)}} and {{ic|tmpfiles.d(5)}} man pages for details.<br />
<br />
{{Note|This method may not work to set options in {{ic|/sys}} since the ''systemd-tmpfiles-setup'' service may run before the appropriate device modules is loaded. In this case you could check whether the module has a parameter for the option you want to set with {{ic|modinfo ''module''}} and set this option with a [[Kernel modules#Setting module options|config file in /etc/modprobe.d]]. Otherwise you will have to write a [[Udev#About_udev_rules|udev rule]] to set the appropriate attribute as soon as the device appears.}}<br />
<br />
== Timers ==<br />
<br />
A timer is a unit configuration file whose name ends with ''.timer'' and encodes information about a timer controlled and supervised by ''systemd'', for timer-based activation. See [[systemd/Timers]].<br />
<br />
{{Note|Timers can replace ''cron'' functionality to a great extent. See [[systemd/Timers#As a cron replacement]].}}<br />
<br />
== Journal ==<br />
<br />
''systemd'' has its own logging system called the journal; therefore, running a {{ic|syslog}} daemon is no longer required. To read the log, use:<br />
<br />
# journalctl<br />
<br />
In Arch Linux, the directory {{ic|/var/log/journal/}} is a part of the {{Pkg|systemd}} package, and the journal (when {{ic|1=Storage=}} is set to {{ic|auto}} in {{ic|/etc/systemd/journald.conf}}) will write to {{ic|/var/log/journal/}}. If you or some program delete that directory, ''systemd'' will '''not''' recreate it automatically and instead will write its logs to {{ic|/run/systemd/journal}} in a nonpersistent way. However, the folder will be recreated when you set {{ic|1=Storage=persistent}} and run {{ic|systemctl restart systemd-journald}} (or reboot).<br />
<br />
=== Filtering output ===<br />
<br />
''journalctl'' allows you to filter the output by specific fields. Be aware that if there are many messages to display or filtering of large time span has to be done, the output of this command can be delayed for quite some time.<br />
<br />
{{Tip|While the journal is stored in a binary format, the content of stored messages is not modified. This means it is viewable with ''strings'', for example for recovery in an environment which does not have ''systemd'' installed. Example command:<br />
{{bc|$ strings /mnt/arch/var/log/journal/af4967d77fba44c6b093d0e9862f6ddd/system.journal <nowiki>| grep -i</nowiki> ''message''}}<br />
}}<br />
<br />
Examples:<br />
<br />
* Show all messages from this boot: {{bc|# journalctl -b}} However, often one is interested in messages not from the current, but from the previous boot (e.g. if an unrecoverable system crash happened). This is possible through optional offset parameter of the {{ic|-b}} flag: {{ic|journalctl -b -0}} shows messages from the current boot, {{ic|journalctl -b -1}} from the previous boot, {{ic|journalctl -b -2}} from the second previous and so on. See {{ic|man 1 journalctl}} for full description, the semantics is much more powerful.<br />
* Show all messages from date (and optional time): {{bc|1=# journalctl --since="2012-10-30 18:17:16"}}<br />
* Show all messages since 20 minutes ago: {{bc|1=# journalctl --since "20 min ago"}}<br />
* Follow new messages: {{bc|# journalctl -f}}<br />
* Show all messages by a specific executable: {{bc|# journalctl /usr/lib/systemd/systemd}}<br />
* Show all messages by a specific process: {{bc|1=# journalctl _PID=1}}<br />
* Show all messages by a specific unit: {{bc|# journalctl -u netcfg}}<br />
* Show kernel ring buffer: {{bc|1=# journalctl -k}}<br />
* Show auth.log equivalent by filtering on syslog facility: {{bc|1=# journalctl -f -l SYSLOG_FACILITY=10}}<br />
<br />
See {{ic|man 1 journalctl}}, {{ic|man 7 systemd.journal-fields}}, or Lennart's [http://0pointer.de/blog/projects/journalctl.html blog post] for details.<br />
<br />
{{Tip|1=<br />
By default, ''journalctl'' truncates lines longer than screen width, but in some cases, it may be better to enable wrapping instead of truncating. This can be controlled by the {{ic|SYSTEMD_LESS}} [[environment variable]], which contains options passed to [[Core utilities#less|less]] (the default pager) and defaults to {{ic|FRSXMK}} (see {{ic|man 1 less}} and {{ic|man 1 journalctl}} for details).<br />
<br />
By omitting the {{ic|S}} option, the output will be wrapped instead of truncated. For example, start ''journalctl'' as follows:<br />
<br />
$ SYSTEMD_LESS=FRXMK journalctl<br />
<br />
If you would like to set this behaviour as default, [[Environment variables#Per_user|export]] the variable from {{ic|~/.bashrc}} or {{ic|~/.zshrc}}.<br />
}}<br />
<br />
=== Journal size limit ===<br />
<br />
If the journal is persistent (non-volatile), its size limit is set to a default value of 10% of the size of the respective file system. For example, with {{ic|/var/log/journal}} located on a 50 GiB root partition this would lead to 5 GiB of journal data. The maximum size of the persistent journal can be controlled by uncommenting and changing the following:<br />
<br />
{{hc|/etc/systemd/journald.conf|2=<br />
SystemMaxUse=50M<br />
}}<br />
<br />
Refer to {{ic|man journald.conf}} for more info.<br />
<br />
=== Clean journal files manually ===<br />
<br />
The journal files are located under {{ic|/var/log/journal}}, {{ic|rm}} will do the work.<br />
Or, use {{ic|journalctl}},<br />
<br />
Examples:<br />
<br />
* Remove archived journal files until the disk space they use falls below 100M: {{bc|1=# journalctl --vacuum-size=100M}}<br />
* Make all journal files contain no data older than 2 weeks. {{bc|1=# journalctl --vacuum-time=2weeks}}<br />
<br />
Refer to {{ic|man journalctl}} for more info.<br />
<br />
=== Journald in conjunction with syslog ===<br />
<br />
Compatibility with a classic, non-journald aware [[Syslog-ng|syslog]] implementation can be provided by letting ''systemd'' forward all messages via the socket {{ic|/run/systemd/journal/syslog}}. To make the syslog daemon work with the journal, it has to bind to this socket instead of {{ic|/dev/log}} ([http://lwn.net/Articles/474968/ official announcement]). <br />
<br />
As of ''systemd'' 216 the default {{ic|journald.conf}} for forwarding to the socket was changed to {{ic|1=ForwardToSyslog=no}} to avoid system overhead, because [[rsyslog]] or [[syslog-ng]] (since 3.6) pull the messages from the journal by [http://lists.freedesktop.org/archives/systemd-devel/2014-August/022295.html#journald itself]. <br />
<br />
See [[Syslog-ng#Overview]] and [[Syslog-ng#syslog-ng and systemd journal]], or [[rsyslog]] respectively, for details on configuration.<br />
<br />
=== Forward journald to /dev/tty12 ===<br />
<br />
Create a [[#Editing_provided_unit_files|drop-in directory]] {{ic|/etc/systemd/journald.conf.d}} and create a {{ic|fw-tty12.conf}} file in it:<br />
<br />
{{hc|1=/etc/systemd/journald.conf.d/fw-tty12.conf|2=<br />
[Journal]<br />
ForwardToConsole=yes<br />
TTYPath=/dev/tty12<br />
MaxLevelConsole=info<br />
}}<br />
<br />
Then [[restart]] systemd-journald.<br />
<br />
=== Specify a different journal to view ===<br />
There may be a need to check the logs of another system that is dead in the water, like booting from a live system to recover a production system. In such case, one can mount the disk in e.g. {{ic|/mnt}}, and specify the journal path via {{ic|-D}}/{{ic|--directory}}, like so:<br />
<br />
$ journalctl -D ''/mnt''/var/log/journal -xe<br />
<br />
== Troubleshooting ==<br />
<br />
=== Investigating systemd errors ===<br />
<br />
As an example, we will investigate an error with {{ic|systemd-modules-load}} service:<br />
<br />
'''1.''' Lets find the ''systemd'' services which fail to start:<br />
<br />
{{hc|1=$ systemctl --failed|2=<br />
systemd-modules-load.service loaded '''failed failed''' Load Kernel Modules<br />
}}<br />
<br />
'''2.''' Ok, we found a problem with {{ic|systemd-modules-load}} service. We want to know more:<br />
{{hc|$ systemctl status systemd-modules-load|2=<br />
systemd-modules-load.service - Load Kernel Modules<br />
Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)<br />
Active: '''failed''' (Result: exit-code) since So 2013-08-25 11:48:13 CEST; 32s ago<br />
Docs: man:systemd-modules-load.service(8).<br />
man:modules-load.d(5)<br />
Process: '''15630''' ExecStart=/usr/lib/systemd/systemd-modules-load ('''code=exited, status=1/FAILURE''')<br />
}}<br />
If the {{ic|Process ID}} is not listed, just restart the failed service with {{ic|systemctl restart systemd-modules-load}}<br />
<br />
'''3.''' Now we have the process id (PID) to investigate this error in depth. Enter the following command with the current {{ic|Process ID}} (here: 15630):<br />
{{hc|1=$ journalctl _PID=15630|2=<br />
-- Logs begin at Sa 2013-05-25 10:31:12 CEST, end at So 2013-08-25 11:51:17 CEST. --<br />
Aug 25 11:48:13 mypc systemd-modules-load[15630]: '''Failed to find module 'blacklist usblp''''<br />
Aug 25 11:48:13 mypc systemd-modules-load[15630]: '''Failed to find module 'install usblp /bin/false'''' <br />
}}<br />
<br />
'''4.''' We see that some of the kernel module configs have wrong settings. Therefore we have a look at these settings in {{ic|/etc/modules-load.d/}}:<br />
{{hc|$ ls -Al /etc/modules-load.d/|<br />
...<br />
-rw-r--r-- 1 root root 79 1. Dez 2012 blacklist.conf<br />
-rw-r--r-- 1 root root 1 2. Mär 14:30 encrypt.conf<br />
-rw-r--r-- 1 root root 3 5. Dez 2012 printing.conf<br />
-rw-r--r-- 1 root root 6 14. Jul 11:01 realtek.conf<br />
-rw-r--r-- 1 root root 65 2. Jun 23:01 virtualbox.conf<br />
...<br />
}}<br />
<br />
'''5.''' The {{ic|Failed to find module 'blacklist usblp'}} error message might be related to a wrong setting inside of {{ic|blacklist.conf}}. Lets deactivate it with inserting a trailing '''#''' before each option we found via step 3:<br />
{{hc|/etc/modules-load.d/blacklist.conf|<br />
'''#''' blacklist usblp<br />
'''#''' install usblp /bin/false<br />
}}<br />
<br />
'''6.''' Now, try to start {{ic|systemd-modules-load}}:<br />
$ systemctl start systemd-modules-load<br />
If it was successful, this should not prompt anything. If you see any error, go back to step 3 and use the new PID for solving the errors left.<br />
<br />
If everything is ok, you can verify that the service was started successfully with:<br />
{{hc|$ systemctl status systemd-modules-load|2=<br />
systemd-modules-load.service - Load Kernel Modules<br />
Loaded: '''loaded''' (/usr/lib/systemd/system/systemd-modules-load.service; static)<br />
Active: '''active (exited)''' since So 2013-08-25 12:22:31 CEST; 34s ago<br />
Docs: man:systemd-modules-load.service(8)<br />
man:modules-load.d(5)<br />
Process: 19005 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS)<br />
Aug 25 12:22:31 mypc systemd[1]: '''Started Load Kernel Modules'''.<br />
}}<br />
<br />
Often you can solve these kind of problems like shown above. For further investigation look at [[#Diagnosing boot problems]].<br />
<br />
=== Diagnosing boot problems ===<br />
<br />
{{Merge|Boot debugging}}<br />
<br />
Boot with these parameters on the kernel command line:<br />
{{ic|<nowiki>systemd.log_level=debug systemd.log_target=kmsg log_buf_len=1M</nowiki>}}<br />
<br />
[http://freedesktop.org/wiki/Software/systemd/Debugging More Debugging Information].<br />
<br />
==== Boot to rescue mode ====<br />
Assuming that it is possible to change the kernel command line before actually starting the system, you can resolve many boot and service configuration issues by adding the number {{ic|1}} to the end of the arguments. This pauses normal startup and breaks into a shell shortly after the root filesystem has been remounted read/write. When you are finished, you can {{ic|exit}} the shell as you normally would, and the system should resume starting up.<br />
<br />
==== Boot to emergency mode ====<br />
If rescue mode interrupts the boot at too late a time to be useful, you can start the system in emergency mode. To accomplish this, append {{ic|emergency}} to the kernel command line before booting. This will provide a shell after the initramfs is finished running, but before the root is remounted as read/write, and before most other file systems are mounted. As with rescue mode, once you are finished troubleshooting you can exit the shell to continue normal boot.<br />
<br />
==== Debug shell ====<br />
If the boot process fails in such a way as to not provide a workable shell, systemd comes with a service file called {{ic|debug-shell.service}} which you can enable to get a root shell on {{ic|tty9}} (switch there by pressing Ctrl+Alt+F9). '''Note that leaving this functionality enabled for a lengthy period of time is a serious security risk, because any person with access to the keyboard and terminal can switch to that VT and get an unrestricted root shell!'''<br />
<br />
=== Diagnosing problems with a specific service ===<br />
<br />
{{Accuracy|This may not catch all errors such as missing libraries.|User talk:Alucryd#Plex}}<br />
<br />
If some ''systemd'' service misbehaves and you want to get more information about what is going on, set the {{ic|SYSTEMD_LOG_LEVEL}} [[environment variable]] to {{ic|debug}}. For example, to run the ''systemd-networkd'' daemon in debug mode:<br />
<br />
# systemctl stop systemd-networkd<br />
# SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd<br />
<br />
Or, equivalently, modify the service file temporarily for gathering enough output. For example: <br />
<br />
{{hc|/usr/lib/systemd/system/systemd-networkd.service|2=<br />
[Service]<br />
...<br />
Environment=SYSTEMD_LOG_LEVEL=debug<br />
....<br />
}}<br />
<br />
If debug information is required long-term, add the variable the [[#Editing provided unit files|regular]] way.<br />
<br />
=== Shutdown/reboot takes terribly long ===<br />
<br />
If the shutdown process takes a very long time (or seems to freeze) most likely a service not exiting is to blame. ''systemd'' waits some time for each service to exit before trying to kill it. To find out if you are affected, see [http://freedesktop.org/wiki/Software/systemd/Debugging/#shutdowncompleteseventually this article].<br />
<br />
=== Short lived processes do not seem to log any output ===<br />
<br />
If {{ic|journalctl -u foounit}} does not show any output for a short lived service, look at the PID instead. For example, if {{ic|systemd-modules-load.service}} fails, and {{ic|systemctl status systemd-modules-load}} shows that it ran as PID 123, then you might be able to see output in the journal for that PID, i.e. {{ic|journalctl -b _PID&#61;123}}. Metadata fields for the journal such as {{ic|_SYSTEMD_UNIT}} and {{ic|_COMM}} are collected asynchronously and rely on the {{ic|/proc}} directory for the process existing. Fixing this requires fixing the kernel to provide this data via a socket connection, similar to {{ic|SCM_CREDENTIALS}}.<br />
<br />
=== Disabling application crash dumps journaling ===<br />
<br />
Edit the file {{ic|/etc/systemd/coredump.conf}} by adding this line:<br />
<br />
Storage=none<br />
<br />
and run:<br />
<br />
# systemctl daemon-reload<br />
<br />
to reload the configuration.<br />
<br />
=== Error message on reboot or shutdown ===<br />
<br />
==== cgroup : option or name mismatch, new: 0x0 "", old: 0x4 "systemd" ====<br />
<br />
See [https://bbs.archlinux.org/viewtopic.php?pid=1372562#p1372562 this thread] for an explanation.<br />
<br />
==== watchdog watchdog0: watchdog did not stop! ====<br />
<br />
See [https://bbs.archlinux.org/viewtopic.php?pid=1372562#p1372562 this thread] for an explanation.<br />
<br />
=== Boot time increasing over time ===<br />
<br />
After using {{ic|systemd-analyze}} a number of users have noticed that their boot time has increased significantly in comparison with what it used to be. After using {{ic|systemd-analyze blame}} [[NetworkManager]] is being reported as taking an unusually large amount of time to start. <br />
<br />
The problem for some users has been due to {{ic|/var/log/journal}} becoming too large. This may have other impacts on performance, such as for {{ic|systemctl status}} or {{ic|journalctl}}. As such the solution is to remove every file within the folder (ideally making a backup of it somewhere, at least temporarily) and then setting a journal file size limit as described in [[#Journal size limit]].<br />
<br />
=== systemd-tmpfiles-setup.service fails to start at boot ===<br />
<br />
Starting with systemd 219, {{ic|/usr/lib/tmpfiles.d/systemd.conf}} specifies ACL attributes for directories under {{ic|/var/log/journal}} and, therefore, requires ACL support to be enabled for the filesystem the journal resides on.<br />
<br />
See [[Access Control Lists#Enabling ACL]] for instructions on how to enable ACL on the filesystem that houses {{ic|/var/log/journal}}.<br />
<br />
== See also ==<br />
<br />
*[http://www.freedesktop.org/wiki/Software/systemd Official web site]<br />
*[[Wikipedia:systemd|Wikipedia article]]<br />
*[http://0pointer.de/public/systemd-man/ Manual pages]<br />
*[http://freedesktop.org/wiki/Software/systemd/Optimizations systemd optimizations]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions FAQ]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/TipsAndTricks Tips and tricks]<br />
*[http://0pointer.de/public/systemd-ebook-psankar.pdf systemd for Administrators (PDF)]<br />
*[http://fedoraproject.org/wiki/Systemd About systemd on Fedora Project]<br />
*[http://fedoraproject.org/wiki/How_to_debug_Systemd_problems How to debug systemd problems]<br />
*[http://www.h-online.com/open/features/Control-Centre-The-systemd-Linux-init-system-1565543.html Two] [http://www.h-online.com/open/features/Booting-up-Tools-and-tips-for-systemd-1570630.html part] introductory article in ''The H Open'' magazine.<br />
*[http://0pointer.de/blog/projects/systemd.html Lennart's blog story]<br />
*[http://0pointer.de/blog/projects/systemd-update.html Status update]<br />
*[http://0pointer.de/blog/projects/systemd-update-2.html Status update2]<br />
*[http://0pointer.de/blog/projects/systemd-update-3.html Status update3]<br />
*[http://0pointer.de/blog/projects/why.html Most recent summary]<br />
*[http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet Fedora's SysVinit to systemd cheatsheet]<br />
*[http://wiki.gentoo.org/wiki/Systemd Gentoo Wiki systemd page]<br />
*[[Emacs#Syntax highlighting for systemd Files|Emacs Syntax highlighting for Systemd files]]</div>AraaX