https://wiki.archlinux.org/api.php?action=feedcontributions&user=Sushi+Dude&feedformat=atomArchWiki - User contributions [en]2024-03-29T15:44:56ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Certbot&diff=440925Certbot2016-07-12T08:16:05Z<p>Sushi Dude: Change mention of SSL certificates to X.509 certificates.</p>
<hr />
<div>[[Category:Networking]]<br />
[[Category:Encryption]]<br />
[[ja:Let’s Encrypt]]<br />
[https://letsencrypt.org/ Let’s Encrypt] is a free, automated, and open certificate authority utilizing the [[Wikipedia:Automated Certificate Management Environment|ACME]] protocol.<br />
<br />
The official client is called '''Certbot''', which allows to request valid X.509 certificates straight from the command line.<br />
A minimal client with manual CSR creation is available at {{AUR|acme-tiny}}. More integrated clients suitable for scripts are e.g. {{AUR|simp_le-git}} and {{AUR|letsencrypt-cli}}.<br />
<br />
{{Note|The official client, which was previously called ''the Let’s Encrypt client'', is now called ''Certbot''.}}<br />
<br />
== Certbot ==<br />
<br />
''Certbot'', previously called ''the Let’s Encrypt client'', is the official reference client. It is written in Python and provides a command-line tool to obtain certificates.<br />
<br />
=== Installation ===<br />
<br />
[[Install]] the {{Pkg|certbot}} package.<br />
<br />
Plugins are available for automated configuration and installation of the issued certificates in web servers:<br />
* The experimental plugin for [[Nginx]] is provided with the {{Pkg|certbot-nginx}} package.<br />
* Although a package {{Pkg|certbot-apache}} exists, automated installation using the [[Apache HTTP Server]] is currently only supported on Debian and derivatives.<br />
<br />
=== Configuration ===<br />
<br />
Please consult the [https://certbot.eff.org/docs/ Certbot documentation] on how to create and install certificates.<br />
<br />
==== Manual ====<br />
<br />
{{Note|With this method, you must temporarily stop your web server. You can also run the verification through your already running web server with the [[#Webroot]] method.}}<br />
<br />
If there is no plugin for your web server, use the following command:<br />
# certbot certonly --manual<br />
<br />
This will automatically verify your domain and create a private key and certificate pair. These are placed in {{ic|/etc/letsencrypt/live/''your.domain''/}}.<br />
<br />
You can then manually configure your web server to use the key and certificate in that directory.<br />
<br />
==== Webroot ====<br />
<br />
The webroot method lets the client place a challenge response at {{ic|yourdomain.tld/.well-known/acme-challenge/}}.<br />
You can use it to get/renew certificates with a running webserver (e.g. Apache/nginx).<br />
# certbot certonly --email ''email@example.com'' --webroot -w ''/path/to/html/'' -d ''your.domain''<br />
<br />
Make sure the server configuration for the certificates points to {{ic|/etc/letsencrypt/live/''your.domain''/}}.<br />
<br />
===== Multiple domains =====<br />
<br />
If you use more than one domain or subdomains, the webroot has to be given for every domain. If no new webroot is given, the previous is taken.<br />
<br />
Management of this can be made much easier, if you map all http requests for {{ic|/.well-known/acme-challenge/}} to a single folder, e.g. {{ic|/var/lib/letsencrypt}}.<br />
For nginx you can achieve this by placing this location block within server blocks of sites you want to request certificates for:<br />
{{bc|<nowiki><br />
location /.well-known/acme-challenge {<br />
root /var/lib/letsencrypt;<br />
default_type "text/plain";<br />
try_files $uri =404;<br />
}<br />
</nowiki>}}<br />
For Apache you can achieve this by creating the file {{ic|httpd-acme.conf}}:<br />
{{hc|/etc/httpd/conf/extra/httpd-acme.conf|<nowiki><br />
Alias /.well-known/acme-challenge/ "/var/lib/letsencrypt/.well-known/acme-challenge/"<br />
<Directory "/var/lib/letsencrypt/"><br />
AllowOverride None<br />
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec<br />
Require method GET POST OPTIONS<br />
</Directory><br />
</nowiki>}}<br />
and including it in {{ic|httpd.conf}}:<br />
{{hc|/etc/httpd/conf/httpd.conf|<nowiki><br />
Include conf/extra/httpd-acme.conf<br />
</nowiki>}}<br />
The chosen path has then to be writable for the chosen letsencrypt client. It also has to be readable by the web server; you can achieve this thereby : {{ic|chgrp http /var/lib/letsencrypt && chmod g+s /var/lib/letsencrypt}}.<br />
<br />
===== Automatic renewal =====<br />
<br />
When running {{ic|certbot certonly}}, Cerbot stores the domains and webroot directories in {{ic|/etc/letsencrypt/renewal}}, so the certificates can be renewed later automatically by running {{ic|certbot renew}}.<br />
<br />
You can fully automate this by creating the following systemd service file:<br />
<br />
{{hc|1=/etc/systemd/system/certbot.service|<br />
2=[Unit]<br />
Description=Let's Encrypt renewal<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/certbot renew}}<br />
<br />
Before adding a [[systemd/Timers|timer]], check that the service is working correctly and is not trying to prompt anything.<br />
<br />
Then, you can add a timer to renew the certificates [https://letsencrypt.org/getting-started/#writing-your-own-renewal-script daily]. (The script will automatically skip certificates not due to renewal yet.)<br />
<br />
{{hc|1=/etc/systemd/system/certbot.timer|<br />
2=[Unit]<br />
Description=Daily renewal of Let's Encrypt's certificates<br />
<br />
[Timer]<br />
OnCalendar=daily<br />
Persistent=true<br />
<br />
[Install]<br />
WantedBy=timers.target}}<br />
<br />
[[Enable]] and [[start]] {{ic|certbot.timer}}.<br />
<br />
You'll probably want your web server to be restarted after each certificate renewal. You can realize that by adding one of these lines to the {{ic|certbot.service}} file:<br />
<br />
* Apache: {{ic|1=ExecStartPost=/bin/systemctl reload httpd.service}}<br />
* nginx: {{ic|1=ExecStartPost=/bin/systemctl reload nginx.service}}<br />
<br />
== See also ==<br />
<br />
* [https://github.com/certbot/certbot/wiki/Links#other-lets-encrypt--acme-clients List of ACME clients]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Mirrors&diff=432043Mirrors2016-04-21T07:23:58Z<p>Sushi Dude: /* Server-side ranking */ Add missing words.</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package management]]<br />
[[ar:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[it:Mirrors]]<br />
[[ja:ミラー]]<br />
[[ru:Mirrors]]<br />
[[zh-CN:Mirrors]]<br />
{{Related articles start}}<br />
{{Related|pacman}}<br />
{{Related articles end}}<br />
<br />
This page is a guide to selecting and configuring your mirrors, and a listing of current available mirrors.<br />
<br />
== Official mirrors ==<br />
<br />
The official Arch Linux mirror list is available from the {{pkg|pacman-mirrorlist}} package. To get an even more up-to-date list of mirrors, use the [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] page on the main site.<br />
<br />
Check the status of the Arch mirrors by visiting the [https://www.archlinux.org/mirrors/status/ Mirror Status] page. It is recommended to only use mirrors that are up to date, i.e. not out of sync.<br />
<br />
If you want your mirror to be added to the official list, see [[DeveloperWiki:NewMirrors]]. In the meantime, add it to the [[#Unofficial mirrors]] list at the end of this page.<br />
<br />
=== IPv6-ready mirrors ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/?ip_version=6 Pacman Mirrorlist Generator] can also be used to find a list of current IPv6 mirrors.<br />
<br />
== Enabling a specific mirror ==<br />
<br />
To enable mirrors, edit {{ic|/etc/pacman.d/mirrorlist}} and locate your geographic region. Uncomment mirrors you would like to use.<br />
<br />
Example:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
See [[#Sorting mirrors]] for tools that help choosing mirrors.<br />
<br />
{{Tip|<br />
* Uncomment 5 favorite mirrors and place them at the top of the mirrorlist file. That way it's easy to find them and move them around if the first mirror on the list has problems. It also makes merging mirrorlist updates easier.<br />
* HTTP mirrors are faster than FTP due to [[Wikipedia:HTTP persistent connection|persistent HTTP connection]]: with FTP, a new connection to server has to be established each time ''pacman'' requests a package to be downloaded, which results in a brief pause.<br />
}}<br />
<br />
It is also possible to specify mirrors in {{ic|/etc/pacman.conf}}. For the ''[core]'' repository, the default setup is:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
To use the ''HostEurope'' mirror as a default mirror, add it before the {{ic|Include}} line:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
pacman will now try to connect to this mirror first. Proceed to do the same for ''[testing]'', ''[extra]'', and ''[community]'', if applicable.<br />
<br />
{{Note|If mirrors have been stated directly in {{ic|pacman.conf}}, remember to use the same mirror for all repositories. Otherwise packages that are incompatible to each other may be installed, like linux from ''[core]'' and an older kernel module from ''[extra]''.}}<br />
<br />
=== Force pacman to refresh the package lists ===<br />
<br />
Mirrors can be out of sync and the package list from the old mirror may not correspond to the package list of the new mirror, even though the dates of the lists may suggest that they do.<br />
<br />
After creating/editing {{ic|/etc/pacman.d/mirrorlist}}, (manually or by using {{ic|rankmirrors}}) issue the following command:<br />
# pacman -Syyu<br />
<br />
Passing two {{ic|--refresh}} or {{ic|-y}} flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing {{ic|pacman -Syyu}} ''whenever changing to a new mirror'' is good practice and will avoid possible issues. See also [https://bbs.archlinux.org/viewtopic.php?id=163124 Is -Syy safe?].<br />
<br />
== Sorting mirrors ==<br />
<br />
When downloading packages pacman uses the mirrors in the order they are in {{ic|/etc/pacman.d/mirrorlist}}. To set a priority to mirrors, the mirrorlist file has to be sorted manually or using a script.<br />
<br />
It is not a good idea to just use the fastest mirrors, since the fastest mirrors might be out of sync. Instead, make a list of mirrors sorted by their [[#List by speed|speed]], then remove those from the list that are out of sync according to their [https://www.archlinux.org/mirrors/status/ status].<br />
<br />
It is recommended to repeat this process before every system upgrade to keep {{ic|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
=== List by speed ===<br />
<br />
The {{Pkg|pacman}} package provides a Bash script, {{ic|/usr/bin/rankmirrors}}, which can be used to rank the mirrors according to their connection and opening speeds to take advantage of using the fastest local mirror.<br />
<br />
Back up the existing {{ic|/etc/pacman.d/mirrorlist}}:<br />
<br />
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
Edit {{ic|/etc/pacman.d/mirrorlist.backup}} and uncomment mirrors for testing with {{ic|rankmirrors}}.<br />
<br />
Optionally run the following {{ic|sed}} line to uncomment every mirror:<br />
<br />
# sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{ic|-n 6}} means only output the 6 fastest mirrors:<br />
<br />
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist<br />
<br />
Run {{ic|rankmirrors -h}} for a list of all the available options.<br />
<br />
=== Server-side ranking ===<br />
<br />
The official [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] provides an easy way to obtain a ranked list of mirrors. Because all ranking is done on a single server that takes multiple factors into account, the amount of load on the mirrors and the clients is significantly lower compared to ranking on each individual client.<br />
<br />
There are multiple scripts automating the update of the mirrorlist from the ranking server:<br />
<br />
* [[Reflector]] retrieves the latest mirrorlist from the [https://www.archlinux.org/mirrors/status/ MirrorStatus] page, filters the most up-to-date mirrors, sorts them by speed and overwrites the {{ic|/etc/pacman.d/mirrorlist}} file.<br />
* {{AUR|update-pacman-mirrorlist}} is a minimalistic script that downloads a mirrorlist from a specified ranking server defaulting to the official [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator]. It also provides an optional [[Systemd/Timers|systemd timer]] to manage the mirrorlist automatically without intervention.<br />
* [https://github.com/Gen2ly/armrr armrr] downloads a ranked mirrorlist for a specific country from the [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] and creates a backup of the previous mirrorlist.<br />
<br />
=== List mirrors only for a specific country ===<br />
<br />
Can be useful to automate update of the mirror list only for a specific countries instead of making a speed test each time. Assumed that {{ic|mirrorlist.pacnew}} exist, the file creates after installation of the {{Pkg|pacman-mirrorlist}} update.<br />
<br />
{{bc|<nowiki>Cnt="China";<br />
awk -v GG=$Cnt '{if(match($0,GG) != "0")AA="1";if(AA == "1"){if( length($2) != "0" )print substr($0,2) ;else AA="0"} }' \<br />
/etc/pacman.d/mirrorlist.pacnew</nowiki>}}<br />
<br />
== Troubleshooting ==<br />
<br />
In the unlikely scenario that you are without any configured mirrors and {{ic|pacman-mirrorlist}} is not installed, run the following command:<br />
# curl -o /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki><br />
<br />
Be sure to uncomment a preferred mirror as described above, then:<br />
# pacman -Syu pacman-mirrorlist<br />
<br />
If you get an error stating that the {{ic|$arch}} variable is used but not defined, add the following to your {{ic|/etc/pacman.conf}}:<br />
Architecture = x86_64<br />
<br />
{{Note|You can also use the values {{ic|auto}} and {{ic|i686}} for the {{ic|Architecture}} variable.}}<br />
<br />
== Unofficial mirrors ==<br />
<br />
These mirrors are ''not'' listed in {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== Austria ===<br />
<br />
*http://gd.tuwien.ac.at/opsys/linux/archlinux/ - ''Vienna University of Technology''<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/<br />
<br />
=== China ===<br />
<br />
'''Telecom'''<br />
*http://mirror.bit.edu.cn/archlinux/ - ''Beijing Institute of Technology''<br />
*http://mirrors.aliyun.com/archlinux/ - ''Alibaba''<br />
<br />
'''Unicom'''<br />
*http://mirrors.sohu.com/archlinux/<br />
*http://mirrors.yun-idc.com/archlinux/<br />
<br />
'''Cernet'''<br />
*http://mirrors.geekpie.org/archlinux/ - ''Geek Pie Association @ ShanghaiTech University''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''Shanghai Jiaotong University''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(ipv4 only)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(ipv6 only)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''Lanzhou University''<br />
<br />
=== France ===<br />
<br />
*http://delta.archlinux.fr/ - ''With Delta package support. Needs {{Pkg|xdelta3}} to run.''<br />
*http://mirror.soa1.org/archlinux<br />
*ftp://mirror:mirror@mirror.soa1.org/archlinux<br />
<br />
=== Germany ===<br />
<br />
*http://ftp.u-tx.net/archlinux/<br />
*ftp://ftp.u-tx.net/archlinux/<br />
<br />
=== Indonesia ===<br />
<br />
*http://kambing.ui.ac.id/archlinux/<br />
<br />
=== Iran ===<br />
<br />
*http://mirror.yazd.ac.ir/arch/<br />
<br />
=== Italy ===<br />
<br />
*http://mi.mirror.garr.it/mirrors/archlinux/<br />
<br />
=== Japan ===<br />
<br />
*http://ftp.nara.wide.ad.jp/pub/Linux/archlinux/ - ''NAra Institute of Science and Technology''<br />
*http://ftp.kddilabs.jp/Linux/packages/archlinux/<br />
*http://srv2.ftp.ne.jp/Linux/packages/archlinux/<br />
<br />
=== Malaysia ===<br />
<br />
*http://mirror.oscc.org.my/archlinux/<br />
<br />
=== New Zealand ===<br />
<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only''<br />
<br />
=== Poland ===<br />
<br />
*ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
<br />
=== Russia ===<br />
<br />
*http://mirrors.krasinfo.ru/archlinux/ - ''Krasnoyarsk, Classica-Service Ltd''<br />
<br />
=== South Africa ===<br />
<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
*http://mirror.ufs.ac.za/archlinux/ - ''University of the Free State''<br />
*ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/<br />
*http://archlinux.mirror.ac.za - ''TENET - Tertiary Education and Research Network of South Africa''<br />
*ftp://archlinux.mirror.ac.za<br />
<br />
=== Sweden ===<br />
<br />
*http://foss.dhyrule.se/linux/archlinux/ <br />
*ftp://foss.dhyrule.se/linux/archlinux/<br />
<br />
=== United States ===<br />
<br />
* http://mirror.clarkson.edu/archlinux/<br />
* http://mirror.pointysoftware.net/archlinux/<br />
* http://mirror.ziemer.bz/archlinux<br />
<br />
=== Sourceforge (old ISOs) ===<br />
<br />
* http://sourceforge.net/projects/archlinux/files/ - ''ISO files only; Does not have any releases since 2006. Use it only for getting older ISOs.''</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Mirrors&diff=432042Mirrors2016-04-21T07:22:22Z<p>Sushi Dude: /* Server-side ranking */ Clarify that the systemd timer is optional.</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package management]]<br />
[[ar:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[it:Mirrors]]<br />
[[ja:ミラー]]<br />
[[ru:Mirrors]]<br />
[[zh-CN:Mirrors]]<br />
{{Related articles start}}<br />
{{Related|pacman}}<br />
{{Related articles end}}<br />
<br />
This page is a guide to selecting and configuring your mirrors, and a listing of current available mirrors.<br />
<br />
== Official mirrors ==<br />
<br />
The official Arch Linux mirror list is available from the {{pkg|pacman-mirrorlist}} package. To get an even more up-to-date list of mirrors, use the [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] page on the main site.<br />
<br />
Check the status of the Arch mirrors by visiting the [https://www.archlinux.org/mirrors/status/ Mirror Status] page. It is recommended to only use mirrors that are up to date, i.e. not out of sync.<br />
<br />
If you want your mirror to be added to the official list, see [[DeveloperWiki:NewMirrors]]. In the meantime, add it to the [[#Unofficial mirrors]] list at the end of this page.<br />
<br />
=== IPv6-ready mirrors ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/?ip_version=6 Pacman Mirrorlist Generator] can also be used to find a list of current IPv6 mirrors.<br />
<br />
== Enabling a specific mirror ==<br />
<br />
To enable mirrors, edit {{ic|/etc/pacman.d/mirrorlist}} and locate your geographic region. Uncomment mirrors you would like to use.<br />
<br />
Example:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
See [[#Sorting mirrors]] for tools that help choosing mirrors.<br />
<br />
{{Tip|<br />
* Uncomment 5 favorite mirrors and place them at the top of the mirrorlist file. That way it's easy to find them and move them around if the first mirror on the list has problems. It also makes merging mirrorlist updates easier.<br />
* HTTP mirrors are faster than FTP due to [[Wikipedia:HTTP persistent connection|persistent HTTP connection]]: with FTP, a new connection to server has to be established each time ''pacman'' requests a package to be downloaded, which results in a brief pause.<br />
}}<br />
<br />
It is also possible to specify mirrors in {{ic|/etc/pacman.conf}}. For the ''[core]'' repository, the default setup is:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
To use the ''HostEurope'' mirror as a default mirror, add it before the {{ic|Include}} line:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
pacman will now try to connect to this mirror first. Proceed to do the same for ''[testing]'', ''[extra]'', and ''[community]'', if applicable.<br />
<br />
{{Note|If mirrors have been stated directly in {{ic|pacman.conf}}, remember to use the same mirror for all repositories. Otherwise packages that are incompatible to each other may be installed, like linux from ''[core]'' and an older kernel module from ''[extra]''.}}<br />
<br />
=== Force pacman to refresh the package lists ===<br />
<br />
Mirrors can be out of sync and the package list from the old mirror may not correspond to the package list of the new mirror, even though the dates of the lists may suggest that they do.<br />
<br />
After creating/editing {{ic|/etc/pacman.d/mirrorlist}}, (manually or by using {{ic|rankmirrors}}) issue the following command:<br />
# pacman -Syyu<br />
<br />
Passing two {{ic|--refresh}} or {{ic|-y}} flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing {{ic|pacman -Syyu}} ''whenever changing to a new mirror'' is good practice and will avoid possible issues. See also [https://bbs.archlinux.org/viewtopic.php?id=163124 Is -Syy safe?].<br />
<br />
== Sorting mirrors ==<br />
<br />
When downloading packages pacman uses the mirrors in the order they are in {{ic|/etc/pacman.d/mirrorlist}}. To set a priority to mirrors, the mirrorlist file has to be sorted manually or using a script.<br />
<br />
It is not a good idea to just use the fastest mirrors, since the fastest mirrors might be out of sync. Instead, make a list of mirrors sorted by their [[#List by speed|speed]], then remove those from the list that are out of sync according to their [https://www.archlinux.org/mirrors/status/ status].<br />
<br />
It is recommended to repeat this process before every system upgrade to keep {{ic|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
=== List by speed ===<br />
<br />
The {{Pkg|pacman}} package provides a Bash script, {{ic|/usr/bin/rankmirrors}}, which can be used to rank the mirrors according to their connection and opening speeds to take advantage of using the fastest local mirror.<br />
<br />
Back up the existing {{ic|/etc/pacman.d/mirrorlist}}:<br />
<br />
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
Edit {{ic|/etc/pacman.d/mirrorlist.backup}} and uncomment mirrors for testing with {{ic|rankmirrors}}.<br />
<br />
Optionally run the following {{ic|sed}} line to uncomment every mirror:<br />
<br />
# sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{ic|-n 6}} means only output the 6 fastest mirrors:<br />
<br />
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist<br />
<br />
Run {{ic|rankmirrors -h}} for a list of all the available options.<br />
<br />
=== Server-side ranking ===<br />
<br />
The official [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] provides an easy way to obtain a ranked list of mirrors. Because all ranking is done on a single server that takes multiple factors into account, the amount of load on the mirrors and the clients is significantly lower compared to ranking on each individual client.<br />
<br />
There are multiple scripts automating the update of the mirrorlist from the ranking server:<br />
<br />
* [[Reflector]] retrieves the latest mirrorlist from the [https://www.archlinux.org/mirrors/status/ MirrorStatus] page, filters the most up-to-date mirrors, sorts them by speed and overwrites the {{ic|/etc/pacman.d/mirrorlist}} file.<br />
* {{AUR|update-pacman-mirrorlist}} is a minimalistic script that downloads a mirrorlist from a specified ranking server defaulting to the official [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator]. It also provides an optional [[Systemd/Timers|systemd timer]] to manage the mirrorlist automatically without intervention.<br />
* [https://github.com/Gen2ly/armrr armrr] downloads ranked mirrorlist for a specific country from [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] and creates a backup of the previous mirrorlist.<br />
<br />
=== List mirrors only for a specific country ===<br />
<br />
Can be useful to automate update of the mirror list only for a specific countries instead of making a speed test each time. Assumed that {{ic|mirrorlist.pacnew}} exist, the file creates after installation of the {{Pkg|pacman-mirrorlist}} update.<br />
<br />
{{bc|<nowiki>Cnt="China";<br />
awk -v GG=$Cnt '{if(match($0,GG) != "0")AA="1";if(AA == "1"){if( length($2) != "0" )print substr($0,2) ;else AA="0"} }' \<br />
/etc/pacman.d/mirrorlist.pacnew</nowiki>}}<br />
<br />
== Troubleshooting ==<br />
<br />
In the unlikely scenario that you are without any configured mirrors and {{ic|pacman-mirrorlist}} is not installed, run the following command:<br />
# curl -o /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki><br />
<br />
Be sure to uncomment a preferred mirror as described above, then:<br />
# pacman -Syu pacman-mirrorlist<br />
<br />
If you get an error stating that the {{ic|$arch}} variable is used but not defined, add the following to your {{ic|/etc/pacman.conf}}:<br />
Architecture = x86_64<br />
<br />
{{Note|You can also use the values {{ic|auto}} and {{ic|i686}} for the {{ic|Architecture}} variable.}}<br />
<br />
== Unofficial mirrors ==<br />
<br />
These mirrors are ''not'' listed in {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== Austria ===<br />
<br />
*http://gd.tuwien.ac.at/opsys/linux/archlinux/ - ''Vienna University of Technology''<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/<br />
<br />
=== China ===<br />
<br />
'''Telecom'''<br />
*http://mirror.bit.edu.cn/archlinux/ - ''Beijing Institute of Technology''<br />
*http://mirrors.aliyun.com/archlinux/ - ''Alibaba''<br />
<br />
'''Unicom'''<br />
*http://mirrors.sohu.com/archlinux/<br />
*http://mirrors.yun-idc.com/archlinux/<br />
<br />
'''Cernet'''<br />
*http://mirrors.geekpie.org/archlinux/ - ''Geek Pie Association @ ShanghaiTech University''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''Shanghai Jiaotong University''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(ipv4 only)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(ipv6 only)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''Lanzhou University''<br />
<br />
=== France ===<br />
<br />
*http://delta.archlinux.fr/ - ''With Delta package support. Needs {{Pkg|xdelta3}} to run.''<br />
*http://mirror.soa1.org/archlinux<br />
*ftp://mirror:mirror@mirror.soa1.org/archlinux<br />
<br />
=== Germany ===<br />
<br />
*http://ftp.u-tx.net/archlinux/<br />
*ftp://ftp.u-tx.net/archlinux/<br />
<br />
=== Indonesia ===<br />
<br />
*http://kambing.ui.ac.id/archlinux/<br />
<br />
=== Iran ===<br />
<br />
*http://mirror.yazd.ac.ir/arch/<br />
<br />
=== Italy ===<br />
<br />
*http://mi.mirror.garr.it/mirrors/archlinux/<br />
<br />
=== Japan ===<br />
<br />
*http://ftp.nara.wide.ad.jp/pub/Linux/archlinux/ - ''NAra Institute of Science and Technology''<br />
*http://ftp.kddilabs.jp/Linux/packages/archlinux/<br />
*http://srv2.ftp.ne.jp/Linux/packages/archlinux/<br />
<br />
=== Malaysia ===<br />
<br />
*http://mirror.oscc.org.my/archlinux/<br />
<br />
=== New Zealand ===<br />
<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only''<br />
<br />
=== Poland ===<br />
<br />
*ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
<br />
=== Russia ===<br />
<br />
*http://mirrors.krasinfo.ru/archlinux/ - ''Krasnoyarsk, Classica-Service Ltd''<br />
<br />
=== South Africa ===<br />
<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
*http://mirror.ufs.ac.za/archlinux/ - ''University of the Free State''<br />
*ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/<br />
*http://archlinux.mirror.ac.za - ''TENET - Tertiary Education and Research Network of South Africa''<br />
*ftp://archlinux.mirror.ac.za<br />
<br />
=== Sweden ===<br />
<br />
*http://foss.dhyrule.se/linux/archlinux/ <br />
*ftp://foss.dhyrule.se/linux/archlinux/<br />
<br />
=== United States ===<br />
<br />
* http://mirror.clarkson.edu/archlinux/<br />
* http://mirror.pointysoftware.net/archlinux/<br />
* http://mirror.ziemer.bz/archlinux<br />
<br />
=== Sourceforge (old ISOs) ===<br />
<br />
* http://sourceforge.net/projects/archlinux/files/ - ''ISO files only; Does not have any releases since 2006. Use it only for getting older ISOs.''</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Mirrors&diff=432041Mirrors2016-04-21T07:15:53Z<p>Sushi Dude: /* Server-side ranking */ update-pacman-mirrorlist configuration is explained on the AUR page.</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package management]]<br />
[[ar:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[it:Mirrors]]<br />
[[ja:ミラー]]<br />
[[ru:Mirrors]]<br />
[[zh-CN:Mirrors]]<br />
{{Related articles start}}<br />
{{Related|pacman}}<br />
{{Related articles end}}<br />
<br />
This page is a guide to selecting and configuring your mirrors, and a listing of current available mirrors.<br />
<br />
== Official mirrors ==<br />
<br />
The official Arch Linux mirror list is available from the {{pkg|pacman-mirrorlist}} package. To get an even more up-to-date list of mirrors, use the [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] page on the main site.<br />
<br />
Check the status of the Arch mirrors by visiting the [https://www.archlinux.org/mirrors/status/ Mirror Status] page. It is recommended to only use mirrors that are up to date, i.e. not out of sync.<br />
<br />
If you want your mirror to be added to the official list, see [[DeveloperWiki:NewMirrors]]. In the meantime, add it to the [[#Unofficial mirrors]] list at the end of this page.<br />
<br />
=== IPv6-ready mirrors ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/?ip_version=6 Pacman Mirrorlist Generator] can also be used to find a list of current IPv6 mirrors.<br />
<br />
== Enabling a specific mirror ==<br />
<br />
To enable mirrors, edit {{ic|/etc/pacman.d/mirrorlist}} and locate your geographic region. Uncomment mirrors you would like to use.<br />
<br />
Example:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
See [[#Sorting mirrors]] for tools that help choosing mirrors.<br />
<br />
{{Tip|<br />
* Uncomment 5 favorite mirrors and place them at the top of the mirrorlist file. That way it's easy to find them and move them around if the first mirror on the list has problems. It also makes merging mirrorlist updates easier.<br />
* HTTP mirrors are faster than FTP due to [[Wikipedia:HTTP persistent connection|persistent HTTP connection]]: with FTP, a new connection to server has to be established each time ''pacman'' requests a package to be downloaded, which results in a brief pause.<br />
}}<br />
<br />
It is also possible to specify mirrors in {{ic|/etc/pacman.conf}}. For the ''[core]'' repository, the default setup is:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
To use the ''HostEurope'' mirror as a default mirror, add it before the {{ic|Include}} line:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
pacman will now try to connect to this mirror first. Proceed to do the same for ''[testing]'', ''[extra]'', and ''[community]'', if applicable.<br />
<br />
{{Note|If mirrors have been stated directly in {{ic|pacman.conf}}, remember to use the same mirror for all repositories. Otherwise packages that are incompatible to each other may be installed, like linux from ''[core]'' and an older kernel module from ''[extra]''.}}<br />
<br />
=== Force pacman to refresh the package lists ===<br />
<br />
Mirrors can be out of sync and the package list from the old mirror may not correspond to the package list of the new mirror, even though the dates of the lists may suggest that they do.<br />
<br />
After creating/editing {{ic|/etc/pacman.d/mirrorlist}}, (manually or by using {{ic|rankmirrors}}) issue the following command:<br />
# pacman -Syyu<br />
<br />
Passing two {{ic|--refresh}} or {{ic|-y}} flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing {{ic|pacman -Syyu}} ''whenever changing to a new mirror'' is good practice and will avoid possible issues. See also [https://bbs.archlinux.org/viewtopic.php?id=163124 Is -Syy safe?].<br />
<br />
== Sorting mirrors ==<br />
<br />
When downloading packages pacman uses the mirrors in the order they are in {{ic|/etc/pacman.d/mirrorlist}}. To set a priority to mirrors, the mirrorlist file has to be sorted manually or using a script.<br />
<br />
It is not a good idea to just use the fastest mirrors, since the fastest mirrors might be out of sync. Instead, make a list of mirrors sorted by their [[#List by speed|speed]], then remove those from the list that are out of sync according to their [https://www.archlinux.org/mirrors/status/ status].<br />
<br />
It is recommended to repeat this process before every system upgrade to keep {{ic|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
=== List by speed ===<br />
<br />
The {{Pkg|pacman}} package provides a Bash script, {{ic|/usr/bin/rankmirrors}}, which can be used to rank the mirrors according to their connection and opening speeds to take advantage of using the fastest local mirror.<br />
<br />
Back up the existing {{ic|/etc/pacman.d/mirrorlist}}:<br />
<br />
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
Edit {{ic|/etc/pacman.d/mirrorlist.backup}} and uncomment mirrors for testing with {{ic|rankmirrors}}.<br />
<br />
Optionally run the following {{ic|sed}} line to uncomment every mirror:<br />
<br />
# sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{ic|-n 6}} means only output the 6 fastest mirrors:<br />
<br />
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist<br />
<br />
Run {{ic|rankmirrors -h}} for a list of all the available options.<br />
<br />
=== Server-side ranking ===<br />
<br />
The official [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] provides an easy way to obtain a ranked list of mirrors. Because all ranking is done on a single server that takes multiple factors into account, the amount of load on the mirrors and the clients is significantly lower compared to ranking on each individual client.<br />
<br />
There are multiple scripts automating the update of the mirrorlist from the ranking server:<br />
<br />
* [[Reflector]] retrieves the latest mirrorlist from the [https://www.archlinux.org/mirrors/status/ MirrorStatus] page, filters the most up-to-date mirrors, sorts them by speed and overwrites the {{ic|/etc/pacman.d/mirrorlist}} file.<br />
* {{AUR|update-pacman-mirrorlist}} is a minimalistic script that downloads a mirrorlist from a specified ranking server defaulting to the official [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator]. It also provides a [[Systemd/Timers|systemd timer]] to manage the mirrorlist automatically without intervention.<br />
* [https://github.com/Gen2ly/armrr armrr] downloads ranked mirrorlist for a specific country from [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] and creates a backup of the previous mirrorlist.<br />
<br />
=== List mirrors only for a specific country ===<br />
<br />
Can be useful to automate update of the mirror list only for a specific countries instead of making a speed test each time. Assumed that {{ic|mirrorlist.pacnew}} exist, the file creates after installation of the {{Pkg|pacman-mirrorlist}} update.<br />
<br />
{{bc|<nowiki>Cnt="China";<br />
awk -v GG=$Cnt '{if(match($0,GG) != "0")AA="1";if(AA == "1"){if( length($2) != "0" )print substr($0,2) ;else AA="0"} }' \<br />
/etc/pacman.d/mirrorlist.pacnew</nowiki>}}<br />
<br />
== Troubleshooting ==<br />
<br />
In the unlikely scenario that you are without any configured mirrors and {{ic|pacman-mirrorlist}} is not installed, run the following command:<br />
# curl -o /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki><br />
<br />
Be sure to uncomment a preferred mirror as described above, then:<br />
# pacman -Syu pacman-mirrorlist<br />
<br />
If you get an error stating that the {{ic|$arch}} variable is used but not defined, add the following to your {{ic|/etc/pacman.conf}}:<br />
Architecture = x86_64<br />
<br />
{{Note|You can also use the values {{ic|auto}} and {{ic|i686}} for the {{ic|Architecture}} variable.}}<br />
<br />
== Unofficial mirrors ==<br />
<br />
These mirrors are ''not'' listed in {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== Austria ===<br />
<br />
*http://gd.tuwien.ac.at/opsys/linux/archlinux/ - ''Vienna University of Technology''<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/<br />
<br />
=== China ===<br />
<br />
'''Telecom'''<br />
*http://mirror.bit.edu.cn/archlinux/ - ''Beijing Institute of Technology''<br />
*http://mirrors.aliyun.com/archlinux/ - ''Alibaba''<br />
<br />
'''Unicom'''<br />
*http://mirrors.sohu.com/archlinux/<br />
*http://mirrors.yun-idc.com/archlinux/<br />
<br />
'''Cernet'''<br />
*http://mirrors.geekpie.org/archlinux/ - ''Geek Pie Association @ ShanghaiTech University''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''Shanghai Jiaotong University''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(ipv4 only)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(ipv6 only)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''Lanzhou University''<br />
<br />
=== France ===<br />
<br />
*http://delta.archlinux.fr/ - ''With Delta package support. Needs {{Pkg|xdelta3}} to run.''<br />
*http://mirror.soa1.org/archlinux<br />
*ftp://mirror:mirror@mirror.soa1.org/archlinux<br />
<br />
=== Germany ===<br />
<br />
*http://ftp.u-tx.net/archlinux/<br />
*ftp://ftp.u-tx.net/archlinux/<br />
<br />
=== Indonesia ===<br />
<br />
*http://kambing.ui.ac.id/archlinux/<br />
<br />
=== Iran ===<br />
<br />
*http://mirror.yazd.ac.ir/arch/<br />
<br />
=== Italy ===<br />
<br />
*http://mi.mirror.garr.it/mirrors/archlinux/<br />
<br />
=== Japan ===<br />
<br />
*http://ftp.nara.wide.ad.jp/pub/Linux/archlinux/ - ''NAra Institute of Science and Technology''<br />
*http://ftp.kddilabs.jp/Linux/packages/archlinux/<br />
*http://srv2.ftp.ne.jp/Linux/packages/archlinux/<br />
<br />
=== Malaysia ===<br />
<br />
*http://mirror.oscc.org.my/archlinux/<br />
<br />
=== New Zealand ===<br />
<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only''<br />
<br />
=== Poland ===<br />
<br />
*ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
<br />
=== Russia ===<br />
<br />
*http://mirrors.krasinfo.ru/archlinux/ - ''Krasnoyarsk, Classica-Service Ltd''<br />
<br />
=== South Africa ===<br />
<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
*http://mirror.ufs.ac.za/archlinux/ - ''University of the Free State''<br />
*ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/<br />
*http://archlinux.mirror.ac.za - ''TENET - Tertiary Education and Research Network of South Africa''<br />
*ftp://archlinux.mirror.ac.za<br />
<br />
=== Sweden ===<br />
<br />
*http://foss.dhyrule.se/linux/archlinux/ <br />
*ftp://foss.dhyrule.se/linux/archlinux/<br />
<br />
=== United States ===<br />
<br />
* http://mirror.clarkson.edu/archlinux/<br />
* http://mirror.pointysoftware.net/archlinux/<br />
* http://mirror.ziemer.bz/archlinux<br />
<br />
=== Sourceforge (old ISOs) ===<br />
<br />
* http://sourceforge.net/projects/archlinux/files/ - ''ISO files only; Does not have any releases since 2006. Use it only for getting older ISOs.''</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Font_configuration&diff=422205Font configuration2016-02-25T12:02:41Z<p>Sushi Dude: /* Subpixel rendering */ Subpixel is implemented in FreeType, not Infinality. It is also not experimental. Additionally, Arch Linux compiles support for it, but does not enable it by default.</p>
<hr />
<div>[[Category:Fonts]]<br />
[[it:Font configuration]]<br />
[[ja:フォント設定]]<br />
[[ru:Font configuration]]<br />
[[sr:Font configuration]]<br />
[[tr:Yazıtipi yapılandırması]]<br />
[[zh-cn:Font configuration]]<br />
{{Related articles start}}<br />
{{Related|Fonts}}<br />
{{Related|Font configuration/Examples}}<br />
{{Related|Infinality}}<br />
{{Related|Java Runtime Environment Fonts}}<br />
{{Related|MS Fonts}}<br />
{{Related|X Logical Font Description}}<br />
{{Related articles end}}<br />
<br />
[http://www.freedesktop.org/wiki/Software/fontconfig/ Fontconfig] is a library designed to provide a list of available [[fonts]] to applications, and also for configuration for how fonts get rendered: see [[Wikipedia:Fontconfig]]. The FreeType library {{Pkg|freetype2}} renders the fonts, based on this configuration.<br />
<br />
Though Fontconfig is the standard in modern Linux, some applications rely on the original method of font selection and display, the [[X Logical Font Description]].<br />
<br />
The font rendering packages on Arch Linux includes support for ''freetype2'' with the bytecode interpreter (BCI) enabled. For better font rendering, especially with an LCD monitor, see [[#Fontconfig configuration]] and [[Font configuration/Examples]].<br />
<br />
== Font paths ==<br />
<br />
For fonts to be known to applications, they must be cataloged for easy and quick access.<br />
<br />
The font paths initially known to Fontconfig are: {{ic|/usr/share/fonts/}}, {{ic|~/.local/share/fonts}} (and {{ic|~/.fonts/}}, now deprecated). Fontconfig will scan these directories recursively. For ease of organization and installation, it is recommended to use these font paths when [[adding fonts]].<br />
<br />
To see a list of known Fontconfig fonts:<br />
$ fc-list : file<br />
<br />
See {{ic|man fc-list}} for more output formats.<br />
<br />
Check for Xorg's known font paths by reviewing its log:<br />
<br />
$ grep /fonts ~/.local/share/xorg/Xorg.0.log<br />
<br />
{{Tip|<br />
* You can also check the list of [[Xorg]]'s known font paths using the command {{ic|xset q}}.<br />
* Use {{ic|/var/log/Xorg.0.log}} if Xorg is run with root privileges.<br />
}}<br />
<br />
Keep in mind that Xorg does not search recursively through the {{ic|/usr/share/fonts/}} directory like Fontconfig does. To add a path, the full path must be used:<br />
Section "Files"<br />
FontPath "/usr/share/fonts/local/"<br />
EndSection<br />
<br />
If you want font paths to be set on a per-user basis, you can add and remove font paths from the default by adding the following line(s) to {{ic|~/.xinitrc}}:<br />
xset +fp /usr/share/fonts/local/ # Prepend a custom font path to Xorg's list of known font paths<br />
xset -fp /usr/share/fonts/sucky_fonts/ # Remove the specified font path from Xorg's list of known font paths<br />
<br />
To see a list of known Xorg fonts use {{ic|xlsfonts}}, from the {{Pkg|xorg-xlsfonts}} package.<br />
<br />
== Fontconfig configuration ==<br />
<br />
Fontconfig is documented in the [http://www.freedesktop.org/software/fontconfig/fontconfig-user.html fonts-conf] man page.<br />
<br />
Configuration can be done per-user through {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}, and globally with {{ic|/etc/fonts/local.conf}}. The settings in the per-user configuration have precedence over the global configuration. Both these files use the same syntax.<br />
{{Note|Configuration files and directories: {{ic|~/.fonts.conf/}}, {{ic|~/.fonts.conf.d/}} and {{ic|~/.fontconfig/*.cache-*}} are deprecated since {{Pkg|fontconfig}} 2.10.1 ([http://cgit.freedesktop.org/fontconfig/commit/?id&#61;8c255fb185d5651b57380b0a9443001e8051b29d upstream commit]) and will not be read by default in the future versions of the package. New paths are {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}, {{ic|$XDG_CONFIG_HOME/fontconfig/conf.d/NN-name.conf}} and {{ic|$XDG_CACHE_HOME/fontconfig/*.cache-*}} respectively. If using the second location, make sure the naming is valid (where {{ic|NN}} is a two digit number like {{ic|00}}, {{ic|10}}, or {{ic|99}}).}}<br />
<br />
Fontconfig gathers all its configurations in a central file ({{ic|/etc/fonts/fonts.conf}}). This file is replaced during fontconfig updates and should not be edited. Fontconfig-aware applications source this file to know available fonts and how they get rendered. This file is a conglomeration of rules from the global configuration ({{ic|/etc/fonts/local.conf}}), the configured presets in {{ic|/etc/fonts/conf.d/}}, and the user configuration file ({{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}). {{ic|fc-cache}} can be used to rebuild fontconfig's configuration, although changes will only be visible in newly launched applications.<br />
<br />
{{Note|For some desktop environments (such as [[GNOME]] and [[KDE]]) using the ''Font Control Panel'' will automatically create or overwrite the user font configuration file. For these desktop environments, it is best to match your already defined font configurations to get the expected behavior.}}<br />
<br />
Fontconfig configuration files use [[Wikipedia:XML|XML]] format and need these headers:<br />
<br />
{{bc|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<br />
<!-- settings go here --><br />
<br />
</fontconfig><br />
</nowiki>}}<br />
<br />
The configuration examples in this article omit these tags.<br />
<br />
=== Presets ===<br />
<br />
There are presets installed in the directory {{ic|/etc/fonts/conf.avail}}. They can be enabled by creating [[Wikipedia:Symbolic link|symbolic link]]s to them, both per-user and globally, as described in {{ic|/etc/fonts/conf.d/README}}. These presets will override matching settings in their respective configuration files.<br />
<br />
For example, to enable sub-pixel RGB rendering globally:<br />
<br />
# cd /etc/fonts/conf.d<br />
# ln -s ../conf.avail/10-sub-pixel-rgb.conf<br />
<br />
To do the same but instead for a per-user configuration:<br />
<br />
$ mkdir $XDG_CONFIG_HOME/fontconfig/conf.d<br />
$ ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf $XDG_CONFIG_HOME/fontconfig/conf.d<br />
<br />
=== Anti-aliasing ===<br />
<br />
[[Wikipedia:Font rasterization|Font rasterization]] converts vector font data to bitmap data so that it can be displayed. The result can appear jagged due to [[Wikipedia:Aliasing|aliasing]]. [[Wikipedia:Anti-aliasing|anti-aliasing]] is enabled by default and increases the apparent resolution of font edges.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Some applications, like [[GNOME]] may [[#Troubleshooting|override default anti-aliasing settings]].}}<br />
<br />
=== Hinting ===<br />
<br />
{{Expansion|Document FT2_SUBPIXEL_HINTING variable, see {{Bug|35274}}}}<br />
<br />
[[Wikipedia:Font hinting|Font hinting]] (also known as instructing) is the use of mathematical instructions to adjust the display of an outline font so that it lines up with a rasterized grid, (i.e. the pixel grid of the display). Its intended effect is to make fonts appear more crisp so that they are more readable. Fonts will line up correctly without hinting when displays have around 300 [[Wikipedia:Dots per inch|DPI]]. Two types of hinting are available.<br />
<br />
==== Byte-Code Interpreter (BCI) ====<br />
<br />
Using BCI hinting, instructions in TrueType fonts are rendered according to FreeTypes's interpreter. BCI hinting works well with fonts with good hinting instructions. To enable hinting:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="hinting" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Autohinter ====<br />
<br />
The Autohinter attempts to do automatic hinting and disregards any existing hinting information. Originally it was the default because TrueType2 fonts were patent-protected but now that these patents have expired there is very little reason to use it. It does work better with fonts that have broken or no hinting information but it will be strongly sub-optimal for fonts with good hinting information. Generally common fonts are of the later kind so autohinter will not be useful. To enable auto-hinting:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="autohint" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Hintstyle ====<br />
<br />
Hintstyle is the amount of font reshaping done to line up to the grid. Hinting values are: {{ic|hintnone}}, {{ic|hintslight}}, {{ic|hintmedium}}, and {{ic|hintfull}}. {{ic|hintslight}} will make the font more fuzzy to line up to the grid but will be better in retaining font shape, while {{ic|hintfull}} will be a crisp font that aligns well to the pixel grid but will lose a greater amount of font shape. Preferences vary.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="hintstyle" mode="assign"><br />
<const>hintfull</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Some applications, like [[GNOME]] may [[#Troubleshooting|override default hinting settings.]]}}<br />
<br />
=== Subpixel rendering ===<br />
<br />
Most monitors manufactured today use the Red, Green, Blue (RGB) specification. Fontconfig will need to know your monitor type to be able to display your fonts correctly. Monitors are either: '''RGB''' (most common), '''BGR''', '''V-RGB''' (vertical), or '''V-BGR'''. A monitor test can be found [http://www.lagom.nl/lcd-test/subpixel.php here].<br />
<br />
To enable subpixel rendering:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="rgba" mode="assign"><br />
<const>rgb</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|1=Subpixel rendering effectively triples the horizontal (or vertical) resolution for fonts by making use of subpixels. The autohinter and subpixel rendering are not designed to work together. Freetype2 is compiled with [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/0003-Enable-subpixel-hinting.patch?h=9867afd the <tt>TT_CONFIG_OPTION_SUBPIXEL_HINTING</tt> macro]. However, it must be enabled by setting the FT2_SUBPIXEL_HINTING [[Environment variables|environment variable]] to the value of 1.}}<br />
<br />
==== LCD filter ====<br />
<br />
When using subpixel rendering, you should enable the LCD filter, which is designed to reduce colour fringing. This is described under [http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html LCD filtering] in the FreeType 2 API reference. Different options are described under [http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html#FT_LcdFilter FT_LcdFilter], and are illustrated by this [http://www.spasche.net/files/lcdfiltering/ LCD filter test] page.<br />
<br />
The {{ic|lcddefault}} filter will work for most users. Other filters are available that can be used in special situations: {{ic|lcdlight}}; a lighter filter ideal for fonts that look too bold or fuzzy, {{ic|lcdlegacy}}, the original Cairo filter; and {{ic|lcdnone}} to disable it entirely.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Advanced LCD filter specification ====<br />
<br />
If the available, built-in LCD filters are not satisfactory, it is possible to tweak the font rendering very specifically by building a custom freetype2 package and modifying the hardcoded filters. The [[Arch Build System]] can be used to build and install packages from source.<br />
<br />
{{Tip|With the [[Infinality]] packages, the LCD filter can be modified without rebuilds.}}<br />
<br />
First, refresh the freetype2 PKGBUILD as root:<br />
<br />
# abs extra/freetype2<br />
<br />
This example uses {{ic|/var/abs/build}} as the build directory, substitute it according to your personal ABS setup. Download and extract the freetype2 package as a regular user:<br />
<br />
$ cd /var/abs/build<br />
$ cp -r ../extra/freetype2 .<br />
$ cd freetype2<br />
$ makepkg -o<br />
<br />
Edit the file {{ic|src/freetype-VERSION/src/base/ftlcdfil.c}} and look up the definition of the constant {{ic|default_filter[5]}}:<br />
<br />
static const FT_Byte default_filter[5] =<br />
{ 0x10, 0x40, 0x70, 0x40, 0x10 };<br />
<br />
This constant defines a low-pass filter applied to the rendered glyph. Modify it as needed. Save the file, build and install the custom package:<br />
<br />
$ makepkg -e<br />
# pacman -Rd freetype2<br />
# pacman -U freetype2-VERSION-ARCH.pkg.tar.xz<br />
<br />
Reboot or restart X. The lcddefault filter should now render fonts differently.<br />
<br />
=== Disable auto-hinter for bold fonts ===<br />
<br />
The auto-hinter uses sophisticated methods for font rendering, but often makes bold fonts too wide. Fortunately, a solution can be turning off the autohinter for bold fonts while leaving it on for the rest:<br />
...<br />
<match target="font"><br />
<test name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<edit name="autohint" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
...<br />
<br />
=== Replace or set default fonts ===<br />
<br />
The most reliable way to do this is to add an XML fragment similar to the one below. ''Using the "binding" attribute will give you better results'', for example, in Firefox where you may not want to change properties of font being replaced. This will cause Ubuntu to be used in place of Georgia:<br />
<br />
{{bc|<nowiki><br />
...<br />
<match target="pattern"><br />
<test qual="any" name="family"><string>georgia</string></test><br />
<edit name="family" mode="assign" binding="same"><string>Ubuntu</string></edit><br />
</match><br />
...<br />
</nowiki>}}<br />
<br />
An alternate approach is to set the "preferred" font, but ''this only works if the original font is not on the system'', in which case the one specified will be substituted:<br />
<br />
{{bc|<nowiki><br />
...<br />
<!-- Replace Helvetica with Bitstream Vera Sans Mono --><br />
<!-- Note, an alias for Helvetica should already exist in default conf files --><br />
<alias><br />
<family>Helvetica</family><br />
<prefer><family>Bitstream Vera Sans Mono</family></prefer><br />
<default><family>fixed</family></default><br />
</alias><br />
...<br />
</nowiki>}}<br />
<br />
=== Whitelisting and blacklisting fonts ===<br />
<br />
The element {{ic|<selectfont>}} is used in conjunction with the {{ic|<acceptfont>}} and {{ic|<rejectfont>}} elements to selectively whitelist or blacklist fonts from the resolve list and match requests. The simplest and most typical use case it to reject one font that is needed to be installed, however is getting matched for a generic font query that is causing problems within application user interfaces.<br />
<br />
First obtain the Family name as listed in the font itself:<br />
<br />
{{hc|1=$ fc-scan .fonts/lklug.ttf --format='%{family}\n'|2=<br />
LKLUG<br />
}}<br />
<br />
Then use that Family name in a {{ic|<rejectfont>}} stanza:<br />
<br />
{{bc|<nowiki><br />
<selectfont><br />
<rejectfont><br />
<pattern><br />
<patelt name="family" ><br />
<string>LKLUG</string><br />
</patelt><br />
</pattern><br />
</rejectfont><br />
</selectfont><br />
</nowiki>}}<br />
<br />
Typically when both elements are combined, {{ic|<rejectfont>}} is first used on a more general matching glob to reject a large group (such as a whole directory), then {{ic|<acceptfont>}} is used after it to whitelist individual fonts out of the larger blacklisted group.<br />
<br />
{{bc|<nowiki><br />
<selectfont><br />
<rejectfont><br />
<glob>/usr/share/fonts/OTF/*</glob><br />
</rejectfont><br />
<acceptfont><br />
<pattern><br />
<patelt name="family" ><br />
<string>Monaco</string><br />
</patelt><br />
</pattern><br />
</acceptfont><br />
</selectfont><br />
</nowiki>}}<br />
<br />
=== Disable bitmap fonts ===<br />
<br />
Bitmap fonts are sometimes used as fallbacks for missing fonts, which may cause text to be rendered pixelated or too large. Use the {{ic|70-no-bitmaps.conf}} [[#Presets|preset]] to disable this behavior. <br />
<br />
<div id="EmbeddedBitmap">To disable embedded bitmap for all fonts:<div><br />
<br />
{{hc|~/.config/fontconfig/conf.d/20-no-embedded.conf|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<match target="font"><br />
<edit name="embeddedbitmap" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
To disable embedded bitmap fonts for a specific font:<br />
<br />
<match target="font"><br />
<test qual="any" name="family"><br />
<string>Monaco</string><br />
</test><br />
<edit name="embeddedbitmap"><bool>false</bool></edit><br />
</match><br />
<br />
=== Disable scaling of bitmap fonts ===<br />
<br />
To disable scaling of bitmap fonts (which often makes them blurry), remove {{ic|/etc/fonts/conf.d/10-scale-bitmap-fonts.conf}}.<br />
<br />
=== Create bold and italic styles for incomplete fonts ===<br />
<br />
FreeType has the ability to automatically create ''italic'' and '''bold''' styles for fonts that do not have them, but only if explicitly required by the application. Given programs rarely send these requests, this section covers manually forcing generation of missing styles.<br />
<br />
Start by editing {{ic|/usr/share/fonts/fonts.cache-1}} as explained below. Store a copy of the modifications on another file, because a font update with {{ic|fc-cache}} will overwrite {{ic|/usr/share/fonts/fonts.cache-1}}.<br />
<br />
Assuming the Dupree font is installed:<br />
"dupree.ttf" 0 "Dupree:style=Regular:slant=0:weight=80:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Duplicate the line, change {{ic|<nowiki>style=Regular</nowiki>}} to {{ic|<nowiki>style=Bold</nowiki>}} or any other style. Also change {{ic|<nowiki>slant=0</nowiki>}} to {{ic|<nowiki>slant=100</nowiki>}} for italic, {{ic|<nowiki>weight=80</nowiki>}} to {{ic|<nowiki>weight=200</nowiki>}} for bold, or combine them for '''''bold italic''''':<br />
"dupree.ttf" 0 "Dupree:style=Bold Italic:slant=100:weight=200:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Now add necessary modifications to {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}:<br />
{{bc|<nowiki><br />
...<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="weight" compare="more_eq"><int>140</int></test><br />
<edit name="embolden" mode="assign"><bool>true</bool></edit><br />
</match><br />
<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="slant" compare="more_eq"><int>80</int></test><br />
<edit name="matrix" mode="assign"><br />
<times><br />
<name>matrix</name><br />
<matrix><br />
<double>1</double><double>0.2</double><br />
<double>0</double><double>1</double><br />
</matrix><br />
</times><br />
</edit><br />
</match><br />
...<br />
</nowiki>}}<br />
{{Tip| Use the value 'embolden' for existing bold fonts in order to make them even bolder.}}<br />
<br />
=== Change rule overriding ===<br />
<br />
{{Accuracy|{{ic|/etc/fonts/conf.d/50-user.conf}} will be created again when {{Pkg|fontconfig}} is updated}}<br />
<br />
Fontconfig processes files in {{ic|/etc/fonts/conf.d}} in numerical order. This enables rules or files to override one another, but often confuses users about what file gets parsed last.<br />
<br />
To guarantee that personal settings take precedence over any other rules, change their ordering:<br />
# cd /etc/fonts/conf.d<br />
# mv 50-user.conf 99-user.conf<br />
<br />
This change seems however to be unnecessary for the most of the cases, because a user is given enough control by default to set up own font preferences, hinting and antialiasing properties, alias new fonts to generic font families, etc.<br />
<br />
=== Query the current settings ===<br />
<br />
To find out what settings are in effect, use {{ic|fc-match --verbose}}. eg.<br />
<br />
$ fc-match --verbose Sans<br />
family: "DejaVu Sans"(s)<br />
hintstyle: 3(i)(s)<br />
hinting: True(s)<br />
...<br />
<br />
Look up the meaning of the numbers at http://www.freedesktop.org/software/fontconfig/fontconfig-user.html. Eg. 'hintstyle: 3' means 'hintfull'<br />
<br />
== Applications without fontconfig support ==<br />
<br />
Some applications like [[URxvt]] will ignore fontconfig settings. You can work around this by using {{ic|~/.Xresources}}, but it is as flexible as fontconfig. Example (see [[#Fontconfig configuration]] for explanations of the options):<br />
<br />
{{hc|~/.Xresources|<nowiki><br />
Xft.autohint: 0<br />
Xft.lcdfilter: lcddefault<br />
Xft.hintstyle: hintslight<br />
Xft.hinting: 1<br />
Xft.antialias: 1<br />
Xft.rgba: rgb<br />
</nowiki>}}<br />
<br />
Make sure the settings are loaded properly when X starts with {{ic|xrdb -q}} (see [[Xresources]] for more information).<br />
<br />
== Troubleshooting ==<br />
<br />
=== Distorted fonts ===<br />
<br />
{{Note|96 DPI is not a standard. You should use your monitor's actual DPI to get proper font rendering, especially when using subpixel rendering.}}<br />
<br />
If fonts are still unexpectedly large or small, poorly proportioned or simply rendering poorly, fontconfig may be using the incorrect DPI.<br />
<br />
Fontconfig should be able to detect DPI parameters as discovered by the Xorg server. You can check the automatically discovered DPI with {{ic|xdpyinfo}} (provided by the {{pkg|xorg-xdpyinfo}} package):<br />
<br />
{{hc|<nowiki>$ xdpyinfo | grep dots</nowiki>|<br />
resolution: 102x102 dots per inch<br />
}}<br />
<br />
If the DPI is detected incorrectly (usually due to an incorrect monitor [[Wikipedia:Extended Display Identification Data|EDID]]), you can specify it manually in the Xorg configuration, see [[Xorg#Display size and DPI]]. This is the recommended solution, but it may not work with buggy drivers.<br />
<br />
Fontconfig will default to the Xft.dpi variable if it is set. Xft.dpi is usually set by desktop environments (usually to Xorg's DPI setting) or manually in {{ic|~/.Xdefaults}} or {{ic|~/.Xresources}}. Use xrdb to query for the value:<br />
<br />
{{hc|<nowiki>$ xrdb -query | grep dpi</nowiki>|<br />
Xft.dpi: 102<br />
}}<br />
<br />
Those still having problems can fall back to manually setting the DPI used by fontconfig:<br />
<br />
...<br />
<!-- Setup for DPI=96 --><br />
<match target="pattern"><br />
<edit name="dpi" mode="assign"><double>102</double></edit><br />
</match><br />
...<br />
<br />
=== Calibri, Cambria, Monaco, etc. not rendering properly ===<br />
<br />
Some scalable fonts have embedded bitmap versions which are rendered instead, mainly at smaller sizes. Force using scalable fonts at all sizes by [[#EmbeddedBitmap|#Disabling embedded bitmap]].<br />
<br />
=== Applications overriding hinting ===<br />
<br />
Some applications or desktop environments may override default fontconfig hinting and anti-aliasing settings. This may happen with [[GNOME]] 3, for example while you are using Qt applications like {{pkg|vlc}} or {{pkg|smplayer}}. Use the specific configuration program for the application in such cases. For GNOME, try {{pkg|gnome-tweak-tool}}.<br />
<br />
=== Applications not picking up hinting from DE's settings ===<br />
<br />
For instance, under GNOME it sometimes happens that Firefox applies full hinting even when it's set to "none" in GNOME's settings, which results in sharp and widened fonts. In this case you would have to add hinting settings to your {{ic|fonts.conf}} file:<br />
<br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <br />
<fontconfig><br />
<match target="font"><br />
<edit mode="assign" name="hinting"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
</fontconfig><br />
<br />
In this example, hinting is set to "grayscale".<br />
<br />
=== Incorrect hinting in GTK applications on non-Gnome systems ===<br />
<br />
{{Accuracy|Mentions GTK relies on fontconfig, then claims that "some" fonts get the hinting "wrong", and ends up refering to Xft (but see e.g [http://doc.opensuse.org/documentation/html/openSUSE_113/opensuse-reference/cha.fontconfig.html#sec.fontconfig.xft]). IOW, unsupported claims and unclear relations}}<br />
<br />
[[GNOME]] uses the XSETTINGS system to configure font rendering. Without gnome-settings-daemon, GTK applications rely on fontconfig, but some fonts get the hinting wrong causing them to look too bold or too light. <br />
<br />
A simple solution is using {{AUR|xsettingsd-git}} as a replacement for gnome-settings-daemon to provide the configuration, for example:<br />
<br />
{{hc|~/.xsettingsd|<br />
Xft/Hinting 1<br />
Xft/RGBA "rgb"<br />
Xft/HintStyle "hintslight"<br />
Xft/Antialias 1<br />
}}<br />
<br />
Alternatively you could just write the font configuration as {{ic|Xft.*}} directives in {{ic|~/.Xresources}} without using a settings daemon.<br />
<br />
=== Font problem in Generated PDFs ===<br />
<br />
If the following command<br />
<br />
fc-match helvetica<br />
<br />
produces<br />
<br />
helvR12-ISO8859-1.pcf.gz: "Helvetica" "Regular"<br />
<br />
then the bitmap font provided by {{Pkg|xorg-fonts-75dpi}} is likely to be embedded into PDFs generated by "Print to File" or "Export" in various applications. The bitmap font was probably installed as a consequence of installing the whole {{Grp|xorg}} group (which is usually NOT recommended). To solve the pixelized font problem, you can uninstall the package. Install {{Pkg|gsfonts}} (Type 1) or {{Pkg|tex-gyre-fonts}} (OpenType) for corresponding free subsitute of Helvetica (and other PostScript/PDF base fonts).<br />
<br />
You may also experience similar problem when you open a PDF which requires Helvetica but does not have it embedded for viewing.<br />
<br />
== See also ==<br />
<br />
* [http://www.freedesktop.org/software/fontconfig/fontconfig-user.html Fontconfig Users' Guide]<br />
* [http://www.x.org/X11R6.8.2/doc/fonts.html Fonts in X11R6.8.2] - Official Xorg font information<br />
* [http://freetype.sourceforge.net/freetype2/ FreeType 2 overview]<br />
* [https://forums.gentoo.org/viewtopic-t-723341.html Gentoo font-rendering thread]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Fonts&diff=419272Fonts2016-02-06T09:06:03Z<p>Sushi Dude: /* Unsorted */ Add all-repository-fonts to list.</p>
<hr />
<div>[[Category:Fonts]]<br />
[[cs:Fonts]]<br />
[[de:Schriftarten]]<br />
[[es:Fonts]]<br />
[[it:Fonts]]<br />
[[ja:フォント]]<br />
[[ru:Fonts]]<br />
[[tr:Yazıtipleri]]<br />
[[zh-CN:Fonts]]<br />
[[zh-TW:Fonts]]<br />
{{Related articles start}}<br />
{{Related|Font configuration}}<br />
{{Related|Infinality}}<br />
{{Related|Java Runtime Environment Fonts}}<br />
{{Related|Microsoft fonts}}<br />
{{Related articles end}}<br />
<br />
From [[Wikipedia:Computer font|Wikipedia]]:<br />
:''A computer font (or font) is an electronic data file containing a set of glyphs, characters, or symbols such as dingbats.''<br />
<br />
Note that certain font licenses may impose some legal limitations.<br />
<br />
== Font formats ==<br />
<br />
Most computer fonts used today are in either ''bitmap'' or ''outline'' data formats. <br />
;Bitmap fonts: Consist of a matrix of dots or pixels representing the image of each glyph in each face and size.<br />
;Outline or ''vector'' fonts: Use Bézier curves, drawing instructions and mathematical formulae to describe each glyph, which make the character outlines scalable to any size.<br />
<br />
=== Common extensions ===<br />
<br />
* {{ic|bdf}} and {{ic|bdf.gz}} – bitmap fonts, ''b''itmap ''d''istribution ''f''ormat and gzip compressed {{ic|bdf}}<br />
* {{ic|pcf}} and {{ic|pcf.gz}} – bitmaps, ''p''ortable ''c''ompiled ''f''ont and gzip compressed {{ic|pcf}}<br />
* {{ic|psf}}, {{ic|psfu}}, {{ic|psf.gz}} and {{ic|psfu.gz}} – bitmaps, ''P''C ''s''creen ''f''ont, ''P''C ''s''creen ''f''ont ''U''nicode and the gzipped versions (not compatible with X.Org)<br />
* {{ic|pfa}} and {{ic|pfb}} – outline fonts, ''P''ostScript ''f''ont ''A''SCII and ''P''ostScript ''f''ont ''b''inary. PostScript fonts carry built-in printer instructions.<br />
* {{ic|ttf}} – outline, ''T''rue''T''ype ''f''ont. Originally designed as a replacement for the PostScript fonts.<br />
* {{ic|otf}} – outline, ''O''pen''T''ype ''f''ont. TrueType with PostScript typographic instructions.<br />
<br />
For most purposes, the technical differences between TrueType and OpenType can be ignored, some fonts with a {{ic|ttf}} extension are actually OpenType fonts.<br />
<br />
=== Other formats ===<br />
<br />
The typesetting application, ''TeX,'' and its companion font software, ''Metafont,'' render characters using their own methods. Some of the file extensions used for fonts by these two programs are {{ic|*pk}}, {{ic|*gf}}, {{ic|mf}} and {{ic|vf}}.<br />
<br />
''FontForge,'' a font editing application, can store fonts in its native text-based format, {{ic|sfd}}, ''s''pline ''f''ont ''d''atabase.<br />
<br />
The [http://www.w3.org/TR/SVG/fonts.html SVG] format also has its own font description method.<br />
<br />
== Installation ==<br />
<br />
There are various methods for installing fonts.<br />
<br />
=== Pacman ===<br />
<br />
Fonts and font collections in the enabled repositories can be installed using [[pacman]]. Available fonts may be found by using:<br />
$ pacman -Ss font<br />
<br />
Or to search for {{ic|ttf}} fonts only:<br />
$ pacman -Ss ttf<br />
<br />
=== Creating a package ===<br />
<br />
You should give pacman the ability to manage your fonts, which is done by creating an Arch package. These can also be shared with the community in the [[AUR]]. Here is an example of how to create a basic package. To learn more about building packages, read [[PKGBUILD]].<br />
<br />
The family name of a font file can be aquired with the use of {{ic|fc-query}} for example: {{ic|fc-query -f '%{family[0]}\n' /path/to/file}}. The formatting is described in the FcPatternFormat(3) manual.<br />
<br />
{{bc|<nowiki><br />
pkgname=fontname-fonts<br />
pkgver=1.0<br />
pkgrel=1<br />
pkgdesc="Some description"<br />
arch=(any)<br />
depends=(fontconfig xorg-font-utils)<br />
source=("http://someurl.org/$pkgname.tar.bz2")<br />
install=$pkgname.install<br />
<br />
package() {<br />
install -Dm644 $pkgname/font.otf "$pkgdir"/usr/share/fonts/family_name/font.otf<br />
install -Dm644 $pkgname/font_bold.otf "$pkgdir"/usr/share/fonts/family_name/font_bold.otf<br />
}<br />
</nowiki>}}<br />
<br />
{{bc|<nowiki><br />
post_install() {<br />
fc-cache -s<br />
}<br />
<br />
post_upgrade() {<br />
post_install<br />
}<br />
<br />
post_remove() {<br />
post_install<br />
}<br />
</nowiki>}}<br />
<br />
=== Manual installation ===<br />
<br />
The recommended way of adding fonts that are not in the repositories to your system is described in [[#Creating a package]]. This gives pacman the ability to remove or update them at a later time. Fonts can alternately be installed manually as well.<br />
<br />
To install fonts system-wide (available for all users), move the folder to the {{ic|/usr/share/fonts/}} directory. The files need to be readable by every user, use [[chmod]] to set the correct permissions (i.e. at least {{ic|0444}} for files and {{ic|0555}} for directories). To install fonts for only a single user, use {{ic|~/.local/share/fonts}} ({{ic|~/.fonts/}} is now deprecated).<br />
<br />
For Xserver to load fonts directly (as opposed to the use of a ''font server'') the directory for your newly added font must be added with a FontPath entry. This entry is located in the ''Files'' section [[Xorg#Configuration|of your Xorg configuration file]] (e.g. {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/xorg.conf}}). See [[#Older applications]] for more detail.<br />
<br />
Then update the fontconfig font cache: (usually unnecessary as software using the fontconfig library do this.)<br />
<br />
$ fc-cache<br />
<br />
=== Older applications ===<br />
<br />
With older applications that do not support fontconfig (e.g. GTK+ 1.x applications, and {{ic|xfontsel}}) the index will need to be created in the font directory:<br />
<br />
$ mkfontscale<br />
$ mkfontdir<br />
<br />
Or to include more than one folder with one command:<br />
<br />
$ for dir in /font/dir1/ /font/dir2/; do xset +fp $dir; done && xset fp rehash<br />
<br />
Or if fonts were installed in a different sub-folders under the e.g. {{ic|/usr/share/fonts}}:<br />
<br />
$ for dir in * ; do if [ -d "$dir" ]; then cd "$dir";xset +fp "$PWD" ;mkfontscale; mkfontdir;cd .. ;fi; done && xset fp rehash<br />
<br />
At times the X server may fail to load the fonts directory and you will need to rescan all the {{ic|fonts.dir}} files:<br />
<br />
# xset +fp /usr/share/fonts/misc # Inform the X server of new directories<br />
# xset fp rehash # Forces a new rescan<br />
<br />
To check that the font(s) is included:<br />
<br />
$ xlsfonts | grep fontname<br />
<br />
{{note|Many packages will automatically configure Xorg to use the font upon installation. If that is the case with your font, this step is not necessary.}}<br />
<br />
This can also be set globally in {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/X11/xorg.conf.d}}.<br />
<br />
Here is an example of the section that must be added to {{ic|/etc/X11/xorg.conf}}. Add or remove paths based on your particular font requirements.<br />
<br />
# Let X.Org know about the custom font directories<br />
Section "Files"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/cantarell"<br />
FontPath "/usr/share/fonts/cyrillic"<br />
FontPath "/usr/share/fonts/encodings"<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/truetype"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/util"<br />
EndSection<br />
<br />
=== Pango Warnings ===<br />
<br />
When [http://www.pango.org/ Pango] is in use on your system it will read from [http://www.freedesktop.org/wiki/Software/fontconfig fontconfig] to sort out where to source fonts.<br />
<br />
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common'<br />
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'<br />
<br />
If you are seeing errors similar to this and/or seeing blocks instead of characters in your application then you need to add fonts and update the font cache. This example uses the {{Pkg|ttf-liberation}} fonts to illustrate the solution (after successful installation of the package) and runs as root to enable them system-wide.<br />
<br />
# fc-cache<br />
/usr/share/fonts: caching, new cache contents: 0 fonts, 3 dirs<br />
/usr/share/fonts/TTF: caching, new cache contents: 16 fonts, 0 dirs<br />
/usr/share/fonts/encodings: caching, new cache contents: 0 fonts, 1 dirs<br />
/usr/share/fonts/encodings/large: caching, new cache contents: 0 fonts, 0 dirs<br />
/usr/share/fonts/util: caching, new cache contents: 0 fonts, 0 dirs<br />
/var/cache/fontconfig: cleaning cache directory<br />
fc-cache: succeeded<br />
<br />
You can test for a default font being set like so:<br />
<br />
# fc-match<br />
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"<br />
<br />
== Console fonts ==<br />
<br />
{{Note|This section is about the [[Wikipedia:Linux console|Linux console]]. For an alternative console solutions offering more features (full Unicode fonts, modern graphics adapters etc.), see [[fbterm]], [[KMSCON]] or similar projects.}}<br />
<br />
By default, the [[Wikipedia:Virtual console|virtual console]] uses the kernel built-in font with a [[Wikipedia:CP437|CP437]] character set,<sup>[https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/vt/Makefile#n4]</sup> but this can be easily changed.<br />
<br />
The [[Wikipedia:Linux console|Linux console]] uses UTF-8 encoding by default, but because the standard VGA-compatible framebuffer is used, a console font is limited to either a standard 256, or 512 glyphs. If the font has more than 256 glyphs, the number of colours is reduced from 16 to 8. In order to assign correct symbol to be displayed to the given Unicode value, a special translation map, often called ''unimap'', is needed. Nowadays most of the console fonts have the ''unimap'' built-in, historically it had to be loaded separately.<br />
<br />
The {{Pkg|kbd}} package provides tools to change virtual console font and font mapping. Available fonts are saved in the {{ic|/usr/share/kbd/consolefonts/}} directory, those ending with ''.psfu'' or ''.psfu.gz'' have a Unicode translation map built-in.<br />
<br />
Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of {{ic|/usr/share/kbd/keymaps/}}, see [[Keyboard configuration in console]] for details.<br />
<br />
{{Note|Replacing the font can cause issues with programs that expect a standard VGA-style font, such as those using line drawing graphics.}}<br />
<br />
=== Previewing and testing ===<br />
<br />
{{Tip|An organized library of images for previewing is available: [http://alexandre.deverteuil.net/pages/consolefonts/ Linux console fonts screenshots].}}<br />
<br />
The available glyphs or letters in the font can also be viewed as a table with using ''showconsolefont'':<br />
<br />
$ showconsolefont<br />
<br />
The ''setfont'' utility may be used to temporarily change the font, so that the user can consider its permanent use. Just pass the name of the font (they are located in {{ic|/usr/share/kbd/consolefonts/}}). For example:<br />
<br />
$ setfont lat2-16 -m 8859-2<br />
<br />
Note that the font name is case-sensitive, so type it ''exactly'' as you see it. If the newly changed font is not suitable, a return to the default font with the following command (even if the console display is totally unreadable, this command will still work, just type the command "blindly"):<br />
<br />
$ setfont<br />
<br />
{{Note|''setfont'' only works on the console currently being used. Any other consoles, active or inactive, remain unaffected.}}<br />
<br />
=== Persistent configuration ===<br />
<br />
The {{ic|FONT}} variable in {{ic|/etc/vconsole.conf}} is used to set the font at boot, persistently for all consoles. See {{ic|man 5 vconsole.conf}} for details.<br />
<br />
For displaying characters such as ''Č, ž, đ, š'' or ''Ł, ę, ą, ś'' using the font {{ic|lat2-16.psfu.gz}}:<br />
<br />
{{hc|/etc/vconsole.conf|2=<br />
...<br />
FONT=lat2-16<br />
FONT_MAP=8859-2<br />
}}<br />
<br />
It means that second part of ISO/IEC 8859 characters are used with size 16. You can change font size using other values (e.g. {{ic|lat2-08}}). For the regions determined by 8859 specification, look at the [[wikipedia:ISO/IEC_8859#The_Parts_of_ISO.2FIEC_8859|Wikipedia table]].<br />
<br />
To use the specified font in early userspace, use the {{ic|consolefont}} hook in {{ic|/etc/mkinitcpio.conf}}. See [[Mkinitcpio#HOOKS]] for more information.<br />
<br />
If the fonts seems to not change on boot, or change only temporarily, it is most likely that they got reset when graphics driver was initialized and console was switched to framebuffer. To avoid this, load your graphics driver earlier. See for example [[Kernel mode setting#Early KMS start]], [https://bbs.archlinux.org/viewtopic.php?id=145765] or other ways to setup your framebuffer before {{ic|/etc/vconsole.conf}} is applied.<br />
<br />
== Font packages ==<br />
<br />
This is a selective list that includes many font packages from the [[AUR]] along with those in the official repositories. Fonts are tagged "Unicode" if they have wide Unicode support, see the project or Wikipedia pages for detail.<br />
<br />
Github user Ternstor has created a python script that generates HTML documents with PNG images of all the fonts in the AUR and the official repositories: [https://github.com/ternstor/distrofonts/blob/master/archfonts.py].<br />
<br />
=== Braille ===<br />
<br />
*{{Pkg|ttf-ubraille}} - Font containing Unicode symbols for ''braille''<br />
<br />
=== International users ===<br />
<br />
Applications and browsers select and display fonts depending upon fontconfig preferences and available font glyph for Unicode text. To list installed fonts for a particular language, issue a command {{ic|<nowiki>fc-list :lang="two letter language code"</nowiki>}}. For instance, to list installed Arabic fonts or fonts supporting Arabic glyph:<br />
{{hc|$ fc-list -f '%{file}\n' :lang&#61;ar|2=<br />
<nowiki><br />
/usr/share/fonts/TTF/FreeMono.ttf<br />
/usr/share/fonts/TTF/DejaVuSansCondensed.ttf<br />
/usr/share/fonts/truetype/custom/DroidKufi-Bold.ttf<br />
/usr/share/fonts/TTF/DejaVuSansMono.ttf<br />
/usr/share/fonts/TTF/FreeSerif.ttf<br />
</nowiki><br />
}}<br />
<br />
To properly render fonts for multilingual websites like Wikipedia or this Arch Linux wiki, install one of the following sets of packages:<br />
* Google's [http://www.google.com/get/noto/ Noto] is a font family that aims to support all languages. [[Install]] it with the {{Pkg|noto-fonts}}, {{Pkg|noto-fonts-cjk}} and {{Pkg|noto-fonts-emoji}} packages.<br />
* An alternative set of fonts which has a good coverage of languages is {{Pkg|ttf-freefont}} with {{Pkg|ttf-arphic-uming}} and {{Pkg|ttf-baekmuk}}.<br />
<br />
==== Arabic & Urdu ====<br />
<br />
* {{AUR|ttf-qurancomplex-fonts}} - Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah<br />
* {{AUR|ttf-amiri}} - A classical Arabic typeface in Naskh style poineered by Amiria Press<br />
* {{AUR|ttf-sil-lateef}} - Unicode Arabic font from SIL<br />
* {{AUR|ttf-sil-scheherazade}} - Unicode Arabic font from SIL<br />
* {{AUR|ttf-arabeyes-fonts}} - Collection of free Arabic fonts<br />
* {{AUR|ttf-urdufonts}} - Urdu fonts (Jameel Noori Nastaleeq (+kasheeda), Nafees Web Naskh, PDMS Saleem Quran Font) and font configuration to set Jameel Noori Nastaleeq as default font for Urdu<br />
<br />
==== Persian ====<br />
<br />
* {{AUR|ttf-irfonts}} - Official I.R. Iran Supreme Council of Information and Communication Technology (SCICT) standard persian fonts series<br />
* {{AUR|ttf-borna}} - Borna Rayaneh Persian B font series<br />
* {{AUR|ttf-x2}} - X Series 2 fonts are built on freely available fonts and extended to support Persian, Arabic, Urdu, Pashto, Dari, Uzbek, Kurdish, Uighur, old Turkish (Ottoman) and modern Turkish (Roman).<br />
* {{AUR|ttf-iran-nastaliq}} - An Unicode calligraphic font published by the High Council of Informatics of Iran<br />
<br />
==== Burmese ====<br />
<br />
* {{AUR|ttf-my-paduk}} - Padauk font for Myanmar/Birmania<br />
* {{AUR|ttf-myanmar-fonts}} - 121 Fonts from myordbok.com<br />
<br />
==== Chinese, Japanese, Korean, Vietnamese ====<br />
<br />
===== Pan-CJK =====<br />
<br />
* {{Pkg|adobe-source-han-sans-otc-fonts}} - Large collection of fonts which comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look.<br />
<br />
===== (Mainly) Chinese =====<br />
<br />
* {{Pkg|adobe-source-han-sans-cn-fonts}} - Simplified Chinese OpenType/CFF fonts<br />
* {{Pkg|adobe-source-han-sans-tw-fonts}} - Traditional Chinese OpenType/CFF fonts<br />
* {{Pkg|wqy-microhei}} - A Sans-Serif style high quality CJKV outline font.<br />
* {{Pkg|wqy-zenhei}} - Hei Ti Style (sans-serif) Chinese Outline font embedded with bitmapped Song Ti (also supporting Japanese (partial) and Korean characters).<br />
* {{Pkg|ttf-arphic-ukai}} - ''Kaiti'' (brush stroke) Unicode font (enabling anti-aliasing is suggested)<br />
* {{Pkg|ttf-arphic-uming}} - ''Mingti'' (printed) Unicode font<br />
* {{Pkg|opendesktop-fonts}} - ''New Sung'' font, previously is ttf-fireflysung package<br />
* {{Pkg|wqy-bitmapfont}} - Bitmapped Song Ti (serif) Chinese font<br />
* {{Pkg|ttf-hannom}} - Chinese and Vietnamese TrueType font<br />
* {{AUR|ttf-i.bming}} - CJK serif font that emphasis on an old-style typeface<br />
* {{AUR|ttf-tw}} - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan<br />
<br />
===== Japanese =====<br />
<br />
* {{Pkg|adobe-source-han-sans-jp-fonts}} - Japanese OpenType/CFF fonts<br />
* {{Pkg|otf-ipafont}} - Formal style Japanese Gothic (sans-serif) and Mincho (serif) fonts set; one of the highest quality open source font. Default of openSUSE-ja.<br />
* {{Pkg|ttf-sazanami}} - Japanese free TrueType font. This is outdated and not maintained any more, but may be defined as a fallback font on several environments.<br />
* {{Pkg|ttf-hanazono}} - A free Japanese kanji font, style Mincho (serif).<br />
* {{AUR|ttf-vlgothic}} - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux<br />
* {{AUR|ttf-mplus}} - Modern Gothic style Japanese outline fonts. It includes all of Japanese Hiragana/Katakana, Basic Latin, Latin-1 Supplement, Latin Extended-A, IPA Extensions and most of Japanese Kanji, Greek, Cyrillic, Vietnamese with 7 weights (proportional) or 5 weights (monospace).<br />
* {{AUR|ttf-monapo}} - Japanese fonts to show [[wikipedia:2channel_Shift_JIS_art|2channel Shift JIS art]] properly.<br />
<br />
===== Korean =====<br />
<br />
* {{Pkg|adobe-source-han-sans-kr-fonts}} - Korean OpenType/CFF fonts<br />
* {{Pkg|ttf-baekmuk}} - Collection of Korean TrueType fonts<br />
* {{AUR|ttf-nanum}} - Nanum series TrueType fonts<br />
* {{AUR|ttf-nanumgothic_coding}} - Nanum series fixed width TrueType fonts<br />
* {{AUR|ttf-d2coding}} - D2Coding fixed width TrueType font made by Naver<br />
* {{AUR|spoqa-han-sans}} - Source Han Sans customized by Spoqa<br />
<br />
==== Cyrillic ====<br />
<br />
See also [[#Monospaced]], [[#Sans-serif]] and [[#Serif]].<br />
<br />
* {{AUR|otf-russkopis}} - A free OpenType cursive font for Cyrillic script<br />
* {{AUR|ttf-paratype}} - Font family by ParaType: sans, serif, mono, extended cyrillic and latin, OFL license<br />
<br />
==== Greek ====<br />
<br />
Almost all Unicode fonts contain the Greek character set (polytonic included). Some additional font packages, which might not contain the complete Unicode set but utilize high quality Greek (and Latin, of course) typefaces are:<br />
<br />
* {{AUR|otf-gfs}} - Selection of OpenType fonts from the Greek Font Society<br />
* {{AUR|ttf-mgopen}} - Professional TrueType fonts from Magenta<br />
<br />
==== Hebrew ====<br />
<br />
* {{AUR|culmus}} - Nice collection of free Hebrew fonts<br />
<br />
==== Indic ====<br />
<br />
* {{Pkg|ttf-freebanglafont}} - Font for Bangla<br />
* {{Pkg|ttf-indic-otf}} - Indic OpenType Fonts collection (containing ttf-freebanglafont)<br />
: (This one contains a "look of disapproval" that might be more to your liking than the {{Pkg|bdf-unifont}} one mentioned elsewhere in this document)<br />
* {{AUR|lohit-fonts}} - Indic TrueType fonts from Fedora Project (containing Oriya Fonts and more)<br />
* {{AUR|ttf-devanagarifonts}} - Devanagari TrueType fonts (contains 283 fonts)<br />
* {{AUR|ttf-gujrati-fonts}} - TTF Gujarati fonts (Avantika,Gopika,Shree768)<br />
* {{AUR|ttf-gurmukhi-fonts_sikhnet}} - TrueType Gurmukhi fonts (gurbaniwebthick,prabhki)<br />
* {{AUR|ttf-gurmukhi_punjabi}} - TTF Gurmukhi / Punjabi (contains 252 fonts)<br />
* {{AUR|ttf-kannada-font}} - Kannada, the language of Karnataka state in India<br />
* {{AUR|ttf-tamil}} - Tamil Unicode fonts<br />
<br />
==== Khmer ====<br />
<br />
* {{Pkg|ttf-khmer}} - Font covering glyphs for Khmer language<br />
* [https://www.google.com/fonts/specimen/Hanuman Hanuman] ({{AUR|ttf-google-fonts-git}})<br />
<br />
==== Lao ====<br />
<br />
* {{AUR|ttf-lao}} - Lao TTF font (Phetsarath_OT)<br />
* {{AUR|ttf-lao-fonts}} - Lao TTF fonts, both Unicode and non-Unicode for Windows<br />
<br />
==== Sinhala ====<br />
<br />
* {{AUR|ttf-lklug}} - Sinhala Unicode font<br />
<br />
==== Thai ====<br />
<br />
* {{Pkg|ttf-tlwg}} - Collection of scalable Thai fonts<br />
<br />
==== Tibetan ====<br />
<br />
* {{Pkg|ttf-tibetan-machine}} - Tibetan Machine TTFont<br />
<br />
=== Math ===<br />
<br />
* {{Pkg|font-mathematica}} - Mathematica fonts by Wolfram Research, Inc.<br />
* {{AUR|ttf-mathtype}} - MathType fonts<br />
* {{AUR|ttf-computer-modern-fonts}}, {{AUR|otf-cm-unicode}} - [[wikipedia:Computer Modern|Computer Modern]] (of TeX fame)<br />
* {{AUR|otf-xits}} - An OpenType implementation of [[Wikipedia:STIX Fonts project|STIX Fonts]] with math support<br />
<br />
=== Microsoft fonts ===<br />
<br />
See [[Microsoft fonts]].<br />
<br />
=== Apple OS X fonts ===<br />
<br />
* {{AUR|ttf-mac-fonts}} - Mac OS X TrueType fonts<br />
<br />
=== Monospaced ===<br />
<br />
Here are some suggestions. Every user has their own favorite, so experiment to find yours. <br />
If you are in a hurry, you read Dan Benjamin's blog post: [http://hivelogic.com/articles/top-10-programming-fonts ''Top 10 Programming Fonts''].<br />
<br />
Here is a long list of fonts by Trevor Lowing: http://www.lowing.org/fonts/.<br />
<br />
A comparison with images on Slant: [http://www.slant.co/topics/67/~what-are-the-best-programming-fonts What are the best programming fonts?]<br />
<br />
And a Stack Overflow question with some images: [http://stackoverflow.com/questions/4689/recommended-fonts-for-programming Recommended fonts for programming]<br />
<br />
==== TrueType ====<br />
<br />
* [[Wikipedia:Andalé Mono|Andalé Mono]] ({{AUR|ttf-ms-fonts}})<br />
* [http://www.marksimonson.com/fonts/view/anonymous-pro Anonymous Pro] ({{pkg|ttf-anonymous-pro}}, included in {{AUR|ttf-google-fonts-git}})<br />
* [[Wikipedia:Bitstream Vera|Bitstream Vera Mono]] ({{Pkg|ttf-bitstream-vera}})<br />
* [[Wikipedia:Consolas|Consolas]] ({{AUR|ttf-vista-fonts}}) - Windows programming font<br />
* [[Wikipedia:Courier New|Courier New]] ({{AUR|ttf-ms-fonts}})<br />
* Cousine ({{AUR|ttf-chromeos-fonts}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Courier New (metric-compatible)<br />
* [[Wikipedia:DejaVu fonts|DejaVu Sans Mono]] ({{Pkg|ttf-dejavu}}) - Unicode<br />
* [[Wikipedia:Droid (font)|Droid Sans Mono]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-git}})<br />
* [https://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released Envy Code R] ({{AUR|ttf-envy-code-r}})<br />
* Fantasque Sans Mono ({{AUR|ttf-fantasque-sans}} or {{AUR|ttf-fantasque-sans-git}})<br />
* [[Wikipedia:GNU FreeFont|FreeMono]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [[Wikipedia:Inconsolata|Inconsolata]] ({{Pkg|ttf-inconsolata}}, included in {{AUR|ttf-google-fonts-git}}) - Excellent programming font<br />
* [[Wikipedia:Inconsolata|Inconsolata-g]] ({{AUR|ttf-inconsolata-g}}) - adds some programmer-friendly modifications<br />
* [[Wikipedia:Liberation fonts|Liberation Mono]] ({{Pkg|ttf-liberation}}) - Replacement for Courier New, based on Cousine (metric-compatible)<br />
* [[Wikipedia:Lucida Typewriter|Lucida Typewriter]] (included in package {{AUR|jre}})<br />
* [[Wikipedia:Monaco (typeface)|Monaco]] ({{AUR|ttf-monaco}}) - Popular programming font on OSX/Textmate<br />
* Monofur ({{AUR|ttf-monofur}})<br />
* [[Wikipedia:Source_Code_Pro|Source Code Pro]] ({{pkg|adobe-source-code-pro-fonts}})<br />
<br />
==== Bitmap ====<br />
<br />
* Default 8x16<br />
* Dina ({{Pkg|dina-font}})<br />
* [http://font.gohu.org/ Gohu] ({{AUR|gohufont}})<br />
* Lime ({{Pkg|artwiz-fonts}})<br />
* [[Wikipedia:ProFont|ProFont]] ({{Pkg|profont}})<br />
* [[Wikipedia:Proggy Programming Fonts|Proggy Programming Fonts]] ({{AUR|proggyfonts}})<br />
* Tamsyn ({{Pkg|tamsyn-font}})<br />
* [http://terminus-font.sourceforge.net/ Terminus] ({{Pkg|terminus-font}})<br />
* [https://github.com/lucy/tewi-font Tewi] ({{AUR|bdf-tewi-git}})<br />
* Unifont (glyphs like (look of disapproval)) ({{Pkg|bdf-unifont}})<br />
<br />
=== Sans-serif ===<br />
<br />
* [http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=andika Andika] ({{AUR|ttf-andika}})<br />
* [[Wikipedia:Arial|Arial]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:Arial Black|Arial Black]] ({{AUR|ttf-ms-fonts}})<br />
* Arimo ({{AUR|ttf-chromeos-fonts}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Arial (metric-compatible)<br />
* [[Wikipedia:Calibri|Calibri]] ({{AUR|ttf-vista-fonts}})<br />
* [[Wikipedia:Candara|Candara]] ({{AUR|ttf-vista-fonts}})<br />
* [[Wikipedia:Corbel (typeface)|Corbel]] ({{AUR|ttf-vista-fonts}})<br />
* [[Wikipedia:DejaVu fonts|DejaVu Sans]] ({{Pkg|ttf-dejavu}}) - Unicode<br />
* [[Wikipedia:Droid (font)|Droid Sans]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-git}})<br />
* [[Wikipedia:GNU FreeFont|FreeSans]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [[Wikipedia:Impact (typeface)|Impact]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:Liberation fonts|Liberation Sans]] ({{Pkg|ttf-liberation}}) Replacement for Arial, based on Arimo (metric-compatible)<br />
* [[Wikipedia:Linux Libertine|Linux Biolinum]] ({{Pkg|ttf-linux-libertine}})<br />
* [[Wikipedia:Lucida Sans|Lucida Sans]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:Microsoft Sans Serif|Microsoft Sans Serif]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:PT Sans|PT Sans]] ({{AUR|ttf-google-fonts-git}}) - 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic<br />
* [[Wikipedia:Source Sans Pro|Source Sans Pro]] ({{pkg|adobe-source-sans-pro-fonts}})<br />
* [[Wikipedia:Tahoma (typeface)|Tahoma]] ({{AUR|ttf-tahoma}})<br />
* [[Wikipedia:Trebuchet MS|Trebuchet]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:Ubuntu Font Family|Ubuntu Font Family]] ({{Pkg|ttf-ubuntu-font-family}})<br />
* [[Wikipedia:Verdana|Verdana]] ({{AUR|ttf-ms-fonts}})<br />
<br />
=== Script ===<br />
<br />
* [[Wikipedia:Comic Sans|Comic Sans]] ({{AUR|ttf-ms-fonts}})<br />
<br />
=== Serif ===<br />
<br />
* [[Wikipedia:Cambria (typeface)|Cambria]] ({{AUR|ttf-vista-fonts}})<br />
* [[Wikipedia:Constantia (typeface)|Constantia]] ({{AUR|ttf-vista-fonts}})<br />
* [[Wikipedia:DejaVu fonts|DejaVu Serif]] ({{Pkg|ttf-dejavu}}) - Unicode<br />
* [[Wikipedia:Droid (font)|Droid Serif]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-git}})<br />
* [[Wikipedia:GNU FreeFont|FreeSerif]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [[Wikipedia:Gentium|Gentium]] ({{Pkg|ttf-gentium}}) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet<br />
* [[Wikipedia:Georgia (typeface)|Georgia]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:Liberation fonts|Liberation Serif]] ({{Pkg|ttf-liberation}}) - Replacement for Times New Roman, based on Tinos (metric-compatible)<br />
* [[Wikipedia:Linux Libertine|Linux Libertine]] ({{Pkg|ttf-linux-libertine}}) - Unicode: Latin, Greek, Cyrillic, Hebrew<br />
* [[Wikipedia:Times New Roman|Times New Roman]] ({{AUR|ttf-ms-fonts}})<br />
* Tinos ({{AUR|ttf-chromeos-fonts}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Times New Roman (metric-compatible)<br />
<br />
=== Unsorted ===<br />
<br />
{{Style|This section should be absorbed into the Monospace/Serif/Sans-Serif structure}}<br />
<br />
* {{AUR|ttf-google-fonts-git}} - a huge collection of free fonts (including ubuntu, inconsolata, droid, etc.) - Note: Your font dialog might get very long as >100 fonts will be added.<br />
* {{Pkg|ttf-mph-2b-damase}} - Covers full plane 1 and several scripts<br />
* {{Pkg|ttf-symbola}} - Provides emoji and many many other symbols<br />
* {{Pkg|font-bh-ttf}} - X.Org Luxi fonts<br />
* {{Pkg|ttf-cheapskate}} - Font collection from ''dustismo.com''<br />
* {{Pkg|ttf-junicode}} - Junius font containing almost complete medieval latin script glyphs<br />
* {{Pkg|xorg-fonts-type1}} - IBM Courier and Adobe Utopia sets of [[Wikipedia:PostScript fonts|PostScript fonts]]<br />
* {{AUR|all-repository-fonts}} - Meta package for all fonts in the official repositories.<br />
<br />
== Fallback font order with X11 ==<br />
<br />
Fontconfig automatically chooses a font that matches the current requirement. That is to say, if one is looking at a window containing English and Chinese for example, it will switch to another font for the Chinese text if the default one does not support it.<br />
<br />
Fontconfig lets every user configure the order they want via {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}.<br />
If you want a particular Chinese font to be selected after your favorite Serif font, your file would look like this:<br />
<br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Your favorite Latin Serif font name</family><br />
<family>Your Chinese font name</family><br />
</prefer><br />
</alias><br />
</fontconfig><br />
<br />
{{Tip|If you use a Chinese locale, set {{ic|LC_LANG}} to {{ic|und}} to make this work. Otherwise both English and Chinese text will be rendered in the Chinese font.}}<br />
<br />
You can add a section for Sans-serif and monospace as well. For more informations, have a look at the fontconfig manual.<br />
<br />
== Font alias ==<br />
<br />
There are several font aliases which represent other fonts in order that applications may use similar fonts. The most common aliases are: {{ic|serif}} for a font of the serif type (e.g. DejaVu Serif); {{ic|sans-serif}} for a font of the sans-serif type (e.g. DejaVu Sans); and {{ic|monospace}} for a monospaced font (e.g. DejaVu Sans Mono). However, the fonts which these aliases represent may vary and the relationship is often not shown in font management tools, such as those found in [[KDE]] and other [[desktop environments]].<br />
<br />
To reverse an alias and find which font it is representing, run:<br />
<br />
{{hc|$ fc-match monospace|<br />
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"<br />
}}<br />
<br />
In this case, {{ic|DejaVuSansMono.ttf}} is the font represented by the monospace alias.<br />
<br />
== Tips and tricks ==<br />
<br />
=== List all installed fonts ===<br />
<br />
You can use the following command to list all installed fonts that are available on your system. <br />
<br />
$ fc-list<br />
<br />
=== Set terminal font on-the-fly ===<br />
<br />
{{Expansion|Which terminals specifically support this method? Where is the documentation for the escape codes?}}<br />
<br />
For terminal emulators that use {{ic|Xresources}}, fonts can be set by using escape sequences. Specifically, echo {{ic|\033]710;$font\007}} to change the normal font ({{ic|*font}} in {{ic|~/.Xresources}}), and replace {{ic|710}} with {{ic|711}}, {{ic|712}}, and {{ic|713}} to change the {{ic|*boldFont}}, {{ic|*italicFont}}, and {{ic|*boldItalicFont}}, respectively.<br />
<br />
{{ic|$font}} can be anything the terminal emulator will support.<br />
<br />
=== Application-specific font cache ===<br />
<br />
Matplotlib ({{pkg|python-matplotlib}} or {{pkg|python2-matplotlib}}) uses its own font cache, so after updating fonts, be sure to remove {{ic|$HOME/.matplotlib/fontList.cache}}, <br />
{{ic|$HOME/.cache/matplotlib/fontList.cache}}, {{ic|$HOME/.sage/matplotlib-1.2.1/fontList.cache}}, etc. so it will regenerate its cache and find the new fonts [http://matplotlib.1069221.n5.nabble.com/getting-matplotlib-to-recognize-a-new-font-td40500.html].<br />
<br />
== See also ==<br />
<br />
* [http://behdad.org/text/ State of Text Rendering]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Fonts&diff=419267Fonts2016-02-06T09:01:18Z<p>Sushi Dude: /* Unsorted */ Use hyphen-minus instead of em dash.</p>
<hr />
<div>[[Category:Fonts]]<br />
[[cs:Fonts]]<br />
[[de:Schriftarten]]<br />
[[es:Fonts]]<br />
[[it:Fonts]]<br />
[[ja:フォント]]<br />
[[ru:Fonts]]<br />
[[tr:Yazıtipleri]]<br />
[[zh-CN:Fonts]]<br />
[[zh-TW:Fonts]]<br />
{{Related articles start}}<br />
{{Related|Font configuration}}<br />
{{Related|Infinality}}<br />
{{Related|Java Runtime Environment Fonts}}<br />
{{Related|Microsoft fonts}}<br />
{{Related articles end}}<br />
<br />
From [[Wikipedia:Computer font|Wikipedia]]:<br />
:''A computer font (or font) is an electronic data file containing a set of glyphs, characters, or symbols such as dingbats.''<br />
<br />
Note that certain font licenses may impose some legal limitations.<br />
<br />
== Font formats ==<br />
<br />
Most computer fonts used today are in either ''bitmap'' or ''outline'' data formats. <br />
;Bitmap fonts: Consist of a matrix of dots or pixels representing the image of each glyph in each face and size.<br />
;Outline or ''vector'' fonts: Use Bézier curves, drawing instructions and mathematical formulae to describe each glyph, which make the character outlines scalable to any size.<br />
<br />
=== Common extensions ===<br />
<br />
* {{ic|bdf}} and {{ic|bdf.gz}} – bitmap fonts, ''b''itmap ''d''istribution ''f''ormat and gzip compressed {{ic|bdf}}<br />
* {{ic|pcf}} and {{ic|pcf.gz}} – bitmaps, ''p''ortable ''c''ompiled ''f''ont and gzip compressed {{ic|pcf}}<br />
* {{ic|psf}}, {{ic|psfu}}, {{ic|psf.gz}} and {{ic|psfu.gz}} – bitmaps, ''P''C ''s''creen ''f''ont, ''P''C ''s''creen ''f''ont ''U''nicode and the gzipped versions (not compatible with X.Org)<br />
* {{ic|pfa}} and {{ic|pfb}} – outline fonts, ''P''ostScript ''f''ont ''A''SCII and ''P''ostScript ''f''ont ''b''inary. PostScript fonts carry built-in printer instructions.<br />
* {{ic|ttf}} – outline, ''T''rue''T''ype ''f''ont. Originally designed as a replacement for the PostScript fonts.<br />
* {{ic|otf}} – outline, ''O''pen''T''ype ''f''ont. TrueType with PostScript typographic instructions.<br />
<br />
For most purposes, the technical differences between TrueType and OpenType can be ignored, some fonts with a {{ic|ttf}} extension are actually OpenType fonts.<br />
<br />
=== Other formats ===<br />
<br />
The typesetting application, ''TeX,'' and its companion font software, ''Metafont,'' render characters using their own methods. Some of the file extensions used for fonts by these two programs are {{ic|*pk}}, {{ic|*gf}}, {{ic|mf}} and {{ic|vf}}.<br />
<br />
''FontForge,'' a font editing application, can store fonts in its native text-based format, {{ic|sfd}}, ''s''pline ''f''ont ''d''atabase.<br />
<br />
The [http://www.w3.org/TR/SVG/fonts.html SVG] format also has its own font description method.<br />
<br />
== Installation ==<br />
<br />
There are various methods for installing fonts.<br />
<br />
=== Pacman ===<br />
<br />
Fonts and font collections in the enabled repositories can be installed using [[pacman]]. Available fonts may be found by using:<br />
$ pacman -Ss font<br />
<br />
Or to search for {{ic|ttf}} fonts only:<br />
$ pacman -Ss ttf<br />
<br />
=== Creating a package ===<br />
<br />
You should give pacman the ability to manage your fonts, which is done by creating an Arch package. These can also be shared with the community in the [[AUR]]. Here is an example of how to create a basic package. To learn more about building packages, read [[PKGBUILD]].<br />
<br />
The family name of a font file can be aquired with the use of {{ic|fc-query}} for example: {{ic|fc-query -f '%{family[0]}\n' /path/to/file}}. The formatting is described in the FcPatternFormat(3) manual.<br />
<br />
{{bc|<nowiki><br />
pkgname=fontname-fonts<br />
pkgver=1.0<br />
pkgrel=1<br />
pkgdesc="Some description"<br />
arch=(any)<br />
depends=(fontconfig xorg-font-utils)<br />
source=("http://someurl.org/$pkgname.tar.bz2")<br />
install=$pkgname.install<br />
<br />
package() {<br />
install -Dm644 $pkgname/font.otf "$pkgdir"/usr/share/fonts/family_name/font.otf<br />
install -Dm644 $pkgname/font_bold.otf "$pkgdir"/usr/share/fonts/family_name/font_bold.otf<br />
}<br />
</nowiki>}}<br />
<br />
{{bc|<nowiki><br />
post_install() {<br />
fc-cache -s<br />
}<br />
<br />
post_upgrade() {<br />
post_install<br />
}<br />
<br />
post_remove() {<br />
post_install<br />
}<br />
</nowiki>}}<br />
<br />
=== Manual installation ===<br />
<br />
The recommended way of adding fonts that are not in the repositories to your system is described in [[#Creating a package]]. This gives pacman the ability to remove or update them at a later time. Fonts can alternately be installed manually as well.<br />
<br />
To install fonts system-wide (available for all users), move the folder to the {{ic|/usr/share/fonts/}} directory. The files need to be readable by every user, use [[chmod]] to set the correct permissions (i.e. at least {{ic|0444}} for files and {{ic|0555}} for directories). To install fonts for only a single user, use {{ic|~/.local/share/fonts}} ({{ic|~/.fonts/}} is now deprecated).<br />
<br />
For Xserver to load fonts directly (as opposed to the use of a ''font server'') the directory for your newly added font must be added with a FontPath entry. This entry is located in the ''Files'' section [[Xorg#Configuration|of your Xorg configuration file]] (e.g. {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/xorg.conf}}). See [[#Older applications]] for more detail.<br />
<br />
Then update the fontconfig font cache: (usually unnecessary as software using the fontconfig library do this.)<br />
<br />
$ fc-cache<br />
<br />
=== Older applications ===<br />
<br />
With older applications that do not support fontconfig (e.g. GTK+ 1.x applications, and {{ic|xfontsel}}) the index will need to be created in the font directory:<br />
<br />
$ mkfontscale<br />
$ mkfontdir<br />
<br />
Or to include more than one folder with one command:<br />
<br />
$ for dir in /font/dir1/ /font/dir2/; do xset +fp $dir; done && xset fp rehash<br />
<br />
Or if fonts were installed in a different sub-folders under the e.g. {{ic|/usr/share/fonts}}:<br />
<br />
$ for dir in * ; do if [ -d "$dir" ]; then cd "$dir";xset +fp "$PWD" ;mkfontscale; mkfontdir;cd .. ;fi; done && xset fp rehash<br />
<br />
At times the X server may fail to load the fonts directory and you will need to rescan all the {{ic|fonts.dir}} files:<br />
<br />
# xset +fp /usr/share/fonts/misc # Inform the X server of new directories<br />
# xset fp rehash # Forces a new rescan<br />
<br />
To check that the font(s) is included:<br />
<br />
$ xlsfonts | grep fontname<br />
<br />
{{note|Many packages will automatically configure Xorg to use the font upon installation. If that is the case with your font, this step is not necessary.}}<br />
<br />
This can also be set globally in {{ic|/etc/X11/xorg.conf}} or {{ic|/etc/X11/xorg.conf.d}}.<br />
<br />
Here is an example of the section that must be added to {{ic|/etc/X11/xorg.conf}}. Add or remove paths based on your particular font requirements.<br />
<br />
# Let X.Org know about the custom font directories<br />
Section "Files"<br />
FontPath "/usr/share/fonts/100dpi"<br />
FontPath "/usr/share/fonts/75dpi"<br />
FontPath "/usr/share/fonts/cantarell"<br />
FontPath "/usr/share/fonts/cyrillic"<br />
FontPath "/usr/share/fonts/encodings"<br />
FontPath "/usr/share/fonts/misc"<br />
FontPath "/usr/share/fonts/truetype"<br />
FontPath "/usr/share/fonts/TTF"<br />
FontPath "/usr/share/fonts/util"<br />
EndSection<br />
<br />
=== Pango Warnings ===<br />
<br />
When [http://www.pango.org/ Pango] is in use on your system it will read from [http://www.freedesktop.org/wiki/Software/fontconfig fontconfig] to sort out where to source fonts.<br />
<br />
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common'<br />
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'<br />
<br />
If you are seeing errors similar to this and/or seeing blocks instead of characters in your application then you need to add fonts and update the font cache. This example uses the {{Pkg|ttf-liberation}} fonts to illustrate the solution (after successful installation of the package) and runs as root to enable them system-wide.<br />
<br />
# fc-cache<br />
/usr/share/fonts: caching, new cache contents: 0 fonts, 3 dirs<br />
/usr/share/fonts/TTF: caching, new cache contents: 16 fonts, 0 dirs<br />
/usr/share/fonts/encodings: caching, new cache contents: 0 fonts, 1 dirs<br />
/usr/share/fonts/encodings/large: caching, new cache contents: 0 fonts, 0 dirs<br />
/usr/share/fonts/util: caching, new cache contents: 0 fonts, 0 dirs<br />
/var/cache/fontconfig: cleaning cache directory<br />
fc-cache: succeeded<br />
<br />
You can test for a default font being set like so:<br />
<br />
# fc-match<br />
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"<br />
<br />
== Console fonts ==<br />
<br />
{{Note|This section is about the [[Wikipedia:Linux console|Linux console]]. For an alternative console solutions offering more features (full Unicode fonts, modern graphics adapters etc.), see [[fbterm]], [[KMSCON]] or similar projects.}}<br />
<br />
By default, the [[Wikipedia:Virtual console|virtual console]] uses the kernel built-in font with a [[Wikipedia:CP437|CP437]] character set,<sup>[https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/vt/Makefile#n4]</sup> but this can be easily changed.<br />
<br />
The [[Wikipedia:Linux console|Linux console]] uses UTF-8 encoding by default, but because the standard VGA-compatible framebuffer is used, a console font is limited to either a standard 256, or 512 glyphs. If the font has more than 256 glyphs, the number of colours is reduced from 16 to 8. In order to assign correct symbol to be displayed to the given Unicode value, a special translation map, often called ''unimap'', is needed. Nowadays most of the console fonts have the ''unimap'' built-in, historically it had to be loaded separately.<br />
<br />
The {{Pkg|kbd}} package provides tools to change virtual console font and font mapping. Available fonts are saved in the {{ic|/usr/share/kbd/consolefonts/}} directory, those ending with ''.psfu'' or ''.psfu.gz'' have a Unicode translation map built-in.<br />
<br />
Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of {{ic|/usr/share/kbd/keymaps/}}, see [[Keyboard configuration in console]] for details.<br />
<br />
{{Note|Replacing the font can cause issues with programs that expect a standard VGA-style font, such as those using line drawing graphics.}}<br />
<br />
=== Previewing and testing ===<br />
<br />
{{Tip|An organized library of images for previewing is available: [http://alexandre.deverteuil.net/pages/consolefonts/ Linux console fonts screenshots].}}<br />
<br />
The available glyphs or letters in the font can also be viewed as a table with using ''showconsolefont'':<br />
<br />
$ showconsolefont<br />
<br />
The ''setfont'' utility may be used to temporarily change the font, so that the user can consider its permanent use. Just pass the name of the font (they are located in {{ic|/usr/share/kbd/consolefonts/}}). For example:<br />
<br />
$ setfont lat2-16 -m 8859-2<br />
<br />
Note that the font name is case-sensitive, so type it ''exactly'' as you see it. If the newly changed font is not suitable, a return to the default font with the following command (even if the console display is totally unreadable, this command will still work, just type the command "blindly"):<br />
<br />
$ setfont<br />
<br />
{{Note|''setfont'' only works on the console currently being used. Any other consoles, active or inactive, remain unaffected.}}<br />
<br />
=== Persistent configuration ===<br />
<br />
The {{ic|FONT}} variable in {{ic|/etc/vconsole.conf}} is used to set the font at boot, persistently for all consoles. See {{ic|man 5 vconsole.conf}} for details.<br />
<br />
For displaying characters such as ''Č, ž, đ, š'' or ''Ł, ę, ą, ś'' using the font {{ic|lat2-16.psfu.gz}}:<br />
<br />
{{hc|/etc/vconsole.conf|2=<br />
...<br />
FONT=lat2-16<br />
FONT_MAP=8859-2<br />
}}<br />
<br />
It means that second part of ISO/IEC 8859 characters are used with size 16. You can change font size using other values (e.g. {{ic|lat2-08}}). For the regions determined by 8859 specification, look at the [[wikipedia:ISO/IEC_8859#The_Parts_of_ISO.2FIEC_8859|Wikipedia table]].<br />
<br />
To use the specified font in early userspace, use the {{ic|consolefont}} hook in {{ic|/etc/mkinitcpio.conf}}. See [[Mkinitcpio#HOOKS]] for more information.<br />
<br />
If the fonts seems to not change on boot, or change only temporarily, it is most likely that they got reset when graphics driver was initialized and console was switched to framebuffer. To avoid this, load your graphics driver earlier. See for example [[Kernel mode setting#Early KMS start]], [https://bbs.archlinux.org/viewtopic.php?id=145765] or other ways to setup your framebuffer before {{ic|/etc/vconsole.conf}} is applied.<br />
<br />
== Font packages ==<br />
<br />
This is a selective list that includes many font packages from the [[AUR]] along with those in the official repositories. Fonts are tagged "Unicode" if they have wide Unicode support, see the project or Wikipedia pages for detail.<br />
<br />
Github user Ternstor has created a python script that generates HTML documents with PNG images of all the fonts in the AUR and the official repositories: [https://github.com/ternstor/distrofonts/blob/master/archfonts.py].<br />
<br />
=== Braille ===<br />
<br />
*{{Pkg|ttf-ubraille}} - Font containing Unicode symbols for ''braille''<br />
<br />
=== International users ===<br />
<br />
Applications and browsers select and display fonts depending upon fontconfig preferences and available font glyph for Unicode text. To list installed fonts for a particular language, issue a command {{ic|<nowiki>fc-list :lang="two letter language code"</nowiki>}}. For instance, to list installed Arabic fonts or fonts supporting Arabic glyph:<br />
{{hc|$ fc-list -f '%{file}\n' :lang&#61;ar|2=<br />
<nowiki><br />
/usr/share/fonts/TTF/FreeMono.ttf<br />
/usr/share/fonts/TTF/DejaVuSansCondensed.ttf<br />
/usr/share/fonts/truetype/custom/DroidKufi-Bold.ttf<br />
/usr/share/fonts/TTF/DejaVuSansMono.ttf<br />
/usr/share/fonts/TTF/FreeSerif.ttf<br />
</nowiki><br />
}}<br />
<br />
To properly render fonts for multilingual websites like Wikipedia or this Arch Linux wiki, install one of the following sets of packages:<br />
* Google's [http://www.google.com/get/noto/ Noto] is a font family that aims to support all languages. [[Install]] it with the {{Pkg|noto-fonts}}, {{Pkg|noto-fonts-cjk}} and {{Pkg|noto-fonts-emoji}} packages.<br />
* An alternative set of fonts which has a good coverage of languages is {{Pkg|ttf-freefont}} with {{Pkg|ttf-arphic-uming}} and {{Pkg|ttf-baekmuk}}.<br />
<br />
==== Arabic & Urdu ====<br />
<br />
* {{AUR|ttf-qurancomplex-fonts}} - Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah<br />
* {{AUR|ttf-amiri}} - A classical Arabic typeface in Naskh style poineered by Amiria Press<br />
* {{AUR|ttf-sil-lateef}} - Unicode Arabic font from SIL<br />
* {{AUR|ttf-sil-scheherazade}} - Unicode Arabic font from SIL<br />
* {{AUR|ttf-arabeyes-fonts}} - Collection of free Arabic fonts<br />
* {{AUR|ttf-urdufonts}} - Urdu fonts (Jameel Noori Nastaleeq (+kasheeda), Nafees Web Naskh, PDMS Saleem Quran Font) and font configuration to set Jameel Noori Nastaleeq as default font for Urdu<br />
<br />
==== Persian ====<br />
<br />
* {{AUR|ttf-irfonts}} - Official I.R. Iran Supreme Council of Information and Communication Technology (SCICT) standard persian fonts series<br />
* {{AUR|ttf-borna}} - Borna Rayaneh Persian B font series<br />
* {{AUR|ttf-x2}} - X Series 2 fonts are built on freely available fonts and extended to support Persian, Arabic, Urdu, Pashto, Dari, Uzbek, Kurdish, Uighur, old Turkish (Ottoman) and modern Turkish (Roman).<br />
* {{AUR|ttf-iran-nastaliq}} - An Unicode calligraphic font published by the High Council of Informatics of Iran<br />
<br />
==== Burmese ====<br />
<br />
* {{AUR|ttf-my-paduk}} - Padauk font for Myanmar/Birmania<br />
* {{AUR|ttf-myanmar-fonts}} - 121 Fonts from myordbok.com<br />
<br />
==== Chinese, Japanese, Korean, Vietnamese ====<br />
<br />
===== Pan-CJK =====<br />
<br />
* {{Pkg|adobe-source-han-sans-otc-fonts}} - Large collection of fonts which comprehensively support Simplified Chinese, Traditional Chinese, Japanese, and Korean, with a consistent design and look.<br />
<br />
===== (Mainly) Chinese =====<br />
<br />
* {{Pkg|adobe-source-han-sans-cn-fonts}} - Simplified Chinese OpenType/CFF fonts<br />
* {{Pkg|adobe-source-han-sans-tw-fonts}} - Traditional Chinese OpenType/CFF fonts<br />
* {{Pkg|wqy-microhei}} - A Sans-Serif style high quality CJKV outline font.<br />
* {{Pkg|wqy-zenhei}} - Hei Ti Style (sans-serif) Chinese Outline font embedded with bitmapped Song Ti (also supporting Japanese (partial) and Korean characters).<br />
* {{Pkg|ttf-arphic-ukai}} - ''Kaiti'' (brush stroke) Unicode font (enabling anti-aliasing is suggested)<br />
* {{Pkg|ttf-arphic-uming}} - ''Mingti'' (printed) Unicode font<br />
* {{Pkg|opendesktop-fonts}} - ''New Sung'' font, previously is ttf-fireflysung package<br />
* {{Pkg|wqy-bitmapfont}} - Bitmapped Song Ti (serif) Chinese font<br />
* {{Pkg|ttf-hannom}} - Chinese and Vietnamese TrueType font<br />
* {{AUR|ttf-i.bming}} - CJK serif font that emphasis on an old-style typeface<br />
* {{AUR|ttf-tw}} - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan<br />
<br />
===== Japanese =====<br />
<br />
* {{Pkg|adobe-source-han-sans-jp-fonts}} - Japanese OpenType/CFF fonts<br />
* {{Pkg|otf-ipafont}} - Formal style Japanese Gothic (sans-serif) and Mincho (serif) fonts set; one of the highest quality open source font. Default of openSUSE-ja.<br />
* {{Pkg|ttf-sazanami}} - Japanese free TrueType font. This is outdated and not maintained any more, but may be defined as a fallback font on several environments.<br />
* {{Pkg|ttf-hanazono}} - A free Japanese kanji font, style Mincho (serif).<br />
* {{AUR|ttf-vlgothic}} - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux<br />
* {{AUR|ttf-mplus}} - Modern Gothic style Japanese outline fonts. It includes all of Japanese Hiragana/Katakana, Basic Latin, Latin-1 Supplement, Latin Extended-A, IPA Extensions and most of Japanese Kanji, Greek, Cyrillic, Vietnamese with 7 weights (proportional) or 5 weights (monospace).<br />
* {{AUR|ttf-monapo}} - Japanese fonts to show [[wikipedia:2channel_Shift_JIS_art|2channel Shift JIS art]] properly.<br />
<br />
===== Korean =====<br />
<br />
* {{Pkg|adobe-source-han-sans-kr-fonts}} - Korean OpenType/CFF fonts<br />
* {{Pkg|ttf-baekmuk}} - Collection of Korean TrueType fonts<br />
* {{AUR|ttf-nanum}} - Nanum series TrueType fonts<br />
* {{AUR|ttf-nanumgothic_coding}} - Nanum series fixed width TrueType fonts<br />
* {{AUR|ttf-d2coding}} - D2Coding fixed width TrueType font made by Naver<br />
* {{AUR|spoqa-han-sans}} - Source Han Sans customized by Spoqa<br />
<br />
==== Cyrillic ====<br />
<br />
See also [[#Monospaced]], [[#Sans-serif]] and [[#Serif]].<br />
<br />
* {{AUR|otf-russkopis}} - A free OpenType cursive font for Cyrillic script<br />
* {{AUR|ttf-paratype}} - Font family by ParaType: sans, serif, mono, extended cyrillic and latin, OFL license<br />
<br />
==== Greek ====<br />
<br />
Almost all Unicode fonts contain the Greek character set (polytonic included). Some additional font packages, which might not contain the complete Unicode set but utilize high quality Greek (and Latin, of course) typefaces are:<br />
<br />
* {{AUR|otf-gfs}} - Selection of OpenType fonts from the Greek Font Society<br />
* {{AUR|ttf-mgopen}} - Professional TrueType fonts from Magenta<br />
<br />
==== Hebrew ====<br />
<br />
* {{AUR|culmus}} - Nice collection of free Hebrew fonts<br />
<br />
==== Indic ====<br />
<br />
* {{Pkg|ttf-freebanglafont}} - Font for Bangla<br />
* {{Pkg|ttf-indic-otf}} - Indic OpenType Fonts collection (containing ttf-freebanglafont)<br />
: (This one contains a "look of disapproval" that might be more to your liking than the {{Pkg|bdf-unifont}} one mentioned elsewhere in this document)<br />
* {{AUR|lohit-fonts}} - Indic TrueType fonts from Fedora Project (containing Oriya Fonts and more)<br />
* {{AUR|ttf-devanagarifonts}} - Devanagari TrueType fonts (contains 283 fonts)<br />
* {{AUR|ttf-gujrati-fonts}} - TTF Gujarati fonts (Avantika,Gopika,Shree768)<br />
* {{AUR|ttf-gurmukhi-fonts_sikhnet}} - TrueType Gurmukhi fonts (gurbaniwebthick,prabhki)<br />
* {{AUR|ttf-gurmukhi_punjabi}} - TTF Gurmukhi / Punjabi (contains 252 fonts)<br />
* {{AUR|ttf-kannada-font}} - Kannada, the language of Karnataka state in India<br />
* {{AUR|ttf-tamil}} - Tamil Unicode fonts<br />
<br />
==== Khmer ====<br />
<br />
* {{Pkg|ttf-khmer}} - Font covering glyphs for Khmer language<br />
* [https://www.google.com/fonts/specimen/Hanuman Hanuman] ({{AUR|ttf-google-fonts-git}})<br />
<br />
==== Lao ====<br />
<br />
* {{AUR|ttf-lao}} - Lao TTF font (Phetsarath_OT)<br />
* {{AUR|ttf-lao-fonts}} - Lao TTF fonts, both Unicode and non-Unicode for Windows<br />
<br />
==== Sinhala ====<br />
<br />
* {{AUR|ttf-lklug}} - Sinhala Unicode font<br />
<br />
==== Thai ====<br />
<br />
* {{Pkg|ttf-tlwg}} - Collection of scalable Thai fonts<br />
<br />
==== Tibetan ====<br />
<br />
* {{Pkg|ttf-tibetan-machine}} - Tibetan Machine TTFont<br />
<br />
=== Math ===<br />
<br />
* {{Pkg|font-mathematica}} - Mathematica fonts by Wolfram Research, Inc.<br />
* {{AUR|ttf-mathtype}} - MathType fonts<br />
* {{AUR|ttf-computer-modern-fonts}}, {{AUR|otf-cm-unicode}} - [[wikipedia:Computer Modern|Computer Modern]] (of TeX fame)<br />
* {{AUR|otf-xits}} - An OpenType implementation of [[Wikipedia:STIX Fonts project|STIX Fonts]] with math support<br />
<br />
=== Microsoft fonts ===<br />
<br />
See [[Microsoft fonts]].<br />
<br />
=== Apple OS X fonts ===<br />
<br />
* {{AUR|ttf-mac-fonts}} - Mac OS X TrueType fonts<br />
<br />
=== Monospaced ===<br />
<br />
Here are some suggestions. Every user has their own favorite, so experiment to find yours. <br />
If you are in a hurry, you read Dan Benjamin's blog post: [http://hivelogic.com/articles/top-10-programming-fonts ''Top 10 Programming Fonts''].<br />
<br />
Here is a long list of fonts by Trevor Lowing: http://www.lowing.org/fonts/.<br />
<br />
A comparison with images on Slant: [http://www.slant.co/topics/67/~what-are-the-best-programming-fonts What are the best programming fonts?]<br />
<br />
And a Stack Overflow question with some images: [http://stackoverflow.com/questions/4689/recommended-fonts-for-programming Recommended fonts for programming]<br />
<br />
==== TrueType ====<br />
<br />
* [[Wikipedia:Andalé Mono|Andalé Mono]] ({{AUR|ttf-ms-fonts}})<br />
* [http://www.marksimonson.com/fonts/view/anonymous-pro Anonymous Pro] ({{pkg|ttf-anonymous-pro}}, included in {{AUR|ttf-google-fonts-git}})<br />
* [[Wikipedia:Bitstream Vera|Bitstream Vera Mono]] ({{Pkg|ttf-bitstream-vera}})<br />
* [[Wikipedia:Consolas|Consolas]] ({{AUR|ttf-vista-fonts}}) - Windows programming font<br />
* [[Wikipedia:Courier New|Courier New]] ({{AUR|ttf-ms-fonts}})<br />
* Cousine ({{AUR|ttf-chromeos-fonts}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Courier New (metric-compatible)<br />
* [[Wikipedia:DejaVu fonts|DejaVu Sans Mono]] ({{Pkg|ttf-dejavu}}) - Unicode<br />
* [[Wikipedia:Droid (font)|Droid Sans Mono]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-git}})<br />
* [https://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released Envy Code R] ({{AUR|ttf-envy-code-r}})<br />
* Fantasque Sans Mono ({{AUR|ttf-fantasque-sans}} or {{AUR|ttf-fantasque-sans-git}})<br />
* [[Wikipedia:GNU FreeFont|FreeMono]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [[Wikipedia:Inconsolata|Inconsolata]] ({{Pkg|ttf-inconsolata}}, included in {{AUR|ttf-google-fonts-git}}) - Excellent programming font<br />
* [[Wikipedia:Inconsolata|Inconsolata-g]] ({{AUR|ttf-inconsolata-g}}) - adds some programmer-friendly modifications<br />
* [[Wikipedia:Liberation fonts|Liberation Mono]] ({{Pkg|ttf-liberation}}) - Replacement for Courier New, based on Cousine (metric-compatible)<br />
* [[Wikipedia:Lucida Typewriter|Lucida Typewriter]] (included in package {{AUR|jre}})<br />
* [[Wikipedia:Monaco (typeface)|Monaco]] ({{AUR|ttf-monaco}}) - Popular programming font on OSX/Textmate<br />
* Monofur ({{AUR|ttf-monofur}})<br />
* [[Wikipedia:Source_Code_Pro|Source Code Pro]] ({{pkg|adobe-source-code-pro-fonts}})<br />
<br />
==== Bitmap ====<br />
<br />
* Default 8x16<br />
* Dina ({{Pkg|dina-font}})<br />
* [http://font.gohu.org/ Gohu] ({{AUR|gohufont}})<br />
* Lime ({{Pkg|artwiz-fonts}})<br />
* [[Wikipedia:ProFont|ProFont]] ({{Pkg|profont}})<br />
* [[Wikipedia:Proggy Programming Fonts|Proggy Programming Fonts]] ({{AUR|proggyfonts}})<br />
* Tamsyn ({{Pkg|tamsyn-font}})<br />
* [http://terminus-font.sourceforge.net/ Terminus] ({{Pkg|terminus-font}})<br />
* [https://github.com/lucy/tewi-font Tewi] ({{AUR|bdf-tewi-git}})<br />
* Unifont (glyphs like (look of disapproval)) ({{Pkg|bdf-unifont}})<br />
<br />
=== Sans-serif ===<br />
<br />
* [http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=andika Andika] ({{AUR|ttf-andika}})<br />
* [[Wikipedia:Arial|Arial]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:Arial Black|Arial Black]] ({{AUR|ttf-ms-fonts}})<br />
* Arimo ({{AUR|ttf-chromeos-fonts}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Arial (metric-compatible)<br />
* [[Wikipedia:Calibri|Calibri]] ({{AUR|ttf-vista-fonts}})<br />
* [[Wikipedia:Candara|Candara]] ({{AUR|ttf-vista-fonts}})<br />
* [[Wikipedia:Corbel (typeface)|Corbel]] ({{AUR|ttf-vista-fonts}})<br />
* [[Wikipedia:DejaVu fonts|DejaVu Sans]] ({{Pkg|ttf-dejavu}}) - Unicode<br />
* [[Wikipedia:Droid (font)|Droid Sans]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-git}})<br />
* [[Wikipedia:GNU FreeFont|FreeSans]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [[Wikipedia:Impact (typeface)|Impact]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:Liberation fonts|Liberation Sans]] ({{Pkg|ttf-liberation}}) Replacement for Arial, based on Arimo (metric-compatible)<br />
* [[Wikipedia:Linux Libertine|Linux Biolinum]] ({{Pkg|ttf-linux-libertine}})<br />
* [[Wikipedia:Lucida Sans|Lucida Sans]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:Microsoft Sans Serif|Microsoft Sans Serif]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:PT Sans|PT Sans]] ({{AUR|ttf-google-fonts-git}}) - 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic<br />
* [[Wikipedia:Source Sans Pro|Source Sans Pro]] ({{pkg|adobe-source-sans-pro-fonts}})<br />
* [[Wikipedia:Tahoma (typeface)|Tahoma]] ({{AUR|ttf-tahoma}})<br />
* [[Wikipedia:Trebuchet MS|Trebuchet]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:Ubuntu Font Family|Ubuntu Font Family]] ({{Pkg|ttf-ubuntu-font-family}})<br />
* [[Wikipedia:Verdana|Verdana]] ({{AUR|ttf-ms-fonts}})<br />
<br />
=== Script ===<br />
<br />
* [[Wikipedia:Comic Sans|Comic Sans]] ({{AUR|ttf-ms-fonts}})<br />
<br />
=== Serif ===<br />
<br />
* [[Wikipedia:Cambria (typeface)|Cambria]] ({{AUR|ttf-vista-fonts}})<br />
* [[Wikipedia:Constantia (typeface)|Constantia]] ({{AUR|ttf-vista-fonts}})<br />
* [[Wikipedia:DejaVu fonts|DejaVu Serif]] ({{Pkg|ttf-dejavu}}) - Unicode<br />
* [[Wikipedia:Droid (font)|Droid Serif]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-git}})<br />
* [[Wikipedia:GNU FreeFont|FreeSerif]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [[Wikipedia:Gentium|Gentium]] ({{Pkg|ttf-gentium}}) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet<br />
* [[Wikipedia:Georgia (typeface)|Georgia]] ({{AUR|ttf-ms-fonts}})<br />
* [[Wikipedia:Liberation fonts|Liberation Serif]] ({{Pkg|ttf-liberation}}) - Replacement for Times New Roman, based on Tinos (metric-compatible)<br />
* [[Wikipedia:Linux Libertine|Linux Libertine]] ({{Pkg|ttf-linux-libertine}}) - Unicode: Latin, Greek, Cyrillic, Hebrew<br />
* [[Wikipedia:Times New Roman|Times New Roman]] ({{AUR|ttf-ms-fonts}})<br />
* Tinos ({{AUR|ttf-chromeos-fonts}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Times New Roman (metric-compatible)<br />
<br />
=== Unsorted ===<br />
<br />
{{Style|This section should be absorbed into the Monospace/Serif/Sans-Serif structure}}<br />
<br />
* {{AUR|ttf-google-fonts-git}} - a huge collection of free fonts (including ubuntu, inconsolata, droid, etc.) - Note: Your font dialog might get very long as >100 fonts will be added.<br />
* {{Pkg|ttf-mph-2b-damase}} - Covers full plane 1 and several scripts<br />
* {{Pkg|ttf-symbola}} - Provides emoji and many many other symbols<br />
* {{Pkg|font-bh-ttf}} - X.Org Luxi fonts<br />
* {{Pkg|ttf-cheapskate}} - Font collection from ''dustismo.com''<br />
* {{Pkg|ttf-junicode}} - Junius font containing almost complete medieval latin script glyphs<br />
* {{Pkg|xorg-fonts-type1}} - IBM Courier and Adobe Utopia sets of [[Wikipedia:PostScript fonts|PostScript fonts]]<br />
<br />
== Fallback font order with X11 ==<br />
<br />
Fontconfig automatically chooses a font that matches the current requirement. That is to say, if one is looking at a window containing English and Chinese for example, it will switch to another font for the Chinese text if the default one does not support it.<br />
<br />
Fontconfig lets every user configure the order they want via {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}.<br />
If you want a particular Chinese font to be selected after your favorite Serif font, your file would look like this:<br />
<br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<alias><br />
<family>serif</family><br />
<prefer><br />
<family>Your favorite Latin Serif font name</family><br />
<family>Your Chinese font name</family><br />
</prefer><br />
</alias><br />
</fontconfig><br />
<br />
{{Tip|If you use a Chinese locale, set {{ic|LC_LANG}} to {{ic|und}} to make this work. Otherwise both English and Chinese text will be rendered in the Chinese font.}}<br />
<br />
You can add a section for Sans-serif and monospace as well. For more informations, have a look at the fontconfig manual.<br />
<br />
== Font alias ==<br />
<br />
There are several font aliases which represent other fonts in order that applications may use similar fonts. The most common aliases are: {{ic|serif}} for a font of the serif type (e.g. DejaVu Serif); {{ic|sans-serif}} for a font of the sans-serif type (e.g. DejaVu Sans); and {{ic|monospace}} for a monospaced font (e.g. DejaVu Sans Mono). However, the fonts which these aliases represent may vary and the relationship is often not shown in font management tools, such as those found in [[KDE]] and other [[desktop environments]].<br />
<br />
To reverse an alias and find which font it is representing, run:<br />
<br />
{{hc|$ fc-match monospace|<br />
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"<br />
}}<br />
<br />
In this case, {{ic|DejaVuSansMono.ttf}} is the font represented by the monospace alias.<br />
<br />
== Tips and tricks ==<br />
<br />
=== List all installed fonts ===<br />
<br />
You can use the following command to list all installed fonts that are available on your system. <br />
<br />
$ fc-list<br />
<br />
=== Set terminal font on-the-fly ===<br />
<br />
{{Expansion|Which terminals specifically support this method? Where is the documentation for the escape codes?}}<br />
<br />
For terminal emulators that use {{ic|Xresources}}, fonts can be set by using escape sequences. Specifically, echo {{ic|\033]710;$font\007}} to change the normal font ({{ic|*font}} in {{ic|~/.Xresources}}), and replace {{ic|710}} with {{ic|711}}, {{ic|712}}, and {{ic|713}} to change the {{ic|*boldFont}}, {{ic|*italicFont}}, and {{ic|*boldItalicFont}}, respectively.<br />
<br />
{{ic|$font}} can be anything the terminal emulator will support.<br />
<br />
=== Application-specific font cache ===<br />
<br />
Matplotlib ({{pkg|python-matplotlib}} or {{pkg|python2-matplotlib}}) uses its own font cache, so after updating fonts, be sure to remove {{ic|$HOME/.matplotlib/fontList.cache}}, <br />
{{ic|$HOME/.cache/matplotlib/fontList.cache}}, {{ic|$HOME/.sage/matplotlib-1.2.1/fontList.cache}}, etc. so it will regenerate its cache and find the new fonts [http://matplotlib.1069221.n5.nabble.com/getting-matplotlib-to-recognize-a-new-font-td40500.html].<br />
<br />
== See also ==<br />
<br />
* [http://behdad.org/text/ State of Text Rendering]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Environment_variables&diff=412685Environment variables2015-12-17T19:29:03Z<p>Sushi Dude: /* Per user */ Correct broken link.</p>
<hr />
<div>[[Category:System administration]]<br />
[[de:Umgebungsvariablen]]<br />
[[ja:環境変数]]<br />
[[ru:Environment variables]]<br />
[[zh-cn:Environment variables]]<br />
An environment variable is a named object that contains data used by one or more applications. In simple terms, it is a variable with a name and a value. The value of an environmental variable can for example be the location of all executable files in the file system, the default editor that should be used, or the system locale settings. Users new to Linux may often find this way of managing settings a bit unmanageable. However, environment variables provide a simple way to share configuration settings between multiple applications and processes in Linux.<br />
<br />
== Utilities ==<br />
The {{Pkg|coreutils}} package contains the programs ''printenv'' and ''env''. To list the current environmental variables with values: <br />
<br />
$ printenv<br />
<br />
{{Note|Some environment variables are user-specific. Check by comparing the outputs of ''printenv'' as an unprivileged user and as ''root''.}}<br />
<br />
The {{ic|env}} utility can be used to run a command under a modified environment. The following example will launch ''xterm'' with the environment variable {{ic|EDITOR}} set to {{ic|vim}}. This will not affect the global environment variable {{ic|EDITOR}}.<br />
<br />
$ env EDITOR=vim xterm<br />
<br />
The [[Bash]] builtin ''set'' allows you to change the values of shell options and set the positional parameters, or to display the names and values of shell variables. For more information, see the ''set'' documentation: [http://www.gnu.org/software/bash/manual/bash.html#The-Set-Builtin].<br />
<br />
Each process stores their environment in the {{ic|/proc/$PID/environ}} file. This file contained each key value pair delimited by a nul character ({{ic|\x0}}). A more human readable format can be obtained with [[sed]], e.g. {{ic|sed 's:\x0:\n:g' /proc/$PID/environ}}.<br />
<br />
== Examples ==<br />
The following section lists a number of common environment variables used by a Linux system and describes their values.<br />
<br />
*{{ic|DE}} indicates the ''D''esktop ''E''nvironment being used. [[xdg-open]] will use it to choose more user-friendly file-opener application that desktop environment provides. Some packages need to be installed to use this feature. For [[GNOME]], that would be {{pkg|libgnome}}; for [[Xfce]] this is {{pkg|exo}}. Recognised values of {{ic|DE}} variable are: {{ic|gnome}}, {{ic|kde}}, {{ic|xfce}}, {{ic|lxde}} and {{ic|mate}}.<br />
<br />
:The {{ic|DE}} environment variable needs to be exported before starting the window manager. For example:<br />
<br />
{{hc|~/.xinitrc|2=<br />
export DE="xfce"<br />
exec openbox<br />
}}<br />
<br />
:This will make ''xdg-open'' use the more user-friendly ''exo-open'', because it assumes it is running inside Xfce. Use ''exo-preferred-applications'' for configuring.<br />
<br />
*{{ic|DESKTOP_SESSION}} is similar to {{ic|DE}}, but used in [[LXDE]] desktop enviroment: when {{ic|DESKTOP_SESSION}} is set to {{ic|LXDE}}, ''xdg-open'' will use ''pcmanfm'' file associations.<br />
<br />
*{{ic|PATH}} contains a colon-separated list of directories in which your system looks for executable files. When a regular command (e.g., ''ls'', ''rc-update'' or ''ic|emerge'') is interpreted by the shell (e.g., ''bash'' or ''zsh''), the shell looks for an executable file with the same name as your command in the listed directories, and executes it. To run executables that are not listed in {{ic|PATH}}, the absoute path to the executable must be given: {{ic|/bin/ls}}.<br />
<br />
{{Note|It is advised not to include the current working directory ({{ic|.}}) into your {{ic|PATH}} for security reasons, as it may trick the user to execute vicious commands.}}<br />
<br />
*{{ic|HOME}} contains the path to the home directory of the current user. This variable can be used by applications to associate configuration files and such like with the user running it.<br />
<br />
*{{ic|PWD}} contains the path to your working directory.<br />
<br />
*{{ic|OLDPWD}} contains the path to your previous working directory, that is, the value of {{ic|PWD}} before last ''cd'' was executed.<br />
<br />
*{{ic|SHELL}} contains the name of the running, interactive shell, e.g., {{ic|bash}}<br />
<br />
*{{ic|TERM}} contains the name of the running terminal, e.g., {{ic|xterm}}<br />
<br />
*{{ic|PAGER}} contains command to run the program used to list the contents of files, e.g., {{ic|/bin/less}}.<br />
<br />
*{{ic|EDITOR}} contains the command to run the lightweight program used for editing files, e.g., {{ic|/usr/bin/nano}}. For example, you can write an interactive switch between ''gedit'' under [[X]] or ''nano'' in this example):<br />
<br />
export EDITOR="$(if <nowiki>[[</nowiki> -n $DISPLAY <nowiki>]]</nowiki>; then echo 'gedit'; else echo 'nano'; fi)"<br />
<br />
*{{ic|VISUAL}} contains command to run the full-fledged editor that is used for more demanding tasks, such as editing mail (e.g., {{ic|vi}}, [[vim]], [[emacs]] etc).<br />
<br />
*{{ic|MAIL}} contains the location of incoming email. The traditional setting is {{ic|/var/spool/mail/$LOGNAME}}.<br />
<br />
*{{ic|BROWSER}} contains the path to the web browser. Helpful to set in an interactive shell configuration file so that it may be dynamically altered depending on the availability of a graphic environment, such as [[X]]:<br />
<br />
if <nowiki>[</nowiki> -n "$DISPLAY" <nowiki>]</nowiki>; then<br />
export BROWSER=firefox<br />
else <br />
export BROWSER=links<br />
fi<br />
<br />
*{{ic|ftp_proxy and http_proxy}} contains FTP and HTTP proxy server, respectively:<br />
ftp_proxy="<nowiki>ftp://192.168.0.1:21</nowiki>"<br />
http_proxy="<nowiki>http://192.168.0.1:80</nowiki>"<br />
<br />
*{{ic|MANPATH}} contains a colon-separated list of directories in which ''man'' searches for the man pages.<br />
{{Note|In {{ic|/etc/profile}}, there is a comment that states "Man is much better than us at figuring this out", so this variable should generally be left as default, i.e. {{ic|/usr/share/man:/usr/local/share/man}}<br />
}}<br />
<br />
*{{ic|INFODIR}} contains a colon-separated list of directories in which the info command searches for the info pages, e.g., {{ic|/usr/share/info:/usr/local/share/info}}<br />
<br />
*{{ic|TZ}} can be used to to set a time zone different to the system zone for a user. The zones listed in {{ic|/usr/share/zoneinfo/}} can be used as reference, for example {{ic|1=TZ="/usr/share/zoneinfo/Pacific/Fiji"}}<br />
<br />
== Defining variables ==<br />
<br />
See also [[Systemd/User#Environment variables]].<br />
<br />
=== Globally ===<br />
<br />
Most Linux distributions tell you to change or add environment variable definitions in {{ic|/etc/profile}} or other locations. Be sure to maintain and manage the environment variables and pay attention to the numerous files that can contain environment variables. In principle, any shell script can be used for initializing environmental variables, but following traditional UNIX conventions, these statements should be only be present in some particular files. <br />
<br />
The following files should be used for defining global environment variables on your system: {{ic|/etc/profile}}, {{ic|/etc/bash.bashrc}} and {{ic|/etc/environment}}. Each of these files has different limitations, so you should carefully select the appropriate one for your purposes.<br />
<br />
*{{ic|/etc/profile}} initializes variables for login shells ''only''. It does, however, run scripts and can be used by all [[wikipedia:Bourne shell|Bourne shell]] compatible shells.<br />
*{{ic|/etc/bash.bashrc}} initializes variables for interactive shells ''only''. It also runs scripts but (as its name implies) is Bash specific.<br />
*{{ic|/etc/environment}} is used by the PAM-env module and is agnostic to login/non-login, interactive/non-interactive and also Bash/non-Bash, so scripting or glob expansion cannot be used. The file only accepts {{ic|1=''variable=value''}} pairs.<br />
<br />
In this example, we add {{ic|~/bin}} directory to the {{ic|PATH}} for respective user. To do this, just put this in your preferred global environment variable config file ({{ic|/etc/profile}} or {{ic|/etc/bash.bashrc}}):<br />
<br />
{{bc|<nowiki><br />
# If user ID is greater than or equal to 1000 & if ~/bin exists and is a directory & if ~/bin is not already in your $PATH<br />
# then export ~/bin to your $PATH.<br />
if [[ $UID -ge 1000 && -d $HOME/bin && -z $(echo $PATH | grep -o $HOME/bin) ]]<br />
then<br />
export PATH=$HOME/bin:${PATH}<br />
fi<br />
</nowiki>}}<br />
<br />
=== Per user ===<br />
<br />
You do not always want to define an environment variable globally. For instance, you might want to add {{ic|/home/my_user/bin}} to the {{ic|PATH}} variable but do not want all other users on your system to have that in their {{ic|PATH}} too. Local environment variables can be defined in many different files:<br />
<br />
# Configuration files of your shell, for example [[Bash#Configuration files]] or [[Zsh#Configuration files]].<br />
# {{ic|~/.profile}} is used by many shells as fallback, see [[wikipedia:Unix shell#Configuration files]].<br />
# {{ic|~/.pam_environment}} is the user specific equivalent of {{ic|/etc/environment}}, used by PAM-env module. See {{ic|pam_env(8)}} for details.<br />
<br />
To add a directory to the {{ic|PATH}} for local usage, put following in {{ic|~/.bash_profile}}:<br />
<br />
export PATH="${PATH}:/home/my_user/bin"<br />
<br />
To update the variable, re-login or ''source'' the file: {{ic|$ source ~/.bash_profile}}.<br />
<br />
==== Graphical applications ====<br />
<br />
To set environment variables for GUI applications, you can put your variables in [[xinitrc]] (or [[xprofile]] when using a [[display manager]]), for example:<br />
<br />
{{hc|1=~/.xinitrc|2=<br />
export PATH="${PATH}:~/scripts"<br />
export GUIVAR=value}}<br />
<br />
=== Per session ===<br />
<br />
Sometimes even stricter definitions are required. One might want to temporarily run executables from a specific directory created without having to type the absolute path to each one, or editing {{ic|~/.bash_profile}} for the short time needed to run them.<br />
<br />
In this case, you can define the {{ic|PATH}} variable in your current session, combined with the ''export'' command. As long as you do not log out, the {{ic|PATH}} variable will be using the temporary settings. To add a session-specific directory to {{ic|PATH}}, issue:<br />
<br />
$ export PATH="${PATH}:/home/my_user/tmp/usr/bin"<br />
<br />
== See also ==<br />
<br />
* [https://wiki.gentoo.org/wiki/Handbook:X86/Working/EnvVar Gentoo Linux Documentation]<br />
* [[Default applications]]<br />
* [[Xdg-open]]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Eclipse_plugin_package_guidelines&diff=405205Eclipse plugin package guidelines2015-10-17T08:48:00Z<p>Sushi Dude: /* Sample PKGBUILD */ Double quote to prevent globbing and word splitting.</p>
<hr />
<div>[[Category:Package development]]<br />
[[it:Eclipse plugin package guidelines]]<br />
[[zh-cn:Eclipse plugin package guidelines]]<br />
{{Package guidelines}}<br />
<br />
There are many ways to install working [[Eclipse]] plugins, especially since the introduction of the ''dropins'' directory in Eclipse 3.4, but some of them are messy, and having a standardized and consistent way of packaging is very important to lead to a clean system structure. It's not easy, however, to achieve this without the packager knowing every detail about how Eclipse plugins work. This page aims to define a standard and simple structure for Eclipse plugin [[PKGBUILD]]s, so that the filesystem structure can remain consistent between all plugins without having the packager to start again for every new package.<br />
<br />
== Eclipse plugin structure and installation ==<br />
The typical Eclipse plugin contains two directories, {{ic|features}} and {{ic|plugins}}, and since Eclipse 3.3 they could only be placed in {{ic|/usr/lib/eclipse/}}. The content of these two directories could be mixed with that of other plugins, and it created a mess and rendered the structure difficult to manage. It was also very difficult to tell at a glance which package contained which file.<br />
<br />
This installation method is still supported in Eclipse 3.4, but the preferred one is now using the {{ic|/usr/lib/eclipse/dropins/}} directory. Inside this directory can live an unlimited number of subdirectories, each one containing its own {{ic|features}} and {{ic|plugins}} subdirectories. This allows to keep a tidy and clean structure, and should be the standard packaging way.<br />
<br />
== Packaging ==<br />
<br />
=== Sample PKGBUILD ===<br />
Here is an example, we will detail how to customize it below.<br />
<br />
{{hc|PKGBUILD-eclipse.proto|<nowiki><br />
pkgname=eclipse-mylyn<br />
pkgver=3.0.3<br />
pkgrel=1<br />
pkgdesc="A task-focused interface for Eclipse"<br />
arch=('any')<br />
url="https://eclipse.org/mylyn/"<br />
license=('EPL')<br />
depends=('eclipse')<br />
optdepends=('bugzilla: ticketing support')<br />
source=(https://download.eclipse.org/tools/mylyn/update/mylyn-${pkgver}-e3.4.zip)<br />
sha512sums=('aa6289046df4c254567010b30706cc9cb0a1355e9634adcb2052127030d2640f399caf20fce10e8b4fab5885da29057ab9117af42472bcc1645dcf9881f84236')<br />
<br />
prepare() {<br />
# remove features and plug-ins containing sources<br />
rm -f features/*.source_*<br />
rm -f plugins/*.source_*<br />
# remove gz files<br />
rm -f plugins/*.pack.gz<br />
}<br />
<br />
package() {<br />
_dest="${pkgdir}/usr/lib/eclipse/dropins/${pkgname/eclipse-}/eclipse"<br />
<br />
# Features<br />
find features -type f | while read -r _feature ; do<br />
if [[ "${_feature}" =~ (.*\.jar$) ]] ; then<br />
install -dm755 "${_dest}/${_feature%*.jar}"<br />
cd "${_dest}/${_feature/.jar}"<br />
# extract features (otherwise they are not visible in about dialog)<br />
jar xf "${srcdir}/${_feature}" || return 1<br />
else<br />
install -Dm644 "${_feature}" "${_dest}/${_feature}"<br />
fi<br />
done<br />
<br />
# Plugins<br />
find plugins -type f | while read -r _plugin ; do<br />
install -Dm644 "${_plugin}" "${_dest}/${_plugin}"<br />
done<br />
}<br />
</nowiki>}}<br />
<br />
=== How to customize the build ===<br />
The main variable which needs to be customized is the {{Ic|pkgname}}. If you are packaging a typical plugin, then this is the only thing you need to do: most plugins are distributed in zip files which only contain the two {{ic|features}} and {{ic|plugins}} subdirectories. So, if you are packaging the {{Ic|foo}} plugin and the source file only contains the {{ic|features}} and {{ic|plugins}}, you just need to change {{Ic|pkgname}} to {{Ic|eclipse-foo}} and you are set.<br />
<br />
Read on to get to the internals of the PKGBUILD, which help to understand how to setup the build for all the other cases.<br />
<br />
=== In-depth PKGBUILD review ===<br />
<br />
==== Package naming ====<br />
Packages should be named {{Ic|eclipse-''pluginname''}}, so that they are recognizable as Eclipse-related packages and it is easy to extract the plugin name with a simple shell substitution like {{Ic|<nowiki>${pkgname/eclipse-}</nowiki>}}, not having to resort to an unneeded {{Ic|<nowiki>${_realname}</nowiki>}} variable. The plugin name is necessary to tidy up everything during installation and to avoid conflicts.<br />
<br />
==== Files ====<br />
<br />
===== Extraction =====<br />
Some plugins need the features to be extracted from jar files. The {{Ic|jar}} utility, already included in the JRE, is used to do this. However, {{Ic|jar}} cannot extract to directories other than the current one: this means that, after every directory creation, it is necessary to {{Ic|cd}} inside it before extracting. The {{Ic|<nowiki>${_dest}</nowiki>}} variable is used in this context to improve readability and PKGBUILD tidiness.<br />
<br />
===== Locations =====<br />
As we said, source archives provide two directories, {{ic|features}} and {{ic|plugins}}, each one packed up with jar files. The preferred dropins structure should look like this:<br />
<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/features/feature1/...<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/features/feature2/...<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/plugins/plugin1.jar<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/plugins/plugin2.jar<br />
<br />
This structure allows for mixing different versions of libraries that may be needed by different plugins while being clear about which package owns what. It will also avoid conflicts in case different packages provide the same library. The only alternative would be splitting every package from its libraries, with all the extra fuss it requires, and it would not even be guaranteed to work because of packages needing older library versions.<br />
Features have to be unjarred since Eclipse will not detect them otherwise, and the whole plugin installation will not work. This happens because Eclipse treats update sites and local installations differently (do not ask why, it just does).<br />
<br />
==== The build() function ====<br />
First thing to be noticed is the {{Ic|<nowiki>cd ${srcdir}</nowiki>}} command. Usually source archives extract the {{ic|features}} and {{ic|plugins}} folders directly under {{Ic|<nowiki>${srcdir}</nowiki>}}, but this is not always the case. Anyway, for most non-''(de facto)''-standard plugins this is the only line that needs to be changed.<br />
<br />
Some released features include their sources, too. For a normal release version these sources are not needed and can be removed. Furthermore same features include {{Ic|*.pack.gz}} files, which contain the same files compared to the jar archives. So these files can be removed, too.<br />
<br />
Next is the {{Ic|features}} section. It creates the necessary directories, one for every jar file, and extracts the jar in the corresponding directory. Similarly, the {{Ic|plugins}} section installs the jar files in their directory. A while cycle is used to prevent funny-named files.</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Eclipse_plugin_package_guidelines&diff=405197Eclipse plugin package guidelines2015-10-17T08:17:00Z<p>Sushi Dude: /* Sample PKGBUILD */ read without -r will mangle backslashes.</p>
<hr />
<div>[[Category:Package development]]<br />
[[it:Eclipse plugin package guidelines]]<br />
[[zh-cn:Eclipse plugin package guidelines]]<br />
{{Package guidelines}}<br />
<br />
There are many ways to install working [[Eclipse]] plugins, especially since the introduction of the ''dropins'' directory in Eclipse 3.4, but some of them are messy, and having a standardized and consistent way of packaging is very important to lead to a clean system structure. It's not easy, however, to achieve this without the packager knowing every detail about how Eclipse plugins work. This page aims to define a standard and simple structure for Eclipse plugin [[PKGBUILD]]s, so that the filesystem structure can remain consistent between all plugins without having the packager to start again for every new package.<br />
<br />
== Eclipse plugin structure and installation ==<br />
The typical Eclipse plugin contains two directories, {{ic|features}} and {{ic|plugins}}, and since Eclipse 3.3 they could only be placed in {{ic|/usr/lib/eclipse/}}. The content of these two directories could be mixed with that of other plugins, and it created a mess and rendered the structure difficult to manage. It was also very difficult to tell at a glance which package contained which file.<br />
<br />
This installation method is still supported in Eclipse 3.4, but the preferred one is now using the {{ic|/usr/lib/eclipse/dropins/}} directory. Inside this directory can live an unlimited number of subdirectories, each one containing its own {{ic|features}} and {{ic|plugins}} subdirectories. This allows to keep a tidy and clean structure, and should be the standard packaging way.<br />
<br />
== Packaging ==<br />
<br />
=== Sample PKGBUILD ===<br />
Here is an example, we will detail how to customize it below.<br />
<br />
{{hc|PKGBUILD-eclipse.proto|<nowiki><br />
pkgname=eclipse-mylyn<br />
pkgver=3.0.3<br />
pkgrel=1<br />
pkgdesc="A task-focused interface for Eclipse"<br />
arch=('any')<br />
url="https://eclipse.org/mylyn/"<br />
license=('EPL')<br />
depends=('eclipse')<br />
optdepends=('bugzilla: ticketing support')<br />
source=(https://download.eclipse.org/tools/mylyn/update/mylyn-${pkgver}-e3.4.zip)<br />
sha512sums=('aa6289046df4c254567010b30706cc9cb0a1355e9634adcb2052127030d2640f399caf20fce10e8b4fab5885da29057ab9117af42472bcc1645dcf9881f84236')<br />
<br />
prepare() {<br />
# remove features and plug-ins containing sources<br />
rm -f features/*.source_*<br />
rm -f plugins/*.source_*<br />
# remove gz files<br />
rm -f plugins/*.pack.gz<br />
}<br />
<br />
package() {<br />
_dest=${pkgdir}/usr/lib/eclipse/dropins/${pkgname/eclipse-}/eclipse<br />
<br />
# Features<br />
find features -type f | while read -r _feature ; do<br />
if [[ ${_feature} =~ (.*\.jar$) ]] ; then<br />
install -dm755 ${_dest}/${_feature%*.jar}<br />
cd ${_dest}/${_feature/.jar}<br />
# extract features (otherwise they are not visible in about dialog)<br />
jar xf ${srcdir}/${_feature} || return 1<br />
else<br />
install -Dm644 ${_feature} ${_dest}/${_feature}<br />
fi<br />
done<br />
<br />
# Plugins<br />
find plugins -type f | while read -r _plugin ; do<br />
install -Dm644 "${_plugin}" "${_dest}/${_plugin}"<br />
done<br />
}<br />
</nowiki>}}<br />
<br />
=== How to customize the build ===<br />
The main variable which needs to be customized is the {{Ic|pkgname}}. If you are packaging a typical plugin, then this is the only thing you need to do: most plugins are distributed in zip files which only contain the two {{ic|features}} and {{ic|plugins}} subdirectories. So, if you are packaging the {{Ic|foo}} plugin and the source file only contains the {{ic|features}} and {{ic|plugins}}, you just need to change {{Ic|pkgname}} to {{Ic|eclipse-foo}} and you are set.<br />
<br />
Read on to get to the internals of the PKGBUILD, which help to understand how to setup the build for all the other cases.<br />
<br />
=== In-depth PKGBUILD review ===<br />
<br />
==== Package naming ====<br />
Packages should be named {{Ic|eclipse-''pluginname''}}, so that they are recognizable as Eclipse-related packages and it is easy to extract the plugin name with a simple shell substitution like {{Ic|<nowiki>${pkgname/eclipse-}</nowiki>}}, not having to resort to an unneeded {{Ic|<nowiki>${_realname}</nowiki>}} variable. The plugin name is necessary to tidy up everything during installation and to avoid conflicts.<br />
<br />
==== Files ====<br />
<br />
===== Extraction =====<br />
Some plugins need the features to be extracted from jar files. The {{Ic|jar}} utility, already included in the JRE, is used to do this. However, {{Ic|jar}} cannot extract to directories other than the current one: this means that, after every directory creation, it is necessary to {{Ic|cd}} inside it before extracting. The {{Ic|<nowiki>${_dest}</nowiki>}} variable is used in this context to improve readability and PKGBUILD tidiness.<br />
<br />
===== Locations =====<br />
As we said, source archives provide two directories, {{ic|features}} and {{ic|plugins}}, each one packed up with jar files. The preferred dropins structure should look like this:<br />
<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/features/feature1/...<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/features/feature2/...<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/plugins/plugin1.jar<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/plugins/plugin2.jar<br />
<br />
This structure allows for mixing different versions of libraries that may be needed by different plugins while being clear about which package owns what. It will also avoid conflicts in case different packages provide the same library. The only alternative would be splitting every package from its libraries, with all the extra fuss it requires, and it would not even be guaranteed to work because of packages needing older library versions.<br />
Features have to be unjarred since Eclipse will not detect them otherwise, and the whole plugin installation will not work. This happens because Eclipse treats update sites and local installations differently (do not ask why, it just does).<br />
<br />
==== The build() function ====<br />
First thing to be noticed is the {{Ic|<nowiki>cd ${srcdir}</nowiki>}} command. Usually source archives extract the {{ic|features}} and {{ic|plugins}} folders directly under {{Ic|<nowiki>${srcdir}</nowiki>}}, but this is not always the case. Anyway, for most non-''(de facto)''-standard plugins this is the only line that needs to be changed.<br />
<br />
Some released features include their sources, too. For a normal release version these sources are not needed and can be removed. Furthermore same features include {{Ic|*.pack.gz}} files, which contain the same files compared to the jar archives. So these files can be removed, too.<br />
<br />
Next is the {{Ic|features}} section. It creates the necessary directories, one for every jar file, and extracts the jar in the corresponding directory. Similarly, the {{Ic|plugins}} section installs the jar files in their directory. A while cycle is used to prevent funny-named files.</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Eclipse_plugin_package_guidelines&diff=405196Eclipse plugin package guidelines2015-10-17T08:05:43Z<p>Sushi Dude: /* Sample PKGBUILD */ Use the more secure HTTPS and SHA-512 rather than HTTP and MD5.</p>
<hr />
<div>[[Category:Package development]]<br />
[[it:Eclipse plugin package guidelines]]<br />
[[zh-cn:Eclipse plugin package guidelines]]<br />
{{Package guidelines}}<br />
<br />
There are many ways to install working [[Eclipse]] plugins, especially since the introduction of the ''dropins'' directory in Eclipse 3.4, but some of them are messy, and having a standardized and consistent way of packaging is very important to lead to a clean system structure. It's not easy, however, to achieve this without the packager knowing every detail about how Eclipse plugins work. This page aims to define a standard and simple structure for Eclipse plugin [[PKGBUILD]]s, so that the filesystem structure can remain consistent between all plugins without having the packager to start again for every new package.<br />
<br />
== Eclipse plugin structure and installation ==<br />
The typical Eclipse plugin contains two directories, {{ic|features}} and {{ic|plugins}}, and since Eclipse 3.3 they could only be placed in {{ic|/usr/lib/eclipse/}}. The content of these two directories could be mixed with that of other plugins, and it created a mess and rendered the structure difficult to manage. It was also very difficult to tell at a glance which package contained which file.<br />
<br />
This installation method is still supported in Eclipse 3.4, but the preferred one is now using the {{ic|/usr/lib/eclipse/dropins/}} directory. Inside this directory can live an unlimited number of subdirectories, each one containing its own {{ic|features}} and {{ic|plugins}} subdirectories. This allows to keep a tidy and clean structure, and should be the standard packaging way.<br />
<br />
== Packaging ==<br />
<br />
=== Sample PKGBUILD ===<br />
Here is an example, we will detail how to customize it below.<br />
<br />
{{hc|PKGBUILD-eclipse.proto|<nowiki><br />
pkgname=eclipse-mylyn<br />
pkgver=3.0.3<br />
pkgrel=1<br />
pkgdesc="A task-focused interface for Eclipse"<br />
arch=('any')<br />
url="https://eclipse.org/mylyn/"<br />
license=('EPL')<br />
depends=('eclipse')<br />
optdepends=('bugzilla: ticketing support')<br />
source=(https://download.eclipse.org/tools/mylyn/update/mylyn-${pkgver}-e3.4.zip)<br />
sha512sums=('aa6289046df4c254567010b30706cc9cb0a1355e9634adcb2052127030d2640f399caf20fce10e8b4fab5885da29057ab9117af42472bcc1645dcf9881f84236')<br />
<br />
prepare() {<br />
# remove features and plug-ins containing sources<br />
rm -f features/*.source_*<br />
rm -f plugins/*.source_*<br />
# remove gz files<br />
rm -f plugins/*.pack.gz<br />
}<br />
<br />
package() {<br />
_dest=${pkgdir}/usr/lib/eclipse/dropins/${pkgname/eclipse-}/eclipse<br />
<br />
# Features<br />
find features -type f | while read _feature ; do<br />
if [[ ${_feature} =~ (.*\.jar$) ]] ; then<br />
install -dm755 ${_dest}/${_feature%*.jar}<br />
cd ${_dest}/${_feature/.jar}<br />
# extract features (otherwise they are not visible in about dialog)<br />
jar xf ${srcdir}/${_feature} || return 1<br />
else<br />
install -Dm644 ${_feature} ${_dest}/${_feature}<br />
fi<br />
done<br />
<br />
# Plugins<br />
find plugins -type f | while read _plugin ; do<br />
install -Dm644 "${_plugin}" "${_dest}/${_plugin}"<br />
done<br />
}<br />
</nowiki>}}<br />
<br />
=== How to customize the build ===<br />
The main variable which needs to be customized is the {{Ic|pkgname}}. If you are packaging a typical plugin, then this is the only thing you need to do: most plugins are distributed in zip files which only contain the two {{ic|features}} and {{ic|plugins}} subdirectories. So, if you are packaging the {{Ic|foo}} plugin and the source file only contains the {{ic|features}} and {{ic|plugins}}, you just need to change {{Ic|pkgname}} to {{Ic|eclipse-foo}} and you are set.<br />
<br />
Read on to get to the internals of the PKGBUILD, which help to understand how to setup the build for all the other cases.<br />
<br />
=== In-depth PKGBUILD review ===<br />
<br />
==== Package naming ====<br />
Packages should be named {{Ic|eclipse-''pluginname''}}, so that they are recognizable as Eclipse-related packages and it is easy to extract the plugin name with a simple shell substitution like {{Ic|<nowiki>${pkgname/eclipse-}</nowiki>}}, not having to resort to an unneeded {{Ic|<nowiki>${_realname}</nowiki>}} variable. The plugin name is necessary to tidy up everything during installation and to avoid conflicts.<br />
<br />
==== Files ====<br />
<br />
===== Extraction =====<br />
Some plugins need the features to be extracted from jar files. The {{Ic|jar}} utility, already included in the JRE, is used to do this. However, {{Ic|jar}} cannot extract to directories other than the current one: this means that, after every directory creation, it is necessary to {{Ic|cd}} inside it before extracting. The {{Ic|<nowiki>${_dest}</nowiki>}} variable is used in this context to improve readability and PKGBUILD tidiness.<br />
<br />
===== Locations =====<br />
As we said, source archives provide two directories, {{ic|features}} and {{ic|plugins}}, each one packed up with jar files. The preferred dropins structure should look like this:<br />
<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/features/feature1/...<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/features/feature2/...<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/plugins/plugin1.jar<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/plugins/plugin2.jar<br />
<br />
This structure allows for mixing different versions of libraries that may be needed by different plugins while being clear about which package owns what. It will also avoid conflicts in case different packages provide the same library. The only alternative would be splitting every package from its libraries, with all the extra fuss it requires, and it would not even be guaranteed to work because of packages needing older library versions.<br />
Features have to be unjarred since Eclipse will not detect them otherwise, and the whole plugin installation will not work. This happens because Eclipse treats update sites and local installations differently (do not ask why, it just does).<br />
<br />
==== The build() function ====<br />
First thing to be noticed is the {{Ic|<nowiki>cd ${srcdir}</nowiki>}} command. Usually source archives extract the {{ic|features}} and {{ic|plugins}} folders directly under {{Ic|<nowiki>${srcdir}</nowiki>}}, but this is not always the case. Anyway, for most non-''(de facto)''-standard plugins this is the only line that needs to be changed.<br />
<br />
Some released features include their sources, too. For a normal release version these sources are not needed and can be removed. Furthermore same features include {{Ic|*.pack.gz}} files, which contain the same files compared to the jar archives. So these files can be removed, too.<br />
<br />
Next is the {{Ic|features}} section. It creates the necessary directories, one for every jar file, and extracts the jar in the corresponding directory. Similarly, the {{Ic|plugins}} section installs the jar files in their directory. A while cycle is used to prevent funny-named files.</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Eclipse_plugin_package_guidelines&diff=405195Eclipse plugin package guidelines2015-10-17T08:00:06Z<p>Sushi Dude: /* Sample PKGBUILD */ Java is architecture independent.</p>
<hr />
<div>[[Category:Package development]]<br />
[[it:Eclipse plugin package guidelines]]<br />
[[zh-cn:Eclipse plugin package guidelines]]<br />
{{Package guidelines}}<br />
<br />
There are many ways to install working [[Eclipse]] plugins, especially since the introduction of the ''dropins'' directory in Eclipse 3.4, but some of them are messy, and having a standardized and consistent way of packaging is very important to lead to a clean system structure. It's not easy, however, to achieve this without the packager knowing every detail about how Eclipse plugins work. This page aims to define a standard and simple structure for Eclipse plugin [[PKGBUILD]]s, so that the filesystem structure can remain consistent between all plugins without having the packager to start again for every new package.<br />
<br />
== Eclipse plugin structure and installation ==<br />
The typical Eclipse plugin contains two directories, {{ic|features}} and {{ic|plugins}}, and since Eclipse 3.3 they could only be placed in {{ic|/usr/lib/eclipse/}}. The content of these two directories could be mixed with that of other plugins, and it created a mess and rendered the structure difficult to manage. It was also very difficult to tell at a glance which package contained which file.<br />
<br />
This installation method is still supported in Eclipse 3.4, but the preferred one is now using the {{ic|/usr/lib/eclipse/dropins/}} directory. Inside this directory can live an unlimited number of subdirectories, each one containing its own {{ic|features}} and {{ic|plugins}} subdirectories. This allows to keep a tidy and clean structure, and should be the standard packaging way.<br />
<br />
== Packaging ==<br />
<br />
=== Sample PKGBUILD ===<br />
Here is an example, we will detail how to customize it below.<br />
<br />
{{hc|PKGBUILD-eclipse.proto|<nowiki><br />
pkgname=eclipse-mylyn<br />
pkgver=3.0.3<br />
pkgrel=1<br />
pkgdesc="A task-focused interface for Eclipse"<br />
arch=('any')<br />
url="http://www.eclipse.org/mylyn/"<br />
license=('EPL')<br />
depends=('eclipse')<br />
optdepends=('bugzilla: ticketing support')<br />
source=(http://download.eclipse.org/tools/mylyn/update/mylyn-${pkgver}-e3.4.zip)<br />
md5sums=('e98cd7ab3c5d5aeb7c32845844f85c22')<br />
<br />
prepare() {<br />
# remove features and plug-ins containing sources<br />
rm -f features/*.source_*<br />
rm -f plugins/*.source_*<br />
# remove gz files<br />
rm -f plugins/*.pack.gz<br />
}<br />
<br />
package() {<br />
_dest=${pkgdir}/usr/lib/eclipse/dropins/${pkgname/eclipse-}/eclipse<br />
<br />
# Features<br />
find features -type f | while read _feature ; do<br />
if [[ ${_feature} =~ (.*\.jar$) ]] ; then<br />
install -dm755 ${_dest}/${_feature%*.jar}<br />
cd ${_dest}/${_feature/.jar}<br />
# extract features (otherwise they are not visible in about dialog)<br />
jar xf ${srcdir}/${_feature} || return 1<br />
else<br />
install -Dm644 ${_feature} ${_dest}/${_feature}<br />
fi<br />
done<br />
<br />
# Plugins<br />
find plugins -type f | while read _plugin ; do<br />
install -Dm644 "${_plugin}" "${_dest}/${_plugin}"<br />
done<br />
}<br />
</nowiki>}}<br />
<br />
=== How to customize the build ===<br />
The main variable which needs to be customized is the {{Ic|pkgname}}. If you are packaging a typical plugin, then this is the only thing you need to do: most plugins are distributed in zip files which only contain the two {{ic|features}} and {{ic|plugins}} subdirectories. So, if you are packaging the {{Ic|foo}} plugin and the source file only contains the {{ic|features}} and {{ic|plugins}}, you just need to change {{Ic|pkgname}} to {{Ic|eclipse-foo}} and you are set.<br />
<br />
Read on to get to the internals of the PKGBUILD, which help to understand how to setup the build for all the other cases.<br />
<br />
=== In-depth PKGBUILD review ===<br />
<br />
==== Package naming ====<br />
Packages should be named {{Ic|eclipse-''pluginname''}}, so that they are recognizable as Eclipse-related packages and it is easy to extract the plugin name with a simple shell substitution like {{Ic|<nowiki>${pkgname/eclipse-}</nowiki>}}, not having to resort to an unneeded {{Ic|<nowiki>${_realname}</nowiki>}} variable. The plugin name is necessary to tidy up everything during installation and to avoid conflicts.<br />
<br />
==== Files ====<br />
<br />
===== Extraction =====<br />
Some plugins need the features to be extracted from jar files. The {{Ic|jar}} utility, already included in the JRE, is used to do this. However, {{Ic|jar}} cannot extract to directories other than the current one: this means that, after every directory creation, it is necessary to {{Ic|cd}} inside it before extracting. The {{Ic|<nowiki>${_dest}</nowiki>}} variable is used in this context to improve readability and PKGBUILD tidiness.<br />
<br />
===== Locations =====<br />
As we said, source archives provide two directories, {{ic|features}} and {{ic|plugins}}, each one packed up with jar files. The preferred dropins structure should look like this:<br />
<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/features/feature1/...<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/features/feature2/...<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/plugins/plugin1.jar<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/plugins/plugin2.jar<br />
<br />
This structure allows for mixing different versions of libraries that may be needed by different plugins while being clear about which package owns what. It will also avoid conflicts in case different packages provide the same library. The only alternative would be splitting every package from its libraries, with all the extra fuss it requires, and it would not even be guaranteed to work because of packages needing older library versions.<br />
Features have to be unjarred since Eclipse will not detect them otherwise, and the whole plugin installation will not work. This happens because Eclipse treats update sites and local installations differently (do not ask why, it just does).<br />
<br />
==== The build() function ====<br />
First thing to be noticed is the {{Ic|<nowiki>cd ${srcdir}</nowiki>}} command. Usually source archives extract the {{ic|features}} and {{ic|plugins}} folders directly under {{Ic|<nowiki>${srcdir}</nowiki>}}, but this is not always the case. Anyway, for most non-''(de facto)''-standard plugins this is the only line that needs to be changed.<br />
<br />
Some released features include their sources, too. For a normal release version these sources are not needed and can be removed. Furthermore same features include {{Ic|*.pack.gz}} files, which contain the same files compared to the jar archives. So these files can be removed, too.<br />
<br />
Next is the {{Ic|features}} section. It creates the necessary directories, one for every jar file, and extracts the jar in the corresponding directory. Similarly, the {{Ic|plugins}} section installs the jar files in their directory. A while cycle is used to prevent funny-named files.</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Eclipse_plugin_package_guidelines&diff=405194Eclipse plugin package guidelines2015-10-17T07:49:53Z<p>Sushi Dude: /* Sample PKGBUILD */ Make script robust in case of no source files.</p>
<hr />
<div>[[Category:Package development]]<br />
[[it:Eclipse plugin package guidelines]]<br />
[[zh-cn:Eclipse plugin package guidelines]]<br />
{{Package guidelines}}<br />
<br />
There are many ways to install working [[Eclipse]] plugins, especially since the introduction of the ''dropins'' directory in Eclipse 3.4, but some of them are messy, and having a standardized and consistent way of packaging is very important to lead to a clean system structure. It's not easy, however, to achieve this without the packager knowing every detail about how Eclipse plugins work. This page aims to define a standard and simple structure for Eclipse plugin [[PKGBUILD]]s, so that the filesystem structure can remain consistent between all plugins without having the packager to start again for every new package.<br />
<br />
== Eclipse plugin structure and installation ==<br />
The typical Eclipse plugin contains two directories, {{ic|features}} and {{ic|plugins}}, and since Eclipse 3.3 they could only be placed in {{ic|/usr/lib/eclipse/}}. The content of these two directories could be mixed with that of other plugins, and it created a mess and rendered the structure difficult to manage. It was also very difficult to tell at a glance which package contained which file.<br />
<br />
This installation method is still supported in Eclipse 3.4, but the preferred one is now using the {{ic|/usr/lib/eclipse/dropins/}} directory. Inside this directory can live an unlimited number of subdirectories, each one containing its own {{ic|features}} and {{ic|plugins}} subdirectories. This allows to keep a tidy and clean structure, and should be the standard packaging way.<br />
<br />
== Packaging ==<br />
<br />
=== Sample PKGBUILD ===<br />
Here is an example, we will detail how to customize it below.<br />
<br />
{{hc|PKGBUILD-eclipse.proto|<nowiki><br />
pkgname=eclipse-mylyn<br />
pkgver=3.0.3<br />
pkgrel=1<br />
pkgdesc="A task-focused interface for Eclipse"<br />
arch=('i686' 'x86_64')<br />
url="http://www.eclipse.org/mylyn/"<br />
license=('EPL')<br />
depends=('eclipse')<br />
optdepends=('bugzilla: ticketing support')<br />
source=(http://download.eclipse.org/tools/mylyn/update/mylyn-${pkgver}-e3.4.zip)<br />
md5sums=('e98cd7ab3c5d5aeb7c32845844f85c22')<br />
<br />
prepare() {<br />
# remove features and plug-ins containing sources<br />
rm -f features/*.source_*<br />
rm -f plugins/*.source_*<br />
# remove gz files<br />
rm -f plugins/*.pack.gz<br />
}<br />
<br />
package() {<br />
_dest=${pkgdir}/usr/lib/eclipse/dropins/${pkgname/eclipse-}/eclipse<br />
<br />
# Features<br />
find features -type f | while read _feature ; do<br />
if [[ ${_feature} =~ (.*\.jar$) ]] ; then<br />
install -dm755 ${_dest}/${_feature%*.jar}<br />
cd ${_dest}/${_feature/.jar}<br />
# extract features (otherwise they are not visible in about dialog)<br />
jar xf ${srcdir}/${_feature} || return 1<br />
else<br />
install -Dm644 ${_feature} ${_dest}/${_feature}<br />
fi<br />
done<br />
<br />
# Plugins<br />
find plugins -type f | while read _plugin ; do<br />
install -Dm644 "${_plugin}" "${_dest}/${_plugin}"<br />
done<br />
}<br />
</nowiki>}}<br />
<br />
=== How to customize the build ===<br />
The main variable which needs to be customized is the {{Ic|pkgname}}. If you are packaging a typical plugin, then this is the only thing you need to do: most plugins are distributed in zip files which only contain the two {{ic|features}} and {{ic|plugins}} subdirectories. So, if you are packaging the {{Ic|foo}} plugin and the source file only contains the {{ic|features}} and {{ic|plugins}}, you just need to change {{Ic|pkgname}} to {{Ic|eclipse-foo}} and you are set.<br />
<br />
Read on to get to the internals of the PKGBUILD, which help to understand how to setup the build for all the other cases.<br />
<br />
=== In-depth PKGBUILD review ===<br />
<br />
==== Package naming ====<br />
Packages should be named {{Ic|eclipse-''pluginname''}}, so that they are recognizable as Eclipse-related packages and it is easy to extract the plugin name with a simple shell substitution like {{Ic|<nowiki>${pkgname/eclipse-}</nowiki>}}, not having to resort to an unneeded {{Ic|<nowiki>${_realname}</nowiki>}} variable. The plugin name is necessary to tidy up everything during installation and to avoid conflicts.<br />
<br />
==== Files ====<br />
<br />
===== Extraction =====<br />
Some plugins need the features to be extracted from jar files. The {{Ic|jar}} utility, already included in the JRE, is used to do this. However, {{Ic|jar}} cannot extract to directories other than the current one: this means that, after every directory creation, it is necessary to {{Ic|cd}} inside it before extracting. The {{Ic|<nowiki>${_dest}</nowiki>}} variable is used in this context to improve readability and PKGBUILD tidiness.<br />
<br />
===== Locations =====<br />
As we said, source archives provide two directories, {{ic|features}} and {{ic|plugins}}, each one packed up with jar files. The preferred dropins structure should look like this:<br />
<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/features/feature1/...<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/features/feature2/...<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/plugins/plugin1.jar<br />
/usr/lib/eclipse/dropins/pluginname/eclipse/plugins/plugin2.jar<br />
<br />
This structure allows for mixing different versions of libraries that may be needed by different plugins while being clear about which package owns what. It will also avoid conflicts in case different packages provide the same library. The only alternative would be splitting every package from its libraries, with all the extra fuss it requires, and it would not even be guaranteed to work because of packages needing older library versions.<br />
Features have to be unjarred since Eclipse will not detect them otherwise, and the whole plugin installation will not work. This happens because Eclipse treats update sites and local installations differently (do not ask why, it just does).<br />
<br />
==== The build() function ====<br />
First thing to be noticed is the {{Ic|<nowiki>cd ${srcdir}</nowiki>}} command. Usually source archives extract the {{ic|features}} and {{ic|plugins}} folders directly under {{Ic|<nowiki>${srcdir}</nowiki>}}, but this is not always the case. Anyway, for most non-''(de facto)''-standard plugins this is the only line that needs to be changed.<br />
<br />
Some released features include their sources, too. For a normal release version these sources are not needed and can be removed. Furthermore same features include {{Ic|*.pack.gz}} files, which contain the same files compared to the jar archives. So these files can be removed, too.<br />
<br />
Next is the {{Ic|features}} section. It creates the necessary directories, one for every jar file, and extracts the jar in the corresponding directory. Similarly, the {{Ic|plugins}} section installs the jar files in their directory. A while cycle is used to prevent funny-named files.</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Talk:Font_configuration&diff=405169Talk:Font configuration2015-10-17T06:30:34Z<p>Sushi Dude: re</p>
<hr />
<div>== Unclear instructions ==<br />
It is not entierly clear what file the following configuration should be put:<br />
<div style="border-style: dotted;"><br />
Keep in mind that Xorg does not search recursively through the /usr/share/fonts/ directory like Fontconfig does. To add a path, the full path must be used:<br />
<br />
Section "Files"<br />
FontPath "/usr/share/fonts/local/"<br />
EndSection<br />
</div><br />
[[User:Axper|axper]] ([[User talk:Axper|talk]]) 08:43, 30 November 2013 (UTC)<br />
<br />
== freetype2 config changes ==<br />
<br />
freetype2 no longer uses local.conf (same with infinality) and has switched to /etc/fonts/conf.d/* config files symlinked to /etc/fonts/conf.avail/*. I'm happy to update this page but don't want to step on the plans of someone more informed than I. If I don't hear back in a week or so I'll go ahead and add some minor changes to reflect this new configuration setup.<br />
:Freetype2 has had conf.avail and conf.d for a while. One of the files in conf.d is "51-local.conf" and that lets you use /etc/fonts/local.conf for your own local settings. The freetype2-infinality package just now installs the default non-customized Infinality config to conf.avail so people know it exists without reading the documentation. [[User:Thestinger|thestinger]] 13:18, 30 November 2011 (EST)<br />
<br />
== Contradictory recommendations? ==<br />
<br />
I'm not familiar with fontconfig - I've configured it rarely and a long time ago for a different OS. So I'm not sure if something is just not clear to me but as I read the article, it is giving me contradictory instructions:<br />
* early on, it suggests enabling both the autohinter and subpixel rendering to improve appearance after installing msfonts<br />
* later on, it says that the autohinter should not be used with subpixel rendering<br />
I realise that the methods used to enable these are different in the two cases (one sets up symlinks in conf.d; one adds sections to local.conf) but if this explains the apparent inconsistency, it would be really good to explain why there's no conflict in this case. --[[User:Margali|Margali]] 19:07, 4 March 2012 (EST)<br />
<br />
== Autogenerating missing shapes and weights ==<br />
<br />
Since the article is about improving the appearance of fonts, I would suggest qualifying the section which explains how to have fontconfig generate italics and bold/bolder fonts on the fly. I doubt very much that it is faking italics. I assume it fakes slanted versions (which are not the same as italics). Moreover, it is unlikely that the results of autogeneration will be especially pleasing. Font designers would abhor such things and not, I think, because they need the work! Faked versions can be acceptable but they will not look as good - the spacing will not be optimal, the shapes of the glyphs and the metrics will not be quite right as good fonts vary these things appropriately for different weights, shapes and sizes. --[[User:Margali|Margali]] 19:13, 4 March 2012 (EST)<br />
<br />
== Configuration confusion ==<br />
<br />
As currently set out, I'm not clear what the relationship is between configuration via symlinks in conf.d (adding to conf.avail as needed) and via local.conf. Should these be used for different aspects of configuration? Or are they equivalent/interchangeable?<br />
<br />
I also don't quite understand about the numbering. It looked to me as if higher numbered files under conf.d were more specific than lower numbered ones. I assumed this was so that e.g. config specific to a particular font overrode general, default config for all fonts. But the article suggests that is wrong. So should I be renumbering the files there in order to get this behaviour?<br />
<br />
e.g. Will the font-specific set up in 20-unhint-small-dejavu-sans-mono.conf get overridden by 10-bcihint.conf (a file I created with the section for BCI hints from the article)? I used 10- because that's the number for the autohinter file under conf.avail so I assumed that number was about right.<br />
<br />
--[[User:Margali|Margali]] 19:23, 4 March 2012 (EST)<br />
<br />
== October 2013 Quality of Font Rendering ==<br />
<br />
The package '''[https://www.archlinux.org/packages/extra/x86_64/fontconfig/ extra/fontconfig]''' was updated to '''2.11.0-1''' as at 2013-10-13 (UTC). Per ['''[https://bbs.archlinux.org/viewtopic.php?pid=1337337#p1337337 BBS#1337337]'''] by '''anton''' and associated ArchLinux flyspray entry ['''[https://bugs.archlinux.org/task/25499 FS#25499]'''], the file '''29-replace-bitmap-fonts.conf''' was dropped from the package (this file was an ArchLinux customisation).<br />
<br />
'''anton''' provides a workaround in that thread, as does '''FDServices''' at ['''[https://bbs.archlinux.org/viewtopic.php?pid=1337433#p1337433 BBS#1337433]'''] and '''heftig''' at ['''[https://bbs.archlinux.org/viewtopic.php?pid=1337776#p1337776 BBS#1337776]''']. I can confirm -- at least on my rig -- that the workaround provided by FDServices was successful after log out/in to establish a new session<br />
<br />
I am noting this here for the benefit of other contributors who may come hunting for this over time; not sure if (or how) it should be worked into the main article. Full credit is due to the contributors named above for this, rather than me; I am merely the messenger here!<br />
<br />
--[[User:Aexoxea|aexoxea]] ([[User_talk:Aexoxea|talk]]) 14:46, 15 October 2013 (UTC)<br />
<br />
: Further to the above, here is a 'compromise' method (per the information provided by '''FDServices''' and '''heftig''' above) that doesn't involve restoring the '''29-replace-bitmap-fonts.conf''' file, and that seems to be working OK here: Install '''[https://www.archlinux.org/packages/extra/any/tex-gyre-fonts/ extra/tex-gyre-fonts]''' and then symlink {{ic|/etc/fonts/conf.avail/70-no-bitmaps.conf}} under {{ic|~/.fonts.conf.d/}}.<br />
<br />
: Obviously this is user-specific, but it also avoids creating the symlink under '''/etc''' manually (since files created therein other than by packages tend to be forgotten). As I know comparitively little about font configuration, any feedback on issues or potential issues with this method is welcomed.<br />
<br />
: --[[User:Aexoxea|aexoxea]] ([[User_talk:Aexoxea|talk]]) 07:08, 16 October 2013 (UTC)<br />
<br />
:: The above generated some warnings for me, so I'm now using destination directory {{ic|~/.config/fontconfig/conf.d/}}. This appears to be an XDG-preferred destination (at least on ArchLinux), however I don't know whether others mileage may vary, so both are noted here. Hopefully the last update to this thread from me!<br />
<br />
:: --[[User:Aexoxea|aexoxea]] ([[User_talk:Aexoxea|talk]]) 08:14, 18 October 2013 (UTC)<br />
<br />
== Change Rule Overriding ==<br />
<br />
I'm fairly sure that this section is completely incorrect. I believe that while fontconfig does scan the XML files in the order stated, the first file scanned has the highest precedence. Hence 99-user.conf actually has the minimum precedence, and would therefore be overridden by anything else. --[[User:Teppic74|Teppic74]] ([[User talk:Teppic74|talk]]) 19:26, 6 June 2014 (UTC)<br />
<br />
:Now it should be correct. --[[User:Larpico|Larpico]] ([[User talk:Larpico|talk]]) 03:41, 28 October 2014 (UTC)<br />
<br />
:: My edit was reverted, but that's fine because it was incorrect. Unfortunately, the information that replaced it, is also wrong. Rule overriding in fontconfig seems to be quite complex. alexoj provides a very good explanation in this [https://github.com/bohoomil/fontconfig-ultimate/issues/51#issuecomment-64678322 issue]. --[[User:Larpico|Larpico]] ([[User talk:Larpico|talk]]) 23:04, 3 July 2015 (UTC)<br />
<br />
== Font Configuration - fontconfig-good-defaults ==<br />
<br />
:''[Moved from [[User talk:Lahwaacz]] -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 00:27, 13 October 2015 (UTC)]''<br />
<br />
Hello, you recently removed the section on {{AUR|fontconfig-good-defaults}} from the wiki and flagged for deletion it on the AUR.<br />
<br />
>There are much better ways to share *your* personal configs. If something is missing on this page, add it and *explain* what it does.<br />
<br />
Then let me explain. This package enables a variety of settings that would be the upstream default for all of FreeType and Fontconfig if it were not for a massive number of United States patents on font rendering. (See http://freetype.org/patents.html) You seem to be implying that these settings are not suitable for other people's systems and that it only changes the configuration to my personal preferences, which is not the case.<br />
<br />
It is very similar to the Infinality and Ubuntu patchset, although it does not require patching FreeType and Fontconfig because Arch Linux already does this. However, Arch Linux does not enable the patent encumbered settings by default. Seeing as most people do not live in the United States, do not want to have to patch packages, and do not want to understand the intricacies of Fontconfig XML configuration and FreeType patching to get decent fonts, I made this into an easy to install package.<br />
<br />
I do agree that the wiki needs a section on enabling the Arch Linux patches. However, it is wrong to remove fontconfig-good-defaults from the wiki or the AUR. It is essentially Infinality, but much simpler and in vast majority of cases does not require any additional changes after installing. In fact, most of the configuration that it enables has already been on the wiki for years as the recommended example fontconfig configuration.<br />
<br />
If I elaborated on this in the section, would you be willing to it allow back on the wiki? If so, I will also write a separate section on enabling the Arch Linux patches.<br />
<br />
Even if you disagree about it being on the wiki, flagging it for deletion on the AUR was completely wrong. This package in no way violates the rules of submission for the AUR. (See https://wiki.archlinux.org/index.php/Arch_User_Repository#Rules_of_submission) Can you please revoke the deletion request?<br />
<br />
The reason I put this on the AUR was to make it easy to enable settings that should be the default. You claim to know of better ways to share this configuration; can you please explain these to me? Using the AUR seemed like the best solution as it allows for easy installation and maintenance updates.<br />
<br />
I appreciate you taking the time to read this. Please address the AUR request in a timely manner.<br />
<br />
[[User:Sushi Dude|Sushi Dude]] ([[User talk:Sushi Dude|talk]]) 11:12, 21 September 2015 (UTC)<br />
<br />
:One thing I don't comprehend is how implementing a feature in some FOSS project can be in compliance with the patent rules, but enabling it by default noncompliant.<br />
:But this is not about patents, licenses or rules of submission for the AUR (except that it says to "Make sure the package is useful"). This is about how Arch distributes configuration files. Leaving aside extensive patchsets, there is always one set of configuration files distributed as part of the package, with defaults taken usually directly from upstream. Any customizations are to be applied by the end users, who are responsible for the configuration of their system, not by packagers. Providing modified configuration files as packages effectively prevents other customizations (i.e. why would you modify a modified configuration?). Have you seen any configuration-only packages in the official repositories or even the AUR?<br />
:As for the Arch wiki, its purpose is to provide a manual for the customizations, not ready-made configuration file sets without any description or explanation why the changes were made. One way of sharing personal configuration is described in [[Dotfiles]].<br />
:Edit: it is not possible for me to withdraw the deletion request, it will have to be accepted or rejected by a [[TU]].<br />
:-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 12:37, 21 September 2015 (UTC)<br />
<br />
::>One thing I don't comprehend is how implementing a feature in some FOSS project can be in compliance with the patent rules, but enabling it by default noncompliant.<br />
::You and me both.<br />
<br />
::>Providing modified configuration files as packages effectively prevents other customizations<br />
::I specifically made the package such that it will not overwrite any settings set by the users.<br />
<br />
::>Have you seen any configuration-only packages in the official repositories or even the AUR?<br />
::Yes, actually. Off the top of my head I can think of grml-zsh-config in extra and zsh-syntax-highlighting in community.<br />
<br />
::>As for the Arch wiki, its purpose is to provide a manual for the customizations, not ready-made configuration file sets without any description or explanation why the changes were made.<br />
::I do not understand why the Infinality and Ubuntu patchsets are an exception to this rule.<br />
<br />
::I am trying to simplify the need for configuring fonts in the first place. Considering how most people use that wiki page solely to enable features that are disabled because of patents.<br />
::[[User:Sushi Dude|Sushi Dude]] ([[User talk:Sushi Dude|talk]]) 13:16, 21 September 2015 (UTC)<br />
<br />
:::{{Pkg|zsh-syntax-highlighting}} provides an "extension" for the basic shell and has to be enabled and configured manually. But you got me on {{Pkg|grml-zsh-config}}, one reason for it being an official package is its presence on the installation image.<br />
:::Why do you think that [[Infinality]] has special treatment on ArchWiki?<br />
:::-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:27, 21 September 2015 (UTC)<br />
<br />
:::: Some follow up edits: [https://wiki.archlinux.org/index.php?title=Font_configuration/Examples&curid=9267&diff=401171&oldid=401157] [https://wiki.archlinux.org/index.php?title=Font_configuration&curid=1049&diff=401167&oldid=401163] [https://wiki.archlinux.org/index.php?title=Font_configuration&curid=1049&diff=401151&oldid=401150] [https://wiki.archlinux.org/index.php?title=Infinality&curid=17064&diff=401146&oldid=400897]<br />
:::: Re Ubuntu, if we can't document this properly, I'd argue in removing the package links from the wiki.<br />
:::: As to Infinality, it isn't special per se, but bohoomil's configuration is: from [[Infinality#Installation_2]]:<br />
:::::Infinality-bundle is a collection of software providing an '''easy, "install-and-forget" method''' of improving text rendering in Arch Linux.<br />
:::: -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 15:40, 21 September 2015 (UTC)<br />
<br />
:::::The request was accepted [https://lists.archlinux.org/pipermail/aur-requests/2015-September/008686.html], but the other points remain, so I'll leave this open for now. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 00:29, 13 October 2015 (UTC)<br />
<br />
::::::In response to the request being accepted see:<br />
::::::https://lists.archlinux.org/pipermail/aur-requests/2015-October/008716.html<br />
::::::https://lists.archlinux.org/pipermail/aur-requests/2015-October/008718.html<br />
::::::https://lists.archlinux.org/pipermail/aur-requests/2015-October/008740.html<br />
::::::[[User:Sushi Dude|Sushi Dude]] ([[User talk:Sushi Dude|talk]]) 06:27, 17 October 2015 (UTC)</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=User_talk:Lahwaacz&diff=401135User talk:Lahwaacz2015-09-21T13:20:00Z<p>Sushi Dude: /* Font Configuration - fontconfig-good-defaults */ Re: re</p>
<hr />
<div>== Regex for replacing = codes ==<br />
<br />
Hi, regarding [[User:Lahwaacz#User:Lahwaacz#Regex_for_replacing_.3D_codes]] do you intend to use a similar expression with the editor assistant or directly with the bot? In the latter case I think it would be pretty dangerous, for example it would break templates that already use a named parameter, e.g. {{ic|<nowiki>{{Template|parameter=value}}</nowiki>}} would be turned into {{ic|<nowiki>{{Template|1=parameter=value}}</nowiki>}}. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 16:57, 21 March 2014 (UTC)<br />
<br />
:I used it [https://wiki.archlinux.org/index.php?title=Systemd-networkd&diff=prev&oldid=306182 only once] and don't have any specific plans, but I'm quite certain I will need to use it again sometimes... Thanks for the warning, I will be cautious. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 17:50, 21 March 2014 (UTC)<br />
<br />
== PodCastXDL ==<br />
<br />
About [https://wiki.archlinux.org/index.php?title=List_of_applications/Internet&diff=prev&oldid=323048] (and [https://wiki.archlinux.org/index.php?title=List_of_applications/Internet&diff=next&oldid=323048]) [[User:Levi0x0x]], who should have indeed provided an edit summary, appears to be the developer of the application and the maintainer of the PKGBUILD. I would keep his edit. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 00:45, 5 July 2014 (UTC)<br />
<br />
:I know - I've seen also [https://wiki.archlinux.org/index.php?title=MPlayer&diff=next&oldid=322278 bash-player] removed, both from wiki and Github (it seems the repo has been recreated from scratch). PodCastXDL has always been available upstream. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:20, 5 July 2014 (UTC)<br />
<br />
::Didn't he add it to the list one week ago? [https://wiki.archlinux.org/index.php?title=List_of_applications/Internet&diff=prev&oldid=322258] Maybe he's found some bug and doesn't want people to use it until he fixes it? Anyway I'm not that interested, we can as well see if/how Levi0x0x reacts. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 04:32, 6 July 2014 (UTC)<br />
<br />
== bot AUR to Official Repository edit ==<br />
<br />
A recent bot edit ([https://github.com/lahwaacz/wiki-scripts/blob/master/update-package-templates.py update Pkg/AUR templates]) by [[User:Lahwaacz.bot]] on the [[Gitolite]] page correctly changed the AUR template to Pkg but left the [[Arch User Repository]] link<br />
<br />
I fixed this, but would it be possible to modify the bot to take this into consideration?<br />
<br />
I can imagine that blanket changing AUR links to Official Repository links in any given page could be dangerous - but for common phrasing or possibly word distance it would seem to be relatively safe<br />
<br />
Or is there some sort of post-run manual inspection that I am unaware of that handles this situation? <br />
<br />
Specifically this [https://wiki.archlinux.org/index.php?title=Gitolite&diff=next&oldid=366859 edit]<br />
<br />
From:<br />
<pre><br />
{{AUR|gitolite}} is available in the [[Arch User Repository]]<br />
</pre><br />
<br />
To:<br />
<pre><br />
{{Pkg|gitolite}} is available in the [[Arch User Repository]]<br />
</pre><br />
<br />
<br />
<br />
[[User:Tido.com|Tido.com]] ([[User talk:Tido.com|talk]]) 01:50, 1 April 2015 (UTC)<br />
<br />
By "word distance" above what I _meant_ was [[Wikipedia:Edit Distance|Edit Distance]] ;)<br />
<br />
I was initially thinking of Hamming distance - but apparently that is for strings of equal length.<br />
<br />
What looks more promising is the Levenshtein distance - specifically "Comparing a list of strings" from the Python [https://pypi.python.org/pypi/Distance/0.1.3 Distance] package.<br />
<br />
Example shamelessly ripped from that page:<br />
<br />
(mainly because I couldn't link directly to the relevant section)<br />
<br />
<pre><br />
>>> sent1 = ['the', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog']<br />
>>> sent2 = ['the', 'lazy', 'fox', 'jumps', 'over', 'the', 'crazy', 'dog']<br />
>>> distance.levenshtein(sent1, sent2)<br />
3<br />
</pre><br />
[[User:Tido.com|Tido.com]] ([[User talk:Tido.com|talk]]) 04:07, 1 April 2015 (UTC)<br />
<br />
:Hi,<br />
:the bot currently does not touch the surrounding text at all, it only modifies the package templates or appends [[Template:Broken package link]] when the package is not found. This is obviously not perfect, this behaviour may lead to some incorrect combinations as you noticed, but blindly fixing the package links and not the surrounding text is still considered to be an improvement. Checking the surrounding text manually would require a lot of manpower, which we don't have, so it is currently not done systematically. Feel free to ask for further details or see the most recent discussion: [[ArchWiki:Requests#Strategy_for_updating_package_templates]].<br />
:Regarding automatic updates of the surrounding text, the edit distance gives a clue about whether given edit should be performed or not, but it does not define how an edit should be performed. It can be useful in cases where there are multiple feasible substitutions in text and the strategy to select the optimal substitution is e.g. to minimize the Levenshtein distance. But we don't have any algorithm to generate feasible substitutions yet, so this technique fails. The surrounding text substitution is also very context sensitive and wiki bots must be designed in a way to minimize (ideally avoid completely) the [[wikipedia:Error_of_the_first_kind|error of the first kind]], which in this case is modifying correct text to be incorrect. This makes defining general rules for the text substitution really hard, on the other hand many rules would be necessary to cover even the basic form of standard wording, so in the end both ways may be comparably hard. Anyway, if you have some ideas, I'm all ears :)<br />
:-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 17:51, 1 April 2015 (UTC)<br />
<br />
== rc-local example ==<br />
<br />
Hi, you deleted my example of a rc.local systemd unit file [https://wiki.archlinux.org/index.php?title=Systemd&diff=next&oldid=378924], saying it doesn't belong where I put it. Can you suggest where it belongs? [[User:Herodotus|Herodotus]] ([[User talk:Herodotus|talk]]) 11:15, 16 June 2015 (UTC)<br />
<br />
:I'm sorry for the late reply, I've been looking for a suitable place and frankly, I didn't find any. I guess the rc.local file just doesn't fit to systemd, which encourages modular approach instead of stacking everything into a single script. See also [https://bbs.archlinux.org/viewtopic.php?pid=1152201#p1152201]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:59, 6 September 2015 (UTC)<br />
<br />
::There's even an AUR package {{AUR|rc-local}} ... It likely behaves differently than sysvinit rc.local, because systemd is more strict with e.g environment variables. Let people stick to the supported methods instead. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 12:47, 21 September 2015 (UTC)<br />
<br />
== <s>ru Audio/Video category</s> ==<br />
<br />
Hi, lahwaacz. I've renamed russian Audio/Video category and recategorized all pages belonged to it. I would like you to check correctness of these actions and to delete our old category -- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 11:15, 1 September 2015 (UTC)<br />
<br />
:You've done well, thank you. There was only one detail, you should have marked the old category with [[Template:Deletion]] (it does not matter if it is a redirect at the same time) to make it visible in [[Special:WhatLinksHere/Template:Deletion]]. You can follow [[Help:Procedures#Rename_a_category]] next time :) [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:55, 1 September 2015 (UTC)<br />
<br />
== Font Configuration - fontconfig-good-defaults ==<br />
<br />
Hello, you recently removed the section on {{AUR|fontconfig-good-defaults}} from the wiki and flagged for deletion it on the AUR.<br />
<br />
>There are much better ways to share *your* personal configs. If something is missing on this page, add it and *explain* what it does.<br />
<br />
Then let me explain. This package enables a variety of settings that would be the upstream default for all of FreeType and Fontconfig if it were not for a massive number of United States patents on font rendering. (See http://freetype.org/patents.html) You seem to be implying that these settings are not suitable for other people's systems and that it only changes the configuration to my personal preferences, which is not the case.<br />
<br />
It is very similar to the Infinality and Ubuntu patchset, although it does not require patching FreeType and Fontconfig because Arch Linux already does this. However, Arch Linux does not enable the patent encumbered settings by default. Seeing as most people do not live in the United States, do not want to have to patch packages, and do not want to understand the intricacies of Fontconfig XML configuration and FreeType patching to get decent fonts, I made this into an easy to install package.<br />
<br />
I do agree that the wiki needs a section on enabling the Arch Linux patches. However, it is wrong to remove fontconfig-good-defaults from the wiki or the AUR. It is essentially Infinality, but much simpler and in vast majority of cases does not require any additional changes after installing. In fact, most of the configuration that it enables has already been on the wiki for years as the recommended example fontconfig configuration.<br />
<br />
If I elaborated on this in the section, would you be willing to it allow back on the wiki? If so, I will also write a separate section on enabling the Arch Linux patches.<br />
<br />
Even if you disagree about it being on the wiki, flagging it for deletion on the AUR was completely wrong. This package in no way violates the rules of submission for the AUR. (See https://wiki.archlinux.org/index.php/Arch_User_Repository#Rules_of_submission) Can you please revoke the deletion request?<br />
<br />
The reason I put this on the AUR was to make it easy to enable settings that should be the default. You claim to know of better ways to share this configuration; can you please explain these to me? Using the AUR seemed like the best solution as it allows for easy installation and maintenance updates.<br />
<br />
I appreciate you taking the time to read this. Please address the AUR request in a timely manner.<br />
<br />
[[User:Sushi Dude|Sushi Dude]] ([[User talk:Sushi Dude|talk]]) 11:12, 21 September 2015 (UTC)<br />
<br />
:One thing I don't comprehend is how implementing a feature in some FOSS project can be in compliance with the patent rules, but enabling it by default noncompliant.<br />
:But this is not about patents, licenses or rules of submission for the AUR (except that it says to "Make sure the package is useful"). This is about how Arch distributes configuration files. Leaving aside extensive patchsets, there is always one set of configuration files distributed as part of the package, with defaults taken usually directly from upstream. Any customizations are to be applied by the end users, who are responsible for the configuration of their system, not by packagers. Providing modified configuration files as packages effectively prevents other customizations (i.e. why would you modify a modified configuration?). Have you seen any configuration-only packages in the official repositories or even the AUR?<br />
:As for the Arch wiki, its purpose is to provide a manual for the customizations, not ready-made configuration file sets without any description or explanation why the changes were made. One way of sharing personal configuration is described in [[Dotfiles]].<br />
:Edit: it is not possible for me to withdraw the deletion request, it will have to be accepted or rejected by a [[TU]].<br />
:-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 12:37, 21 September 2015 (UTC)<br />
<br />
::>One thing I don't comprehend is how implementing a feature in some FOSS project can be in compliance with the patent rules, but enabling it by default noncompliant.<br />
::You and me both.<br />
<br />
::>Providing modified configuration files as packages effectively prevents other customizations<br />
::I specifically made the package such that it will not overwrite any settings set by the users.<br />
<br />
::>Have you seen any configuration-only packages in the official repositories or even the AUR?<br />
::Yes, actually. Off the top of my head I can think of grml-zsh-config in extra and zsh-syntax-highlighting in community.<br />
<br />
::>As for the Arch wiki, its purpose is to provide a manual for the customizations, not ready-made configuration file sets without any description or explanation why the changes were made.<br />
::I do not understand why the Infinality and Ubuntu patchsets are an exception to this rule.<br />
<br />
::I am trying to simplify the need for configuring fonts in the first place. Considering how most people use that wiki page solely to enable features that are disabled because of patents.<br />
::[[User:Sushi Dude|Sushi Dude]] ([[User talk:Sushi Dude|talk]]) 13:16, 21 September 2015 (UTC)</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=User_talk:Lahwaacz&diff=401126User talk:Lahwaacz2015-09-21T11:12:45Z<p>Sushi Dude: Started discussion regarding how you recently removed the section on fontconfig-good-defaults from the wiki and flagged for deletion it on the AUR.</p>
<hr />
<div>== Regex for replacing = codes ==<br />
<br />
Hi, regarding [[User:Lahwaacz#User:Lahwaacz#Regex_for_replacing_.3D_codes]] do you intend to use a similar expression with the editor assistant or directly with the bot? In the latter case I think it would be pretty dangerous, for example it would break templates that already use a named parameter, e.g. {{ic|<nowiki>{{Template|parameter=value}}</nowiki>}} would be turned into {{ic|<nowiki>{{Template|1=parameter=value}}</nowiki>}}. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 16:57, 21 March 2014 (UTC)<br />
<br />
:I used it [https://wiki.archlinux.org/index.php?title=Systemd-networkd&diff=prev&oldid=306182 only once] and don't have any specific plans, but I'm quite certain I will need to use it again sometimes... Thanks for the warning, I will be cautious. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 17:50, 21 March 2014 (UTC)<br />
<br />
== PodCastXDL ==<br />
<br />
About [https://wiki.archlinux.org/index.php?title=List_of_applications/Internet&diff=prev&oldid=323048] (and [https://wiki.archlinux.org/index.php?title=List_of_applications/Internet&diff=next&oldid=323048]) [[User:Levi0x0x]], who should have indeed provided an edit summary, appears to be the developer of the application and the maintainer of the PKGBUILD. I would keep his edit. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 00:45, 5 July 2014 (UTC)<br />
<br />
:I know - I've seen also [https://wiki.archlinux.org/index.php?title=MPlayer&diff=next&oldid=322278 bash-player] removed, both from wiki and Github (it seems the repo has been recreated from scratch). PodCastXDL has always been available upstream. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:20, 5 July 2014 (UTC)<br />
<br />
::Didn't he add it to the list one week ago? [https://wiki.archlinux.org/index.php?title=List_of_applications/Internet&diff=prev&oldid=322258] Maybe he's found some bug and doesn't want people to use it until he fixes it? Anyway I'm not that interested, we can as well see if/how Levi0x0x reacts. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 04:32, 6 July 2014 (UTC)<br />
<br />
== bot AUR to Official Repository edit ==<br />
<br />
A recent bot edit ([https://github.com/lahwaacz/wiki-scripts/blob/master/update-package-templates.py update Pkg/AUR templates]) by [[User:Lahwaacz.bot]] on the [[Gitolite]] page correctly changed the AUR template to Pkg but left the [[Arch User Repository]] link<br />
<br />
I fixed this, but would it be possible to modify the bot to take this into consideration?<br />
<br />
I can imagine that blanket changing AUR links to Official Repository links in any given page could be dangerous - but for common phrasing or possibly word distance it would seem to be relatively safe<br />
<br />
Or is there some sort of post-run manual inspection that I am unaware of that handles this situation? <br />
<br />
Specifically this [https://wiki.archlinux.org/index.php?title=Gitolite&diff=next&oldid=366859 edit]<br />
<br />
From:<br />
<pre><br />
{{AUR|gitolite}} is available in the [[Arch User Repository]]<br />
</pre><br />
<br />
To:<br />
<pre><br />
{{Pkg|gitolite}} is available in the [[Arch User Repository]]<br />
</pre><br />
<br />
<br />
<br />
[[User:Tido.com|Tido.com]] ([[User talk:Tido.com|talk]]) 01:50, 1 April 2015 (UTC)<br />
<br />
By "word distance" above what I _meant_ was [[Wikipedia:Edit Distance|Edit Distance]] ;)<br />
<br />
I was initially thinking of Hamming distance - but apparently that is for strings of equal length.<br />
<br />
What looks more promising is the Levenshtein distance - specifically "Comparing a list of strings" from the Python [https://pypi.python.org/pypi/Distance/0.1.3 Distance] package.<br />
<br />
Example shamelessly ripped from that page:<br />
<br />
(mainly because I couldn't link directly to the relevant section)<br />
<br />
<pre><br />
>>> sent1 = ['the', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog']<br />
>>> sent2 = ['the', 'lazy', 'fox', 'jumps', 'over', 'the', 'crazy', 'dog']<br />
>>> distance.levenshtein(sent1, sent2)<br />
3<br />
</pre><br />
[[User:Tido.com|Tido.com]] ([[User talk:Tido.com|talk]]) 04:07, 1 April 2015 (UTC)<br />
<br />
:Hi,<br />
:the bot currently does not touch the surrounding text at all, it only modifies the package templates or appends [[Template:Broken package link]] when the package is not found. This is obviously not perfect, this behaviour may lead to some incorrect combinations as you noticed, but blindly fixing the package links and not the surrounding text is still considered to be an improvement. Checking the surrounding text manually would require a lot of manpower, which we don't have, so it is currently not done systematically. Feel free to ask for further details or see the most recent discussion: [[ArchWiki:Requests#Strategy_for_updating_package_templates]].<br />
:Regarding automatic updates of the surrounding text, the edit distance gives a clue about whether given edit should be performed or not, but it does not define how an edit should be performed. It can be useful in cases where there are multiple feasible substitutions in text and the strategy to select the optimal substitution is e.g. to minimize the Levenshtein distance. But we don't have any algorithm to generate feasible substitutions yet, so this technique fails. The surrounding text substitution is also very context sensitive and wiki bots must be designed in a way to minimize (ideally avoid completely) the [[wikipedia:Error_of_the_first_kind|error of the first kind]], which in this case is modifying correct text to be incorrect. This makes defining general rules for the text substitution really hard, on the other hand many rules would be necessary to cover even the basic form of standard wording, so in the end both ways may be comparably hard. Anyway, if you have some ideas, I'm all ears :)<br />
:-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 17:51, 1 April 2015 (UTC)<br />
<br />
== rc-local example ==<br />
<br />
Hi, you deleted my example of a rc.local systemd unit file [https://wiki.archlinux.org/index.php?title=Systemd&diff=next&oldid=378924], saying it doesn't belong where I put it. Can you suggest where it belongs? [[User:Herodotus|Herodotus]] ([[User talk:Herodotus|talk]]) 11:15, 16 June 2015 (UTC)<br />
<br />
:I'm sorry for the late reply, I've been looking for a suitable place and frankly, I didn't find any. I guess the rc.local file just doesn't fit to systemd, which encourages modular approach instead of stacking everything into a single script. See also [https://bbs.archlinux.org/viewtopic.php?pid=1152201#p1152201]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:59, 6 September 2015 (UTC)<br />
<br />
== <s>ru Audio/Video category</s> ==<br />
<br />
Hi, lahwaacz. I've renamed russian Audio/Video category and recategorized all pages belonged to it. I would like you to check correctness of these actions and to delete our old category -- [[User:Kycok|Kycok]] ([[User talk:Kycok|talk]]) 11:15, 1 September 2015 (UTC)<br />
<br />
:You've done well, thank you. There was only one detail, you should have marked the old category with [[Template:Deletion]] (it does not matter if it is a redirect at the same time) to make it visible in [[Special:WhatLinksHere/Template:Deletion]]. You can follow [[Help:Procedures#Rename_a_category]] next time :) [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:55, 1 September 2015 (UTC)<br />
<br />
== Font Configuration - fontconfig-good-defaults ==<br />
<br />
Hello, you recently removed the section on {{AUR|fontconfig-good-defaults}} from the wiki and flagged for deletion it on the AUR.<br />
<br />
>There are much better ways to share *your* personal configs. If something is missing on this page, add it and *explain* what it does.<br />
<br />
Then let me explain. This package enables a variety of settings that would be the upstream default for all of FreeType and Fontconfig if it were not for a massive number of United States patents on font rendering. (See http://freetype.org/patents.html) You seem to be implying that these settings are not suitable for other people's systems and that it only changes the configuration to my personal preferences, which is not the case.<br />
<br />
It is very similar to the Infinality and Ubuntu patchset, although it does not require patching FreeType and Fontconfig because Arch Linux already does this. However, Arch Linux does not enable the patent encumbered settings by default. Seeing as most people do not live in the United States, do not want to have to patch packages, and do not want to understand the intricacies of Fontconfig XML configuration and FreeType patching to get decent fonts, I made this into an easy to install package.<br />
<br />
I do agree that the wiki needs a section on enabling the Arch Linux patches. However, it is wrong to remove fontconfig-good-defaults from the wiki or the AUR. It is essentially Infinality, but much simpler and in vast majority of cases does not require any additional changes after installing. In fact, most of the configuration that it enables has already been on the wiki for years as the recommended example fontconfig configuration.<br />
<br />
If I elaborated on this in the section, would you be willing to it allow back on the wiki? If so, I will also write a separate section on enabling the Arch Linux patches.<br />
<br />
Even if you disagree about it being on the wiki, flagging it for deletion on the AUR was completely wrong. This package in no way violates the rules of submission for the AUR. (See https://wiki.archlinux.org/index.php/Arch_User_Repository#Rules_of_submission) Can you please revoke the deletion request?<br />
<br />
The reason I put this on the AUR was to make it easy to enable settings that should be the default. You claim to know of better ways to share this configuration; can you please explain these to me? Using the AUR seemed like the best solution as it allows for easy installation and maintenance updates.<br />
<br />
I appreciate you taking the time to read this. Please address the AUR request in a timely manner.<br />
<br />
[[User:Sushi Dude|Sushi Dude]] ([[User talk:Sushi Dude|talk]]) 11:12, 21 September 2015 (UTC)</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Makepkg&diff=400023Makepkg2015-09-16T02:10:20Z<p>Sushi Dude: /* MAKEFLAGS */ Recommend that nproc be included in the MAKEFLAGS so that a single configuration will work across computers with any number of processors.</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Package development]]<br />
[[Category:About Arch]]<br />
[[ar:Makepkg]]<br />
[[el:Makepkg]]<br />
[[es: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|gpg.conf}}, for example:<br />
<br />
{{hc|~/.gnupg/gpg.conf|<br />
keyserver hkp://keys.gnupg.net<br />
}}<br />
<br />
To import the key from the server, use:<br />
<br />
$ gpg --recv-keys ''1234567890''<br />
<br />
Or to automate:<br />
<br />
{{hc|~/.gnupg/gpg.conf|<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 />
As of version 4.3.0, GCC offers the {{ic|1=-march=native}} switch that enables CPU auto-detection and automatically selects optimizations supported by the local machine at GCC runtime. To use it, modify the default settings by changing the {{ic|CFLAGS}} and {{ic|CXXFLAGS}} lines as follows:<br />
<br />
# -march=native also sets the correct -mtune=<br />
CFLAGS="-march=native -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"<br />
CXXFLAGS="${CFLAGS}"<br />
<br />
To see what {{ic|1=march=native}} flags are, use [https://github.com/pixelb/scripts/blob/master/scripts/gcccpuopt gcccpuopt] or run:<br />
<br />
$ gcc -march=native -E -v - </dev/null 2>&1 | sed -n 's/.* -v - //p'<br />
<br />
Further optimizing for CPU type may theoretically enhance performance as {{ic|1=-march=native}} enables all available instruction sets and improves scheduling for a particular CPU. This could be noticeable with applications (for example: audio/video encoding tools, scientific applications, math-heavy programs, etc.) that take advantage of newer instructions sets not enabled with the default options (or packages) provided by Arch Linux. <br />
<br />
It is however very easy to reduce performance by using "non-standard" CFLAGS, because depending the options, compilers tend to heavily blow up the code size with loop unrolling, bad vectorization, crazy inlining, etc. Unless you can verify/benchmark that something is faster, there is a very good chance it is not! <br />
<br />
See the {{ic|man gcc}} for a complete list of available options. 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.<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 only want to install packages locally, you can speed up the process by avoiding the [[Wikipedia:xz|LZMA2]] compression and subsequent decompression:<br />
<br />
{{hc|/etc/makepkg.conf|2=<br />
[...]<br />
#PKGEXT='.pkg.tar.xz'<br />
PKGEXT='.pkg.tar'<br />
[...]<br />
}}<br />
<br />
=== Utilizing multiple cores on compression ===<br />
{{pkg|xz}} supports [[Wikipedia:Symmetric multiprocessing|symmetric multiprocessing (SMP)]] on compression. This can be done by using the {{ic|1=-T 0}}/{{ic|1=--threads=0}} flag, which makes ''xz'' use as many threads as there are cores on the system:<br />
<br />
{{hc|/etc/makepkg.conf|2=<br />
[...]<br />
COMPRESSXZ=(xz -T 0 -c -z -)<br />
[...]<br />
}}<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>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Font_configuration&diff=400022Font configuration2015-09-16T00:49:24Z<p>Sushi Dude: Reformatted the links in the summary.</p>
<hr />
<div>[[Category:Fonts]]<br />
[[it:Font configuration]]<br />
[[ja:フォント設定]]<br />
[[ru:Font configuration]]<br />
[[sr:Font configuration]]<br />
[[tr:Yazıtipi yapılandırması]]<br />
[[zh-cn:Font configuration]]<br />
{{Related articles start}}<br />
{{Related|Fonts}}<br />
{{Related|Font configuration/fontconfig examples}}<br />
{{Related|Infinality}}<br />
{{Related|Java Runtime Environment Fonts}}<br />
{{Related|MS Fonts}}<br />
{{Related|X Logical Font Description}}<br />
{{Related articles end}}<br />
<br />
[http://www.freedesktop.org/wiki/Software/fontconfig/ Fontconfig] is a library designed to provide a list of available [[fonts]] to applications, and also for configuration for how fonts get rendered. See package {{Pkg|fontconfig}} and [[Wikipedia:Fontconfig]]. The FreeType library ({{Pkg|freetype2}} package) renders the fonts, based on this configuration.<br />
<br />
Though Fontconfig is the standard in today's Linux, some applications still rely on the original method of font selection and display, the [[X Logical Font Description]].<br />
<br />
The font rendering packages on Arch Linux includes support for ''freetype2'' with the bytecode interpreter (BCI) enabled. Patched packages exist for better font rendering, especially with an LCD monitor. See the [[#Patched packages|patched packages]] and [[#Enhanced default settings|enhanced default settings]] below. The [[Infinality]] package allows both auto-hinting and subpixel rendering, allows the LCD filter to be tweaked without recompiling, and allows the auto-hinter to work well with bold fonts.<br />
<br />
== Font paths ==<br />
<br />
For fonts to be known to applications, they must be cataloged for easy and quick access.<br />
<br />
The font paths initially known to Fontconfig are: {{ic|/usr/share/fonts/}}, {{ic|~/.local/share/fonts}} (and {{ic|~/.fonts/}}, now deprecated). Fontconfig will scan these directories recursively. For ease of organization and installation, it is recommended to use these font paths when [[adding fonts]].<br />
<br />
To see a list of known Fontconfig fonts:<br />
$ fc-list : file<br />
<br />
See {{ic|man fc-list}} for more output formats.<br />
<br />
Check for Xorg's known font paths by reviewing its log:<br />
$ grep /fonts /var/log/Xorg.0.log<br />
<br />
{{Tip|You can also check the list of [[Xorg]]'s known font paths using the command {{ic|xset q}}.}}<br />
<br />
Keep in mind that Xorg does not search recursively through the {{ic|/usr/share/fonts/}} directory like Fontconfig does. To add a path, the full path must be used:<br />
Section "Files"<br />
FontPath "/usr/share/fonts/local/"<br />
EndSection<br />
<br />
If you want font paths to be set on a per-user basis, you can add and remove font paths from the default by adding the following line(s) to {{ic|~/.xinitrc}}:<br />
xset +fp /usr/share/fonts/local/ # Prepend a custom font path to Xorg's list of known font paths<br />
xset -fp /usr/share/fonts/sucky_fonts/ # Remove the specified font path from Xorg's list of known font paths<br />
<br />
To see a list of known Xorg fonts use {{ic|xlsfonts}}, from the {{Pkg|xorg-xlsfonts}} package.<br />
<br />
== Fontconfig configuration ==<br />
<br />
Fontconfig is documented in the [http://www.freedesktop.org/software/fontconfig/fontconfig-user.html fonts-conf] man page.<br />
<br />
Configuration can be done per-user through {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}, and globally with {{ic|/etc/fonts/local.conf}}. The settings in the per-user configuration have precedence over the global configuration. Both these files use the same syntax.<br />
{{Note|Configuration files and directories: {{ic|~/.fonts.conf/}}, {{ic|~/.fonts.conf.d/}} and {{ic|~/.fontconfig/*.cache-*}} are deprecated since {{Pkg|fontconfig}} 2.10.1 ([http://cgit.freedesktop.org/fontconfig/commit/?id&#61;8c255fb185d5651b57380b0a9443001e8051b29d upstream commit]) and will not be read by default in the future versions of the package. New paths are {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}, {{ic|$XDG_CONFIG_HOME/fontconfig/conf.d/NN-name.conf}} and {{ic|$XDG_CACHE_HOME/fontconfig/*.cache-*}} respectively. If using the second location, make sure the naming is valid (where {{ic|NN}} is a two digit number like {{ic|00}}, {{ic|10}}, or {{ic|99}}).}}<br />
<br />
Fontconfig gathers all its configurations in a central file ({{ic|/etc/fonts/fonts.conf}}). This file is replaced during fontconfig updates and should not be edited. Fontconfig-aware applications source this file to know available fonts and how they get rendered. This file is a conglomeration of rules from the global configuration ({{ic|/etc/fonts/local.conf}}), the configured presets in {{ic|/etc/fonts/conf.d/}}, and the user configuration file ({{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}). {{ic|fc-cache}} can be used to rebuild fontconfig's configuration, although changes will only be visible in newly launched applications.<br />
<br />
{{Note|For some desktop environments (such as [[GNOME]] and [[KDE]]) using the ''Font Control Panel'' will automatically create or overwrite the user font configuration file. For these desktop environments, it is best to match your already defined font configurations to get the expected behavior.}}<br />
<br />
Fontconfig configuration files use [[Wikipedia:XML|XML]] format and need these headers:<br />
<br />
{{bc|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<br />
<!-- settings go here --><br />
<br />
</fontconfig><br />
</nowiki>}}<br />
<br />
The configuration examples in this article omit these tags.<br />
<br />
=== Presets ===<br />
<br />
There are presets installed in the directory {{ic|/etc/fonts/conf.avail}}. They can be enabled by creating [[Wikipedia:Symbolic link|symbolic link]]s to them, both per-user and globally, as described in {{ic|/etc/fonts/conf.d/README}}. These presets will override matching settings in their respective configuration files.<br />
<br />
For example, to enable sub-pixel RGB rendering globally:<br />
<br />
# cd /etc/fonts/conf.d<br />
# ln -s ../conf.avail/10-sub-pixel-rgb.conf<br />
<br />
To do the same but instead for a per-user configuration:<br />
<br />
$ mkdir $XDG_CONFIG_HOME/fontconfig/conf.d<br />
$ ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf $XDG_CONFIG_HOME/fontconfig/conf.d<br />
<br />
=== Anti-aliasing ===<br />
<br />
[[Wikipedia:Font rasterization|Font rasterization]] converts vector font data to bitmap data so that it can be displayed. The result can appear jagged due to [[Wikipedia:Aliasing|aliasing]]. [[Wikipedia:Anti-aliasing|anti-aliasing]] is enabled by default and increases the apparent resolution of font edges.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Some applications, like [[GNOME 3]] may [[#Troubleshooting|override default anti-aliasing settings]].}}<br />
<br />
=== Hinting ===<br />
<br />
[[Wikipedia:Font hinting|Font hinting]] (also known as instructing) is the use of mathematical instructions to adjust the display of an outline font so that it lines up with a rasterized grid, (i.e. the pixel grid of the display). Its intended effect is to make fonts appear more crisp so that they are more readable. Fonts will line up correctly without hinting when displays have around 300 [[Wikipedia:Dots per inch|DPI]]. Two types of hinting are available.<br />
<br />
==== Byte-Code Interpreter (BCI) ====<br />
<br />
Using BCI hinting, instructions in TrueType fonts are rendered according to FreeTypes's interpreter. BCI hinting works well with fonts with good hinting instructions. To enable hinting:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="hinting" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Autohinter ====<br />
<br />
The Autohinter attempts to do automatic hinting and disregards any existing hinting information. Originally it was the default because TrueType2 fonts were patent-protected but now that these patents have expired there is very little reason to use it. It does work better with fonts that have broken or no hinting information but it will be strongly sub-optimal for fonts with good hinting information. Generally common fonts are of the later kind so autohinter will not be useful. To enable auto-hinting:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="autohint" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Hintstyle ====<br />
<br />
Hintstyle is the amount of font reshaping done to line up to the grid. Hinting values are: {{ic|hintnone}}, {{ic|hintslight}}, {{ic|hintmedium}}, and {{ic|hintfull}}. {{ic|hintslight}} will make the font more fuzzy to line up to the grid but will be better in retaining font shape, while {{ic|hintfull}} will be a crisp font that aligns well to the pixel grid but will lose a greater amount of font shape. Preferences vary.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="hintstyle" mode="assign"><br />
<const>hintfull</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Some applications, like [[GNOME 3]] may [[#Troubleshooting|override default hinting settings.]]}}<br />
<br />
=== Subpixel rendering ===<br />
<br />
Most monitors manufactured today use the Red, Green, Blue (RGB) specification. Fontconfig will need to know your monitor type to be able to display your fonts correctly. Monitors are either: '''RGB''' (most common), '''BGR''', '''V-RGB''' (vertical), or '''V-BGR'''. A monitor test can be found [http://www.lagom.nl/lcd-test/subpixel.php here]).<br />
<br />
To enable subpixel rendering:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="rgba" mode="assign"><br />
<const>rgb</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Subpixel rendering effectively triples the horizontal (or vertical) resolution for fonts by making use of subpixels. The autohinter and subpixel rendering are not designed to work together and should not be used in combination without the [[Infinality]] patch set.}}<br />
<br />
==== LCD filter ====<br />
<br />
When using subpixel rendering, you should enable the LCD filter, which is designed to reduce colour fringing. This is described under [http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html LCD filtering] in the FreeType 2 API reference. Different options are described under [http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html#FT_LcdFilter FT_LcdFilter], and are illustrated by this [http://www.spasche.net/files/lcdfiltering/ LCD filter test] page.<br />
<br />
The {{ic|lcddefault}} filter will work for most users. Other filters are available that can be used in special situations: {{ic|lcdlight}}; a lighter filter ideal for fonts that look too bold or fuzzy, {{ic|lcdlegacy}}, the original Cairo filter; and {{ic|lcdnone}} to disable it entirely.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Advanced LCD filter specification ====<br />
<br />
If the available, built-in LCD filters are not satisfactory, it is possible to tweak the font rendering very specifically by building a custom freetype2 package and modifying the hardcoded filters. The [[Arch Build System]] can be used to build and install packages from source.<br />
<br />
First, refresh the freetype2 PKGBUILD as root:<br />
<br />
# abs extra/freetype2<br />
<br />
This example uses {{ic|/var/abs/build}} as the build directory, substitute it according to your personal ABS setup. Download and extract the freetype2 package as a regular user:<br />
<br />
$ cd /var/abs/build<br />
$ cp -r ../extra/freetype2 .<br />
$ cd freetype2<br />
$ makepkg -o<br />
<br />
Edit the file {{ic|src/freetype-VERSION/src/base/ftlcdfil.c}} and look up the definition of the constant {{ic|default_filter[5]}}:<br />
<br />
static const FT_Byte default_filter[5] =<br />
{ 0x10, 0x40, 0x70, 0x40, 0x10 };<br />
<br />
This constant defines a low-pass filter applied to the rendered glyph. Modify it as needed. Save the file, build and install the custom package:<br />
<br />
$ makepkg -e<br />
# pacman -Rd freetype2<br />
# pacman -U freetype2-VERSION-ARCH.pkg.tar.xz<br />
<br />
Reboot or restart X. The lcddefault filter should now render fonts differently.<br />
<br />
=== Disable auto-hinter for bold fonts ===<br />
<br />
The auto-hinter uses sophisticated methods for font rendering, but often makes bold fonts too wide. Fortunately, a solution can be turning off the autohinter for bold fonts while leaving it on for the rest:<br />
...<br />
<match target="font"><br />
<test name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<edit name="autohint" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
...<br />
<br />
=== Enable anti-aliasing only for bigger fonts ===<br />
<br />
Some users prefer the sharper rendering that anti-aliasing does not offer:<br />
<br />
{{bc|<nowiki><br />
...<br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="size" qual="any" compare="more"><br />
<double>12</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="pixelsize" qual="any" compare="more"><br />
<double>16</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
...<br />
</nowiki>}}<br />
<br />
=== Replace fonts ===<br />
<br />
The most reliable way to do this is to add an XML fragment similar to the one below. ''Using the "binding" attribute will give you better results'', for example, in Firefox where you may not want to change properties of font being replaced. This will cause Ubuntu to be used in place of Georgia:<br />
...<br />
<match target="pattern"><br />
<test qual="any" name="family"><string>georgia</string></test><br />
<edit name="family" mode="assign" binding="same"><string>Ubuntu</string></edit><br />
</match><br />
...<br />
An alternate approach is to set the "preferred" font, but ''this only works if the original font is not on the system'', in which case the one specified will be substituted:<br />
...<br />
< !-- Replace Helvetica with Bitstream Vera Sans Mono --><br />
< !-- Note, an alias for Helvetica should already exist in default conf files --><br />
<alias><br />
<family>Helvetica</family><br />
<prefer><family>Bitstream Vera Sans Mono</family></prefer><br />
<default><family>fixed</family></default><br />
</alias><br />
...<br />
<br />
=== Whitelisting and blacklisting fonts ===<br />
<br />
The element {{ic|<selectfont>}} is used in conjunction with the {{ic|<acceptfont>}} and {{ic|<rejectfontfont>}} elements to selectively whitelist or blacklist fonts from the resolve list and match requests. The simplest and most typical use case it to reject one font that is needed to be installed, however is getting matched for a generic font query that is causing problems within application user interfaces.<br />
<br />
First obtain the Family name as listed in the font itself:<br />
<br />
{{hc|1=$ fc-scan .fonts/lklug.ttf --format='%{family}\n'|2=<br />
LKLUG<br />
}}<br />
<br />
Then use that Family name in a {{ic|<rejectfontfont>}} stanza:<br />
<br />
{{bc|<nowiki><br />
<selectfont><br />
<rejectfont><br />
<pattern><br />
<patelt name="family" ><br />
<string>LKLUG</string><br />
</patelt><br />
</pattern><br />
</rejectfont><br />
</selectfont><br />
</nowiki>}}<br />
<br />
Typically when both elements are combined, {{ic|<rejectfontfont>}} is first used on a more general matching glob to reject a large group (such as a whole directory), then {{ic|<acceptfont>}} is used after it to whitelist individual fonts out of the larger blacklisted group.<br />
<br />
{{bc|<nowiki><br />
<selectfont><br />
<rejectfont><br />
<glob>/usr/share/fonts/OTF/*</glob><br />
</rejectfont><br />
<acceptfont><br />
<pattern><br />
<patelt name="family" ><br />
<string>Monaco</string><br />
</patelt><br />
</pattern><br />
</acceptfont><br />
</selectfont><br />
</nowiki>}}<br />
<br />
=== Disable bitmap fonts ===<br />
<br />
To disable bitmap fonts (which are sometimes used as fallbacks for missing fonts, causing text to be rendered pixelated), use {{ic|70-no-bitmaps.conf}} (which is not placed by fontconfig by default):<br />
<br />
# cd /etc/fonts/conf.d<br />
# rm 70-yes-bitmaps.conf<br />
# ln -s ../conf.avail/70-no-bitmaps.conf<br />
<br />
This one-liner should also work:<br />
<br />
# ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d/<br />
<br />
You may not need to remove {{ic|70-yes-bitmaps.conf}} if it does not exist. You can choose which fonts to replace bitmaps fonts with (Helvetica, Courier and Times bitmap mapts to TTF fonts) by:<br />
<br />
{{hc|~/.config/fontconfig/conf.d/29-replace-bitmap-fonts.conf|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<!-- Replace generic bitmap font names by generic font families --><br />
<match target="pattern"><br />
<test name="family" qual="any"><br />
<string>Helvetica</string><br />
</test><br />
<edit mode="assign" name="family"><br />
<string>Arial</string><br />
<string>Liberation Sans</string><br />
<string>sans-serif</string><br />
</edit><br />
</match><br />
<match target="pattern"><br />
<test name="family" qual="any"><br />
<string>Courier</string><br />
</test><br />
<edit mode="assign" name="family"><br />
<string>Courier New</string><br />
<string>Liberation Mono</string><br />
<string>monospace</string><br />
</edit><br />
</match><br />
<match target="pattern"><br />
<test name="family" qual="any"><br />
<string>Times</string><br />
</test><br />
<edit mode="assign" name="family"><br />
<string>Times New Roman</string><br />
<string>Liberation Serif</string><br />
<string>serif</string><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
<div id="EmbeddedBitmap">To disable embedded bitmap for all fonts:<div><br />
<br />
{{hc|~/.config/fontconfig/conf.d/20-no-embedded.conf|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<match target="font"><br />
<edit name="embeddedbitmap" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
To disable embedded bitmap fonts for a specific font:<br />
<br />
<match target="font"><br />
<test qual="any" name="family"><br />
<string>Monaco</string><br />
</test><br />
<edit name="embeddedbitmap"><bool>false</bool></edit><br />
</match><br />
<br />
=== Disable scaling of bitmap fonts ===<br />
<br />
To disable scaling of bitmap fonts (which often makes them blurry), remove {{ic|/etc/fonts/conf.d/10-scale-bitmap-fonts.conf}}.<br />
<br />
=== Create bold and italic styles for incomplete fonts ===<br />
<br />
FreeType has the ability to automatically create ''italic'' and '''bold''' styles for fonts that do not have them, but only if explicitly required by the application. Given programs rarely send these requests, this section covers manually forcing generation of missing styles.<br />
<br />
Start by editing {{ic|/usr/share/fonts/fonts.cache-1}} as explained below. Store a copy of the modifications on another file, because a font update with {{ic|fc-cache}} will overwrite {{ic|/usr/share/fonts/fonts.cache-1}}.<br />
<br />
Assuming the Dupree font is installed:<br />
"dupree.ttf" 0 "Dupree:style=Regular:slant=0:weight=80:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Duplicate the line, change {{ic|<nowiki>style=Regular</nowiki>}} to {{ic|<nowiki>style=Bold</nowiki>}} or any other style. Also change {{ic|<nowiki>slant=0</nowiki>}} to {{ic|<nowiki>slant=100</nowiki>}} for italic, {{ic|<nowiki>weight=80</nowiki>}} to {{ic|<nowiki>weight=200</nowiki>}} for bold, or combine them for '''''bold italic''''':<br />
"dupree.ttf" 0 "Dupree:style=Bold Italic:slant=100:weight=200:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Now add necessary modifications to {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}:<br />
{{bc|<nowiki><br />
...<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="weight" compare="more_eq"><int>140</int></test><br />
<edit name="embolden" mode="assign"><bool>true</bool></edit><br />
</match><br />
<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="slant" compare="more_eq"><int>80</int></test><br />
<edit name="matrix" mode="assign"><br />
<times><br />
<name>matrix</name><br />
<matrix><br />
<double>1</double><double>0.2</double><br />
<double>0</double><double>1</double><br />
</matrix><br />
</times><br />
</edit><br />
</match><br />
...<br />
</nowiki>}}<br />
{{Tip| Use the value 'embolden' for existing bold fonts in order to make them even bolder.}}<br />
<br />
=== Change rule overriding ===<br />
<br />
Fontconfig processes files in {{ic|/etc/fonts/conf.d}} in numerical order. This enables rules or files to override one another, but often confuses users about what file gets parsed last.<br />
<br />
To guarantee that personal settings take precedence over any other rules, change their ordering:<br />
# cd /etc/fonts/conf.d<br />
# mv 50-user.conf 99-user.conf<br />
<br />
This change seems however to be unnecessary for the most of the cases, because a user is given enough control by default to set up own font preferences, hinting and antialiasing properties, alias new fonts to generic font families, etc.<br />
<br />
=== Example fontconfig configurations ===<br />
<br />
Example fontconfig configurations can be found on this [[Font configuration/fontconfig examples|page]].<br />
<br />
A simple starting point:<br />
<br />
{{hc|$XDG_CONFIG_HOME/fontconfig/fonts.conf|<nowiki><br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'><br />
<fontconfig><br />
<match target="font"><br />
<edit mode="assign" name="antialias"><br />
<bool>true</bool><br />
</edit><br />
<edit mode="assign" name="embeddedbitmap"><br />
<bool>false</bool><br />
</edit><br />
<edit mode="assign" name="hinting"><br />
<bool>true</bool><br />
</edit><br />
<edit mode="assign" name="hintstyle"><br />
<const>hintslight</const><br />
</edit><br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
<edit mode="assign" name="rgba"><br />
<const>rgb</const><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
=== Query the current settings ===<br />
<br />
To find out what settings are in effect, use {{ic|fc-match --verbose}}. eg.<br />
<br />
$ fc-match --verbose Sans<br />
family: "DejaVu Sans"(s)<br />
hintstyle: 3(i)(s)<br />
hinting: True(s)<br />
...<br />
<br />
Look up the meaning of the numbers at http://www.freedesktop.org/software/fontconfig/fontconfig-user.html. Eg. 'hintstyle: 3' means 'hintfull'<br />
<br />
== Patched packages ==<br />
<br />
These patched packages are available in the [[AUR]]. A few considerations:<br />
<br />
* Configuration is usually necessary.<br />
* The new font rendering will not kick in until applications restart.<br />
* Applications which [[Wikipedia:Static library|statically link]] to a library will not be affected by patches applied to the system library.<br />
<br />
=== Infinality ===<br />
<br />
See [[Infinality]].<br />
<br />
=== Ubuntu ===<br />
<br />
Ubuntu adds extra configurations, and occasionally patches to the font rendering libraries:<br />
<br />
*{{AUR|freetype2-ubuntu}} - TrueType font rendering<br />
*{{AUR|fontconfig-ubuntu}} - for configuring and customizing font access<br />
*{{AUR|cairo-ubuntu}} - Cairo vector graphics<br />
<br />
The global configuration will need to be added. See [[#Example fontconfig configurations]] for a starting point.<br />
Ubuntu rendering works the best with ''hintslight'' option.<br />
<br />
{{Warning|AUR packages are maintained separately from applications in the [[official repositories]]. The whole graphical system can become inoperable, if the user-installed core graphical libraries become incompatible.}}<br />
<br />
=== Reverting to unpatched packages ===<br />
<br />
To restore the unpatched packages, reinstall the original packages {{pkg|freetype2}}, {{pkg|cairo}}, and {{pkg|fontconfig}} as dependencies (use the {{ic|--asdeps}} flag with pacman when reinstalling). Include {{pkg|lib32-cairo}}, {{pkg|lib32-fontconfig}}, and {{pkg|lib32-freetype2}} if you also installed 32-bit versions.<br />
<br />
== Enhanced default settings ==<br />
<br />
{{AUR|fontconfig-good-defaults}} offers a solution to those who do not want to deal with the complexity of patched packages or configuration frameworks.<br />
<br />
It will install a number of settings known to be optimal for the majority of users. If an abnormal setup is required, the necessary settings can be easily changed on a case by case basis via the normal methods described in the sections above.<br />
<br />
To use, [[Arch_User_Repository#Installing_packages|install the package]] then log out and in again.<br />
<br />
To remove, [[Pacman#Removing_packages|uninstall the package]] then log out and in again. There is no need to reinstall anything.<br />
<br />
== Applications without fontconfig support ==<br />
<br />
Some applications like [[URxvt]] will ignore fontconfig settings. This is very apparent when using the infinality patches which are heavily reliant on proper configuration. You can work around this by using {{ic|~/.Xresources}}, but it is not nearly as flexible as fontconfig. Example (see [[#Fontconfig configuration]] for explanations of the options):<br />
<br />
{{hc|~/.Xresources|<nowiki><br />
Xft.autohint: 0<br />
Xft.lcdfilter: lcddefault<br />
Xft.hintstyle: hintfull<br />
Xft.hinting: 1<br />
Xft.antialias: 1<br />
Xft.rgba: rgb<br />
</nowiki>}}<br />
<br />
Make sure the settings are loaded properly when X starts with {{ic|xrdb -q}} (see [[Xresources]] for more information).<br />
<br />
== Troubleshooting ==<br />
<br />
=== Distorted fonts ===<br />
<br />
{{Note|96 DPI is not a standard. You should use your monitor's actual DPI to get proper font rendering, especially when using subpixel rendering.}}<br />
<br />
If fonts are still unexpectedly large or small, poorly proportioned or simply rendering poorly, fontconfig may be using the incorrect DPI.<br />
<br />
Fontconfig should be able to detect DPI parameters as discovered by the Xorg server. You can check the automatically discovered DPI with {{ic|xdpyinfo}} (provided by the {{pkg|xorg-xdpyinfo}} package):<br />
<br />
{{hc|<nowiki>$ xdpyinfo | grep dots</nowiki>|<br />
resolution: 102x102 dots per inch<br />
}}<br />
<br />
If the DPI is detected incorrectly (usually due to an incorrect monitor EDID), you can specify it manually in the Xorg configuration, see [[Xorg#Display size and DPI]]. This is the recommended solution, but it may not work with buggy drivers.<br />
<br />
Fontconfig will default to the Xft.dpi variable if it is set. Xft.dpi is usually set by desktop environments (usually to Xorg's DPI setting) or manually in {{ic|~/.Xdefaults}} or {{ic|~/.Xresources}}. Use xrdb to query for the value:<br />
<br />
{{hc|<nowiki>$ xrdb -query | grep dpi</nowiki>|<br />
Xft.dpi: 102<br />
}}<br />
<br />
Those still having problems can fall back to manually setting the DPI used by fontconfig:<br />
<br />
...<br />
<!-- Setup for DPI=96 --><br />
<match target="pattern"><br />
<edit name="dpi" mode="assign"><double>102</double></edit><br />
</match><br />
...<br />
<br />
=== Calibri, Cambria, Monaco, etc. not rendering properly ===<br />
<br />
Some scalable fonts have embedded bitmap versions which are rendered instead, mainly at smaller sizes. Force using scalable fonts at all sizes by [[#EmbeddedBitmap|#Disabling embedded bitmap]].<br />
<br />
=== Older GTK and Qt applications ===<br />
<br />
Modern GTK apps enable Xft by default but this was not the case before version 2.2. If it is not possible to update these applications, force Xft for old [[GNOME]] applications by adding to {{ic|~/.bashrc}}:<br />
<br />
export GDK_USE_XFT=1<br />
<br />
For older Qt applications:<br />
<br />
export QT_XFT=true<br />
<br />
=== Applications overriding hinting ===<br />
<br />
Some applications or desktop environments may override default fontconfig hinting and anti-aliasing settings. This may happen with [[GNOME]] 3, for example while you are using Qt applications like {{pkg|vlc}} or {{pkg|smplayer}}. Use the specific configuration program for the application in such cases. For GNOME, try {{pkg|gnome-tweak-tool}} and set the anti-aliasing to {{ic|Rgba}} instead of the default {{ic|Grayscale}} while using infinality.<br />
<br />
=== Applications not picking up hinting from DE's settings ===<br />
<br />
For instance, under GNOME it sometimes happens that Firefox applies full hinting even when it's set to "none" in GNOME's settings, which results in sharp and widened fonts. In this case you would have to add hinting settings to your {{ic|fonts.conf}} file:<br />
<br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <br />
<fontconfig><br />
<match target="font"><br />
<edit mode="assign" name="hinting"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
</fontconfig><br />
<br />
In this example, hinting is set to "grayscale".<br />
<br />
=== Incorrect hinting in GTK applications on non-Gnome systems ===<br />
<br />
{{Accuracy|Mentions GTK relies on fontconfig, then claims that "some" fonts get the hinting "wrong", and ends up refering to Xft (but see e.g [http://doc.opensuse.org/documentation/html/openSUSE_113/opensuse-reference/cha.fontconfig.html#sec.fontconfig.xft]). IOW, unsupported claims and unclear relations}}<br />
<br />
[[GNOME]] uses the XSETTINGS system to configure font rendering. Without gnome-settings-daemon, GTK applications rely on fontconfig, but some fonts get the hinting wrong causing them to look too bold or too light. <br />
<br />
A simple solution is using {{AUR|xsettingsd-git}} as a replacement for gnome-settings-daemon to provide the configuration, for example:<br />
<br />
{{hc|~/.xsettingsd|<br />
Xft/Hinting 1<br />
Xft/RGBA "rgb"<br />
Xft/HintStyle "hintslight"<br />
Xft/Antialias 1<br />
}}<br />
<br />
Alternatively you could just write the font configuration as {{ic|Xft.*}} directives in {{ic|~/.Xresources}} without using a settings daemon.<br />
<br />
== See also ==<br />
<br />
* [http://www.freedesktop.org/software/fontconfig/fontconfig-user.html Fontconfig Users' Guide]<br />
* [http://www.x.org/X11R6.8.2/doc/fonts.html Fonts in X11R6.8.2] - Official Xorg font information<br />
* [http://freetype.sourceforge.net/freetype2/ FreeType 2 overview]<br />
* [https://forums.gentoo.org/viewtopic-t-723341.html Gentoo font-rendering thread]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Font_configuration&diff=399847Font configuration2015-09-14T12:58:17Z<p>Sushi Dude: Included section describing packages that provide enhanced default settings. Requested by multiple users.</p>
<hr />
<div>[[Category:Fonts]]<br />
[[it:Font configuration]]<br />
[[ja:フォント設定]]<br />
[[ru:Font configuration]]<br />
[[sr:Font configuration]]<br />
[[tr:Yazıtipi yapılandırması]]<br />
[[zh-cn:Font configuration]]<br />
{{Related articles start}}<br />
{{Related|Fonts}}<br />
{{Related|Font configuration/fontconfig examples}}<br />
{{Related|Infinality}}<br />
{{Related|Java Runtime Environment Fonts}}<br />
{{Related|MS Fonts}}<br />
{{Related|X Logical Font Description}}<br />
{{Related articles end}}<br />
<br />
[http://www.freedesktop.org/wiki/Software/fontconfig/ Fontconfig] is a library designed to provide a list of available [[fonts]] to applications, and also for configuration for how fonts get rendered. See package {{Pkg|fontconfig}} and [[Wikipedia:Fontconfig]]. The FreeType library ({{Pkg|freetype2}} package) renders the fonts, based on this configuration.<br />
<br />
Though Fontconfig is the standard in today's Linux, some applications still rely on the original method of font selection and display, the [[X Logical Font Description]].<br />
<br />
The font rendering packages on Arch Linux includes support for ''freetype2'' with the bytecode interpreter (BCI) enabled. Patched packages exist for better font rendering, especially with an LCD monitor. See [[#Patched packages]] below. The [[Infinality]] package allows both auto-hinting and subpixel rendering, allows the LCD filter to be tweaked without recompiling, and allows the auto-hinter to work well with bold fonts.<br />
<br />
== Font paths ==<br />
<br />
For fonts to be known to applications, they must be cataloged for easy and quick access.<br />
<br />
The font paths initially known to Fontconfig are: {{ic|/usr/share/fonts/}}, {{ic|~/.local/share/fonts}} (and {{ic|~/.fonts/}}, now deprecated). Fontconfig will scan these directories recursively. For ease of organization and installation, it is recommended to use these font paths when [[adding fonts]].<br />
<br />
To see a list of known Fontconfig fonts:<br />
$ fc-list : file<br />
<br />
See {{ic|man fc-list}} for more output formats.<br />
<br />
Check for Xorg's known font paths by reviewing its log:<br />
$ grep /fonts /var/log/Xorg.0.log<br />
<br />
{{Tip|You can also check the list of [[Xorg]]'s known font paths using the command {{ic|xset q}}.}}<br />
<br />
Keep in mind that Xorg does not search recursively through the {{ic|/usr/share/fonts/}} directory like Fontconfig does. To add a path, the full path must be used:<br />
Section "Files"<br />
FontPath "/usr/share/fonts/local/"<br />
EndSection<br />
<br />
If you want font paths to be set on a per-user basis, you can add and remove font paths from the default by adding the following line(s) to {{ic|~/.xinitrc}}:<br />
xset +fp /usr/share/fonts/local/ # Prepend a custom font path to Xorg's list of known font paths<br />
xset -fp /usr/share/fonts/sucky_fonts/ # Remove the specified font path from Xorg's list of known font paths<br />
<br />
To see a list of known Xorg fonts use {{ic|xlsfonts}}, from the {{Pkg|xorg-xlsfonts}} package.<br />
<br />
== Fontconfig configuration ==<br />
<br />
Fontconfig is documented in the [http://www.freedesktop.org/software/fontconfig/fontconfig-user.html fonts-conf] man page.<br />
<br />
Configuration can be done per-user through {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}, and globally with {{ic|/etc/fonts/local.conf}}. The settings in the per-user configuration have precedence over the global configuration. Both these files use the same syntax.<br />
{{Note|Configuration files and directories: {{ic|~/.fonts.conf/}}, {{ic|~/.fonts.conf.d/}} and {{ic|~/.fontconfig/*.cache-*}} are deprecated since {{Pkg|fontconfig}} 2.10.1 ([http://cgit.freedesktop.org/fontconfig/commit/?id&#61;8c255fb185d5651b57380b0a9443001e8051b29d upstream commit]) and will not be read by default in the future versions of the package. New paths are {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}, {{ic|$XDG_CONFIG_HOME/fontconfig/conf.d/NN-name.conf}} and {{ic|$XDG_CACHE_HOME/fontconfig/*.cache-*}} respectively. If using the second location, make sure the naming is valid (where {{ic|NN}} is a two digit number like {{ic|00}}, {{ic|10}}, or {{ic|99}}).}}<br />
<br />
Fontconfig gathers all its configurations in a central file ({{ic|/etc/fonts/fonts.conf}}). This file is replaced during fontconfig updates and should not be edited. Fontconfig-aware applications source this file to know available fonts and how they get rendered. This file is a conglomeration of rules from the global configuration ({{ic|/etc/fonts/local.conf}}), the configured presets in {{ic|/etc/fonts/conf.d/}}, and the user configuration file ({{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}). {{ic|fc-cache}} can be used to rebuild fontconfig's configuration, although changes will only be visible in newly launched applications.<br />
<br />
{{Note|For some desktop environments (such as [[GNOME]] and [[KDE]]) using the ''Font Control Panel'' will automatically create or overwrite the user font configuration file. For these desktop environments, it is best to match your already defined font configurations to get the expected behavior.}}<br />
<br />
Fontconfig configuration files use [[Wikipedia:XML|XML]] format and need these headers:<br />
<br />
{{bc|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<br />
<!-- settings go here --><br />
<br />
</fontconfig><br />
</nowiki>}}<br />
<br />
The configuration examples in this article omit these tags.<br />
<br />
=== Presets ===<br />
<br />
There are presets installed in the directory {{ic|/etc/fonts/conf.avail}}. They can be enabled by creating [[Wikipedia:Symbolic link|symbolic link]]s to them, both per-user and globally, as described in {{ic|/etc/fonts/conf.d/README}}. These presets will override matching settings in their respective configuration files.<br />
<br />
For example, to enable sub-pixel RGB rendering globally:<br />
<br />
# cd /etc/fonts/conf.d<br />
# ln -s ../conf.avail/10-sub-pixel-rgb.conf<br />
<br />
To do the same but instead for a per-user configuration:<br />
<br />
$ mkdir $XDG_CONFIG_HOME/fontconfig/conf.d<br />
$ ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf $XDG_CONFIG_HOME/fontconfig/conf.d<br />
<br />
=== Anti-aliasing ===<br />
<br />
[[Wikipedia:Font rasterization|Font rasterization]] converts vector font data to bitmap data so that it can be displayed. The result can appear jagged due to [[Wikipedia:Aliasing|aliasing]]. [[Wikipedia:Anti-aliasing|anti-aliasing]] is enabled by default and increases the apparent resolution of font edges.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Some applications, like [[GNOME 3]] may [[#Troubleshooting|override default anti-aliasing settings]].}}<br />
<br />
=== Hinting ===<br />
<br />
[[Wikipedia:Font hinting|Font hinting]] (also known as instructing) is the use of mathematical instructions to adjust the display of an outline font so that it lines up with a rasterized grid, (i.e. the pixel grid of the display). Its intended effect is to make fonts appear more crisp so that they are more readable. Fonts will line up correctly without hinting when displays have around 300 [[Wikipedia:Dots per inch|DPI]]. Two types of hinting are available.<br />
<br />
==== Byte-Code Interpreter (BCI) ====<br />
<br />
Using BCI hinting, instructions in TrueType fonts are rendered according to FreeTypes's interpreter. BCI hinting works well with fonts with good hinting instructions. To enable hinting:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="hinting" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Autohinter ====<br />
<br />
The Autohinter attempts to do automatic hinting and disregards any existing hinting information. Originally it was the default because TrueType2 fonts were patent-protected but now that these patents have expired there is very little reason to use it. It does work better with fonts that have broken or no hinting information but it will be strongly sub-optimal for fonts with good hinting information. Generally common fonts are of the later kind so autohinter will not be useful. To enable auto-hinting:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="autohint" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Hintstyle ====<br />
<br />
Hintstyle is the amount of font reshaping done to line up to the grid. Hinting values are: {{ic|hintnone}}, {{ic|hintslight}}, {{ic|hintmedium}}, and {{ic|hintfull}}. {{ic|hintslight}} will make the font more fuzzy to line up to the grid but will be better in retaining font shape, while {{ic|hintfull}} will be a crisp font that aligns well to the pixel grid but will lose a greater amount of font shape. Preferences vary.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="hintstyle" mode="assign"><br />
<const>hintfull</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Some applications, like [[GNOME 3]] may [[#Troubleshooting|override default hinting settings.]]}}<br />
<br />
=== Subpixel rendering ===<br />
<br />
Most monitors manufactured today use the Red, Green, Blue (RGB) specification. Fontconfig will need to know your monitor type to be able to display your fonts correctly. Monitors are either: '''RGB''' (most common), '''BGR''', '''V-RGB''' (vertical), or '''V-BGR'''. A monitor test can be found [http://www.lagom.nl/lcd-test/subpixel.php here]).<br />
<br />
To enable subpixel rendering:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="rgba" mode="assign"><br />
<const>rgb</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Subpixel rendering effectively triples the horizontal (or vertical) resolution for fonts by making use of subpixels. The autohinter and subpixel rendering are not designed to work together and should not be used in combination without the [[Infinality]] patch set.}}<br />
<br />
==== LCD filter ====<br />
<br />
When using subpixel rendering, you should enable the LCD filter, which is designed to reduce colour fringing. This is described under [http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html LCD filtering] in the FreeType 2 API reference. Different options are described under [http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html#FT_LcdFilter FT_LcdFilter], and are illustrated by this [http://www.spasche.net/files/lcdfiltering/ LCD filter test] page.<br />
<br />
The {{ic|lcddefault}} filter will work for most users. Other filters are available that can be used in special situations: {{ic|lcdlight}}; a lighter filter ideal for fonts that look too bold or fuzzy, {{ic|lcdlegacy}}, the original Cairo filter; and {{ic|lcdnone}} to disable it entirely.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Advanced LCD filter specification ====<br />
<br />
If the available, built-in LCD filters are not satisfactory, it is possible to tweak the font rendering very specifically by building a custom freetype2 package and modifying the hardcoded filters. The [[Arch Build System]] can be used to build and install packages from source.<br />
<br />
First, refresh the freetype2 PKGBUILD as root:<br />
<br />
# abs extra/freetype2<br />
<br />
This example uses {{ic|/var/abs/build}} as the build directory, substitute it according to your personal ABS setup. Download and extract the freetype2 package as a regular user:<br />
<br />
$ cd /var/abs/build<br />
$ cp -r ../extra/freetype2 .<br />
$ cd freetype2<br />
$ makepkg -o<br />
<br />
Edit the file {{ic|src/freetype-VERSION/src/base/ftlcdfil.c}} and look up the definition of the constant {{ic|default_filter[5]}}:<br />
<br />
static const FT_Byte default_filter[5] =<br />
{ 0x10, 0x40, 0x70, 0x40, 0x10 };<br />
<br />
This constant defines a low-pass filter applied to the rendered glyph. Modify it as needed. Save the file, build and install the custom package:<br />
<br />
$ makepkg -e<br />
# pacman -Rd freetype2<br />
# pacman -U freetype2-VERSION-ARCH.pkg.tar.xz<br />
<br />
Reboot or restart X. The lcddefault filter should now render fonts differently.<br />
<br />
=== Disable auto-hinter for bold fonts ===<br />
<br />
The auto-hinter uses sophisticated methods for font rendering, but often makes bold fonts too wide. Fortunately, a solution can be turning off the autohinter for bold fonts while leaving it on for the rest:<br />
...<br />
<match target="font"><br />
<test name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<edit name="autohint" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
...<br />
<br />
=== Enable anti-aliasing only for bigger fonts ===<br />
<br />
Some users prefer the sharper rendering that anti-aliasing does not offer:<br />
<br />
{{bc|<nowiki><br />
...<br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="size" qual="any" compare="more"><br />
<double>12</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="pixelsize" qual="any" compare="more"><br />
<double>16</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
...<br />
</nowiki>}}<br />
<br />
=== Replace fonts ===<br />
<br />
The most reliable way to do this is to add an XML fragment similar to the one below. ''Using the "binding" attribute will give you better results'', for example, in Firefox where you may not want to change properties of font being replaced. This will cause Ubuntu to be used in place of Georgia:<br />
...<br />
<match target="pattern"><br />
<test qual="any" name="family"><string>georgia</string></test><br />
<edit name="family" mode="assign" binding="same"><string>Ubuntu</string></edit><br />
</match><br />
...<br />
An alternate approach is to set the "preferred" font, but ''this only works if the original font is not on the system'', in which case the one specified will be substituted:<br />
...<br />
< !-- Replace Helvetica with Bitstream Vera Sans Mono --><br />
< !-- Note, an alias for Helvetica should already exist in default conf files --><br />
<alias><br />
<family>Helvetica</family><br />
<prefer><family>Bitstream Vera Sans Mono</family></prefer><br />
<default><family>fixed</family></default><br />
</alias><br />
...<br />
<br />
=== Whitelisting and blacklisting fonts ===<br />
<br />
The element {{ic|<selectfont>}} is used in conjunction with the {{ic|<acceptfont>}} and {{ic|<rejectfontfont>}} elements to selectively whitelist or blacklist fonts from the resolve list and match requests. The simplest and most typical use case it to reject one font that is needed to be installed, however is getting matched for a generic font query that is causing problems within application user interfaces.<br />
<br />
First obtain the Family name as listed in the font itself:<br />
<br />
{{hc|1=$ fc-scan .fonts/lklug.ttf --format='%{family}\n'|2=<br />
LKLUG<br />
}}<br />
<br />
Then use that Family name in a {{ic|<rejectfontfont>}} stanza:<br />
<br />
{{bc|<nowiki><br />
<selectfont><br />
<rejectfont><br />
<pattern><br />
<patelt name="family" ><br />
<string>LKLUG</string><br />
</patelt><br />
</pattern><br />
</rejectfont><br />
</selectfont><br />
</nowiki>}}<br />
<br />
Typically when both elements are combined, {{ic|<rejectfontfont>}} is first used on a more general matching glob to reject a large group (such as a whole directory), then {{ic|<acceptfont>}} is used after it to whitelist individual fonts out of the larger blacklisted group.<br />
<br />
{{bc|<nowiki><br />
<selectfont><br />
<rejectfont><br />
<glob>/usr/share/fonts/OTF/*</glob><br />
</rejectfont><br />
<acceptfont><br />
<pattern><br />
<patelt name="family" ><br />
<string>Monaco</string><br />
</patelt><br />
</pattern><br />
</acceptfont><br />
</selectfont><br />
</nowiki>}}<br />
<br />
=== Disable bitmap fonts ===<br />
<br />
To disable bitmap fonts (which are sometimes used as fallbacks for missing fonts, causing text to be rendered pixelated), use {{ic|70-no-bitmaps.conf}} (which is not placed by fontconfig by default):<br />
<br />
# cd /etc/fonts/conf.d<br />
# rm 70-yes-bitmaps.conf<br />
# ln -s ../conf.avail/70-no-bitmaps.conf<br />
<br />
This one-liner should also work:<br />
<br />
# ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d/<br />
<br />
You may not need to remove {{ic|70-yes-bitmaps.conf}} if it does not exist. You can choose which fonts to replace bitmaps fonts with (Helvetica, Courier and Times bitmap mapts to TTF fonts) by:<br />
<br />
{{hc|~/.config/fontconfig/conf.d/29-replace-bitmap-fonts.conf|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<!-- Replace generic bitmap font names by generic font families --><br />
<match target="pattern"><br />
<test name="family" qual="any"><br />
<string>Helvetica</string><br />
</test><br />
<edit mode="assign" name="family"><br />
<string>Arial</string><br />
<string>Liberation Sans</string><br />
<string>sans-serif</string><br />
</edit><br />
</match><br />
<match target="pattern"><br />
<test name="family" qual="any"><br />
<string>Courier</string><br />
</test><br />
<edit mode="assign" name="family"><br />
<string>Courier New</string><br />
<string>Liberation Mono</string><br />
<string>monospace</string><br />
</edit><br />
</match><br />
<match target="pattern"><br />
<test name="family" qual="any"><br />
<string>Times</string><br />
</test><br />
<edit mode="assign" name="family"><br />
<string>Times New Roman</string><br />
<string>Liberation Serif</string><br />
<string>serif</string><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
<div id="EmbeddedBitmap">To disable embedded bitmap for all fonts:<div><br />
<br />
{{hc|~/.config/fontconfig/conf.d/20-no-embedded.conf|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<match target="font"><br />
<edit name="embeddedbitmap" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
To disable embedded bitmap fonts for a specific font:<br />
<br />
<match target="font"><br />
<test qual="any" name="family"><br />
<string>Monaco</string><br />
</test><br />
<edit name="embeddedbitmap"><bool>false</bool></edit><br />
</match><br />
<br />
=== Disable scaling of bitmap fonts ===<br />
<br />
To disable scaling of bitmap fonts (which often makes them blurry), remove {{ic|/etc/fonts/conf.d/10-scale-bitmap-fonts.conf}}.<br />
<br />
=== Create bold and italic styles for incomplete fonts ===<br />
<br />
FreeType has the ability to automatically create ''italic'' and '''bold''' styles for fonts that do not have them, but only if explicitly required by the application. Given programs rarely send these requests, this section covers manually forcing generation of missing styles.<br />
<br />
Start by editing {{ic|/usr/share/fonts/fonts.cache-1}} as explained below. Store a copy of the modifications on another file, because a font update with {{ic|fc-cache}} will overwrite {{ic|/usr/share/fonts/fonts.cache-1}}.<br />
<br />
Assuming the Dupree font is installed:<br />
"dupree.ttf" 0 "Dupree:style=Regular:slant=0:weight=80:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Duplicate the line, change {{ic|<nowiki>style=Regular</nowiki>}} to {{ic|<nowiki>style=Bold</nowiki>}} or any other style. Also change {{ic|<nowiki>slant=0</nowiki>}} to {{ic|<nowiki>slant=100</nowiki>}} for italic, {{ic|<nowiki>weight=80</nowiki>}} to {{ic|<nowiki>weight=200</nowiki>}} for bold, or combine them for '''''bold italic''''':<br />
"dupree.ttf" 0 "Dupree:style=Bold Italic:slant=100:weight=200:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Now add necessary modifications to {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}:<br />
{{bc|<nowiki><br />
...<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="weight" compare="more_eq"><int>140</int></test><br />
<edit name="embolden" mode="assign"><bool>true</bool></edit><br />
</match><br />
<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="slant" compare="more_eq"><int>80</int></test><br />
<edit name="matrix" mode="assign"><br />
<times><br />
<name>matrix</name><br />
<matrix><br />
<double>1</double><double>0.2</double><br />
<double>0</double><double>1</double><br />
</matrix><br />
</times><br />
</edit><br />
</match><br />
...<br />
</nowiki>}}<br />
{{Tip| Use the value 'embolden' for existing bold fonts in order to make them even bolder.}}<br />
<br />
=== Change rule overriding ===<br />
<br />
Fontconfig processes files in {{ic|/etc/fonts/conf.d}} in numerical order. This enables rules or files to override one another, but often confuses users about what file gets parsed last.<br />
<br />
To guarantee that personal settings take precedence over any other rules, change their ordering:<br />
# cd /etc/fonts/conf.d<br />
# mv 50-user.conf 99-user.conf<br />
<br />
This change seems however to be unnecessary for the most of the cases, because a user is given enough control by default to set up own font preferences, hinting and antialiasing properties, alias new fonts to generic font families, etc.<br />
<br />
=== Example fontconfig configurations ===<br />
<br />
Example fontconfig configurations can be found on this [[Font configuration/fontconfig examples|page]].<br />
<br />
A simple starting point:<br />
<br />
{{hc|$XDG_CONFIG_HOME/fontconfig/fonts.conf|<nowiki><br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'><br />
<fontconfig><br />
<match target="font"><br />
<edit mode="assign" name="antialias"><br />
<bool>true</bool><br />
</edit><br />
<edit mode="assign" name="embeddedbitmap"><br />
<bool>false</bool><br />
</edit><br />
<edit mode="assign" name="hinting"><br />
<bool>true</bool><br />
</edit><br />
<edit mode="assign" name="hintstyle"><br />
<const>hintslight</const><br />
</edit><br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
<edit mode="assign" name="rgba"><br />
<const>rgb</const><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
=== Query the current settings ===<br />
<br />
To find out what settings are in effect, use {{ic|fc-match --verbose}}. eg.<br />
<br />
$ fc-match --verbose Sans<br />
family: "DejaVu Sans"(s)<br />
hintstyle: 3(i)(s)<br />
hinting: True(s)<br />
...<br />
<br />
Look up the meaning of the numbers at http://www.freedesktop.org/software/fontconfig/fontconfig-user.html. Eg. 'hintstyle: 3' means 'hintfull'<br />
<br />
== Patched packages ==<br />
<br />
These patched packages are available in the [[AUR]]. A few considerations:<br />
<br />
* Configuration is usually necessary.<br />
* The new font rendering will not kick in until applications restart.<br />
* Applications which [[Wikipedia:Static library|statically link]] to a library will not be affected by patches applied to the system library.<br />
<br />
=== Infinality ===<br />
<br />
See [[Infinality]].<br />
<br />
=== Ubuntu ===<br />
<br />
Ubuntu adds extra configurations, and occasionally patches to the font rendering libraries:<br />
<br />
*{{AUR|freetype2-ubuntu}} - TrueType font rendering<br />
*{{AUR|fontconfig-ubuntu}} - for configuring and customizing font access<br />
*{{AUR|cairo-ubuntu}} - Cairo vector graphics<br />
<br />
The global configuration will need to be added. See [[#Example fontconfig configurations]] for a starting point.<br />
Ubuntu rendering works the best with ''hintslight'' option.<br />
<br />
{{Warning|AUR packages are maintained separately from applications in the [[official repositories]]. The whole graphical system can become inoperable, if the user-installed core graphical libraries become incompatible.}}<br />
<br />
=== Reverting to unpatched packages ===<br />
<br />
To restore the unpatched packages, reinstall the original packages {{pkg|freetype2}}, {{pkg|cairo}}, and {{pkg|fontconfig}} as dependencies (use the {{ic|--asdeps}} flag with pacman when reinstalling). Include {{pkg|lib32-cairo}}, {{pkg|lib32-fontconfig}}, and {{pkg|lib32-freetype2}} if you also installed 32-bit versions.<br />
<br />
== Enhanced default settings ==<br />
<br />
{{AUR|fontconfig-good-defaults}} offers a solution to those who do not want to deal with the complexity of patched packages or configuration frameworks.<br />
<br />
It will install a number of settings known to be optimal for the majority of users. If an abnormal setup is required, the necessary settings can be easily changed on a case by case basis via the normal methods described in the sections above.<br />
<br />
To use, [[Arch_User_Repository#Installing_packages|install the package]] then log out and in again.<br />
<br />
To remove, [[Pacman#Removing_packages|uninstall the package]] then log out and in again. There is no need to reinstall anything.<br />
<br />
== Applications without fontconfig support ==<br />
<br />
Some applications like [[URxvt]] will ignore fontconfig settings. This is very apparent when using the infinality patches which are heavily reliant on proper configuration. You can work around this by using {{ic|~/.Xresources}}, but it is not nearly as flexible as fontconfig. Example (see [[#Fontconfig configuration]] for explanations of the options):<br />
<br />
{{hc|~/.Xresources|<nowiki><br />
Xft.autohint: 0<br />
Xft.lcdfilter: lcddefault<br />
Xft.hintstyle: hintfull<br />
Xft.hinting: 1<br />
Xft.antialias: 1<br />
Xft.rgba: rgb<br />
</nowiki>}}<br />
<br />
Make sure the settings are loaded properly when X starts with {{ic|xrdb -q}} (see [[Xresources]] for more information).<br />
<br />
== Troubleshooting ==<br />
<br />
=== Distorted fonts ===<br />
<br />
{{Note|96 DPI is not a standard. You should use your monitor's actual DPI to get proper font rendering, especially when using subpixel rendering.}}<br />
<br />
If fonts are still unexpectedly large or small, poorly proportioned or simply rendering poorly, fontconfig may be using the incorrect DPI.<br />
<br />
Fontconfig should be able to detect DPI parameters as discovered by the Xorg server. You can check the automatically discovered DPI with {{ic|xdpyinfo}} (provided by the {{pkg|xorg-xdpyinfo}} package):<br />
<br />
{{hc|<nowiki>$ xdpyinfo | grep dots</nowiki>|<br />
resolution: 102x102 dots per inch<br />
}}<br />
<br />
If the DPI is detected incorrectly (usually due to an incorrect monitor EDID), you can specify it manually in the Xorg configuration, see [[Xorg#Display size and DPI]]. This is the recommended solution, but it may not work with buggy drivers.<br />
<br />
Fontconfig will default to the Xft.dpi variable if it is set. Xft.dpi is usually set by desktop environments (usually to Xorg's DPI setting) or manually in {{ic|~/.Xdefaults}} or {{ic|~/.Xresources}}. Use xrdb to query for the value:<br />
<br />
{{hc|<nowiki>$ xrdb -query | grep dpi</nowiki>|<br />
Xft.dpi: 102<br />
}}<br />
<br />
Those still having problems can fall back to manually setting the DPI used by fontconfig:<br />
<br />
...<br />
<!-- Setup for DPI=96 --><br />
<match target="pattern"><br />
<edit name="dpi" mode="assign"><double>102</double></edit><br />
</match><br />
...<br />
<br />
=== Calibri, Cambria, Monaco, etc. not rendering properly ===<br />
<br />
Some scalable fonts have embedded bitmap versions which are rendered instead, mainly at smaller sizes. Force using scalable fonts at all sizes by [[#EmbeddedBitmap|#Disabling embedded bitmap]].<br />
<br />
=== Older GTK and Qt applications ===<br />
<br />
Modern GTK apps enable Xft by default but this was not the case before version 2.2. If it is not possible to update these applications, force Xft for old [[GNOME]] applications by adding to {{ic|~/.bashrc}}:<br />
<br />
export GDK_USE_XFT=1<br />
<br />
For older Qt applications:<br />
<br />
export QT_XFT=true<br />
<br />
=== Applications overriding hinting ===<br />
<br />
Some applications or desktop environments may override default fontconfig hinting and anti-aliasing settings. This may happen with [[GNOME]] 3, for example while you are using Qt applications like {{pkg|vlc}} or {{pkg|smplayer}}. Use the specific configuration program for the application in such cases. For GNOME, try {{pkg|gnome-tweak-tool}} and set the anti-aliasing to {{ic|Rgba}} instead of the default {{ic|Grayscale}} while using infinality.<br />
<br />
=== Applications not picking up hinting from DE's settings ===<br />
<br />
For instance, under GNOME it sometimes happens that Firefox applies full hinting even when it's set to "none" in GNOME's settings, which results in sharp and widened fonts. In this case you would have to add hinting settings to your {{ic|fonts.conf}} file:<br />
<br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <br />
<fontconfig><br />
<match target="font"><br />
<edit mode="assign" name="hinting"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
</fontconfig><br />
<br />
In this example, hinting is set to "grayscale".<br />
<br />
=== Incorrect hinting in GTK applications on non-Gnome systems ===<br />
<br />
{{Accuracy|Mentions GTK relies on fontconfig, then claims that "some" fonts get the hinting "wrong", and ends up refering to Xft (but see e.g [http://doc.opensuse.org/documentation/html/openSUSE_113/opensuse-reference/cha.fontconfig.html#sec.fontconfig.xft]). IOW, unsupported claims and unclear relations}}<br />
<br />
[[GNOME]] uses the XSETTINGS system to configure font rendering. Without gnome-settings-daemon, GTK applications rely on fontconfig, but some fonts get the hinting wrong causing them to look too bold or too light. <br />
<br />
A simple solution is using {{AUR|xsettingsd-git}} as a replacement for gnome-settings-daemon to provide the configuration, for example:<br />
<br />
{{hc|~/.xsettingsd|<br />
Xft/Hinting 1<br />
Xft/RGBA "rgb"<br />
Xft/HintStyle "hintslight"<br />
Xft/Antialias 1<br />
}}<br />
<br />
Alternatively you could just write the font configuration as {{ic|Xft.*}} directives in {{ic|~/.Xresources}} without using a settings daemon.<br />
<br />
== See also ==<br />
<br />
* [http://www.freedesktop.org/software/fontconfig/fontconfig-user.html Fontconfig Users' Guide]<br />
* [http://www.x.org/X11R6.8.2/doc/fonts.html Fonts in X11R6.8.2] - Official Xorg font information<br />
* [http://freetype.sourceforge.net/freetype2/ FreeType 2 overview]<br />
* [https://forums.gentoo.org/viewtopic-t-723341.html Gentoo font-rendering thread]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Beginners%27_guide&diff=397010Beginners' guide2015-09-01T11:16:18Z<p>Sushi Dude: /* File systems and swap */ The dosfstools package has a ‘/usr/bin/mkfs.vfat’ -> ‘mkfs.fat’ symbolic link.</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|Installation guide}}<br />
{{Related|Diskless system}}<br />
{{Related|Install from SSH}}<br />
{{Related|General recommendations}}<br />
{{Related|General 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 />
The installation media and their [[GnuPG]] signatures can be acquired from the [https://archlinux.org/download/ Download] page. The single ISO image supports both 32bit and 64bit systems; this guide assumes you use the latest available version.<br />
<br />
It is highly recommended to verify the image signature before use, ''especially when downloading from an HTTP mirror'', as these are run by volunteers who could [http://www.cs.arizona.edu/stork/packagemanagersecurity/attacks-on-package-managers.html#explanation serve malicious images]. On a system with GnuPG installed, do this by downloading the ''PGP signature'' (under ''Checksums'') to the ISO directory, and run:<br />
<br />
$ gpg --verify archlinux-<version>-dual.iso.sig<br />
<br />
If the public key is not found, [[GnuPG#Import key|import]] it with {{ic|gpg --recv-keys ''key-id''}}. <br />
<br />
Alternatively, run from an existing Arch Linux installation:<br />
<br />
$ pacman-key -v archlinux-<version>-dual.iso.sig<br />
<br />
Now, choose one of the methods from [[:Category:Getting and installing Arch]] to [[#Boot the installation medium]] on the target machine(s). As the installation process retrieves packages from a remote repository, these methods require an internet connection; See [[Offline installation of packages]] when none is available.<br />
<br />
== Boot the installation medium ==<br />
<br />
Point the current boot device to the media 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]]. If the live system fails to launch, see [[Boot problems]] for possible workarounds.<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, [[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, run:<br />
<br />
# efivar -l<br />
<br />
Should ''efivar'' not list the UEFI variables properly, check if all [[UEFI#Requirements_for_UEFI_variable_support|requirements]] are met.<br />
<br />
=== Keyboard layout ===<br />
<br />
The default [[keymap]] for the [[Wikipedia:Virtual console|virtual console]] is set to [[Wikipedia:File:KB United States-NoAltGr.svg|US]]. To change the layout for the installation process (only), run:<br />
<br />
# loadkeys ''layout''<br />
<br />
where ''layout'' is a two-letter [[Wikipedia:ISO 3166-1 alpha-2#Officially assigned code elements|country code]]. Use {{ic|localectl list-keymaps}} to list all available keymaps.<br />
<br />
See [[Fonts#Console fonts|Console fonts]] if certain characters appear as white squares or other symbols.<br />
<br />
== Establish an internet connection ==<br />
<br />
The [[dhcpcd]] daemon is enabled on boot, and will attempt to start a wired connection. Should [[Network_configuration#Check_the_connection|checking the connection]] with ''ping'' fail, configure the network as explained below.<br />
<br />
To preserve settings, copy modified configuration files to the new system before [[#Chroot and configure the base system]].<br />
<br />
=== Wireless ===<br />
<br />
Use [[netctl]]'s ''wifi-menu'' to list available networks and make a connection:<br />
<br />
# wifi-menu<br />
<br />
If your computer has more than one Wi-Fi device, list the [[Wireless network configuration#Getting some useful information|wireless devices]] with {{ic|iw dev}}. Names are likely to start with {{ic|wl}}, for example {{ic|wlp3s0}}.<br />
<br />
Relay the name to wifi-menu:<br />
<br />
# wifi-menu ''wlp3s0''<br />
<br />
For networks which require both a username and password, see [[WPA2 Enterprise#netctl]].<br />
<br />
See [[Wireless network configuration]] for more information.<br />
<br />
=== Wired (Static IP) ===<br />
<br />
Identify the [[Network configuration#Device names|device names]] with {{ic|ip link}}. Ethernet names are likely to start with {{ic|en}}, for example {{ic|enp0s25}}.<br />
<br />
Configure a [[Dhcpcd#Static profile|static profile]] for ''dhcpcd'' in {{ic|/etc/dhcpcd.conf}}. See {{ic|man dhcpcd.conf}} for more examples.<br />
<br />
{{hc|1=# nano /etc/dhcpcd.conf|2=<br />
interface ''enp0s25''<br />
static ip_address=''192.168.0.10/24''<br />
static routers=''192.168.0.1''<br />
static domain_name_servers=''192.168.0.1 8.8.8.8''<br />
}}<br />
<br />
Restart {{ic|dhcpcd.service}}:<br />
<br />
# systemctl restart dhcpcd.service<br />
<br />
See [[Network_configuration#Static_IP_address|Static IP address]] for more information.<br />
<br />
=== Other ===<br />
<br />
;Analog modem, ISDN, or PPPoE DSL<br />
<br />
See [[Direct modem connection]].<br />
<br />
;Behind a proxy server<br />
<br />
Exporting the {{ic|http_proxy}} and {{ic|ftp_proxy}} environment variables is required. See [[Proxy settings]].<br />
<br />
;Behind a captive portal<br />
<br />
The [[ELinks]] browser is included with the installation media, and can be used to access captive portal login forms.<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}}. See [[Time]] for more information.<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 [[Windows and Arch dual boot#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 needs not 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 />
* [[MBR]]<br />
* [[GPT]]<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]]: MBR and GPT<br />
* [[fdisk#Fdisk usage summary|fdisk]], '''cfdisk''', '''sfdisk''': MBR and GPT<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 BIOS/MBR and UEFI/GPT. 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 MBR/msdos partition table for BIOS systems, use the following command:<br />
<br />
(parted) mklabel msdos<br />
<br />
To create a new GPT partition table for UEFI systems instead, use:<br />
<br />
(parted) mklabel gpt<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 />
== Select a mirror ==<br />
<br />
You may want to edit the {{ic|mirrorlist}} file and place your preferred mirror first. A copy of this file will be installed on your new system by ''pacstrap'' as well, so it is worth getting it right.<br />
<br />
{{hc|# nano /etc/pacman.d/mirrorlist|<br />
##<br />
## Arch Linux repository mirrorlist<br />
## Sorted by mirror score from mirror status page<br />
## Generated on YYYY-MM-DD<br />
##<br />
<br />
<nowiki>Server = http://mirror.example.xyz/archlinux/$repo/os/$arch</nowiki><br />
...}}<br />
<br />
If you want, you can make it the ''only'' mirror available by deleting all other lines, but it is usually a good idea to have a few more, in case the first one goes offline. Should you change your mirror list at a later stage, refresh all package lists with {{ic|pacman -Syyu}}. See [[Mirrors]] for more information.<br />
<br />
== Install the base system ==<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 />
# pacstrap -i /mnt base base-devel<br />
<br />
The {{ic|-i}} switch ensures prompting before package installation. Other packages can later be installed with [[pacman]].<br />
<br />
See [[Pacman#Troubleshooting|Pacman]] and [[Pacman-key#Troubleshooting|Pacman-key]] in case of errors.<br />
<br />
== Generate an fstab ==<br />
<br />
[[Wikipedia:Universally_unique_identifier|UUID]]s are used because they have certain advantages (see [[fstab#Identifying filesystems|Identifying filesystems]]). If you prefer labels instead, replace the {{ic|-U}} option with {{ic|-L}}:<br />
<br />
# genfstab -U /mnt > /mnt/etc/fstab<br />
<br />
The {{ic|fstab}} file should always be checked after generating it, and edited in case of errors. See [[fstab#Field definitions|Field definitions]] for syntax information.<br />
<br />
# cat /mnt/etc/fstab<br />
<br />
== Configure the base system ==<br />
<br />
[[Change root]] into the new system:<br />
<br />
# arch-chroot /mnt /bin/bash<br />
<br />
The close following and understanding of these steps is key to a properly configured system. Tools from the live installation, such as ''dialog'', are '''not''' automatically installed. The following sections specify such cases.<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. {{ic|UTF-8}} is highly recommended over other options.<br />
<br />
{{hc|# nano /etc/locale.gen|<br />
...<br />
#en_SG ISO-8859-1<br />
en_US.UTF-8 UTF-8<br />
#en_US ISO-8859-1<br />
...<br />
}}<br />
<br />
Before locales can be enabled, they must be [[Locale#Generating_locales|generated]]:<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 />
# echo LANG=en_US.UTF-8 > /etc/locale.conf<br />
<br />
If you changed the keymap in [[#Keyboard layout]], create {{ic|/etc/vconsole.conf}}. {{ic|KEYMAP}} must match the value initially set with ''loadkeys'', to ensure correct entry of the [[#Unmount the partitions and reboot|Root password]] on reboot.<br />
<br />
{{hc|# nano /etc/vconsole.conf|2=<br />
KEYMAP=''de-latin1''<br />
FONT=''lat9w-16''<br />
}}<br />
<br />
=== Time ===<br />
<br />
[[Time#Time_zone|Time zones]] are available in {{ic|/usr/share/zoneinfo/''Zone''/''SubZone''}}. To list them, run:<br />
<br />
$ ls -l /usr/share/zoneinfo<br />
<br />
To set the default zone, create a symbolic link {{ic|/etc/localtime}} to the respective subzone file:<br />
<br />
# ln -sf /usr/share/zoneinfo/''Zone''/''SubZone'' /etc/localtime<br />
<br />
It is highly recommended to set the [[Time#Time standard|Time standard]] to UTC, and adjust the [[Time#Time skew|Time skew]]:<br />
<br />
# hwclock --systohc --utc<br />
<br />
If other operating systems are installed on the machine, they must be configured accordingly.<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 />
=== Boot loader ===<br />
<br />
See [[Boot loaders]] for available choices and configurations. Here, installation with [[GRUB]] is demonstrated. If you have an Intel CPU, [[microcode]] updates must be configured after installing the boot loader.<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 />
;BIOS/MBR<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 />
;UEFI/GPT<br />
<br />
For UEFI boot, the drive needs to be GPT-partitioned and an [[Unified Extensible Firmware Interface#EFI System Partition|EFI System Partition]] (gdisk type {{ic|EF00}}, formatted with FAT32) must be present. In the following example, this partition is assumed to be mounted at {{ic|/boot}}, and have a size of 512MiB. If you have followed this guide from the beginning, you have already done all of these.<br />
<br />
Install {{Pkg|dosfstools}} to manipulate the EFI partition after installation, and {{Pkg|efibootmgr}} packages: <br />
<br />
# pacman -S dosfstools efibootmgr<br />
<br />
Install the bootloader to the boot partition:<br />
<br />
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --recheck<br />
<br />
Generate {{ic|grub.cfg}}:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
=== Network configuration ===<br />
<br />
Configure the network for the newly installed environment. The procedure is similar to [[#Establish an internet connection]], 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 />
# echo ''myhostname'' > /etc/hostname<br />
<br />
Add the same hostname to {{ic|/etc/hosts}}:<br />
<br />
{{hc|1=# nano /etc/hosts|2=<br />
#<ip-address> <hostname.domain.org> <hostname><br />
127.0.0.1 localhost.localdomain localhost ''myhostname''<br />
::1 localhost.localdomain localhost ''myhostname''<br />
}}<br />
<br />
==== Wired ====<br />
<br />
[[dhcpcd]] is the default method in the install medium, and part of the base installation. When only requiring a single wired connection, enable the ''dhcpcd'' service:<br />
<br />
# systemctl enable dhcpcd@''interface''.service<br />
<br />
Where ''interface'' is an ethernet [[Network_configuration#Device_names|device name]]. If static IP settings are required, adjust the profile configuration as described in [[#Wired (Static IP)|Static IP]].<br />
<br />
See [[Network configuration#Configure the IP address|Configure the IP address]] for more information.<br />
<br />
==== Wireless ====<br />
<br />
For wireless, ''dhcpcd'' and ''systemd-networkd'' require a separate configuration of the connection in the wireless backend, [[wpa_supplicant]], first. If you anticipate to connect the machine to different wireless networks over time, a tool which provides its own connection management may be easier to handle. Aside from [[netctl]] introduced below, [[Wireless network configuration#Automatic setup]] lists other choices. <br />
<br />
{{Warning|Wireless chipset firmware packages (for cards which require them) are pre-installed under {{ic|/usr/lib/firmware}} in the live environment, but must be installed separately on the new system. See [[Wireless network configuration#Installing driver/firmware]] for details.}}<br />
<br />
Install {{Pkg|iw}} and {{Pkg|wpa_supplicant}}, which you will need to connect to a network:<br />
<br />
# pacman -S iw wpa_supplicant<br />
<br />
===== Adding wireless networks =====<br />
<br />
; Using wifi-menu<br />
<br />
Install {{Pkg|dialog}}, which is required for ''wifi-menu'':<br />
<br />
# pacman -S dialog<br />
<br />
After finishing the rest of this installation and rebooting, you can connect to the network with:<br />
<br />
# wifi-menu ''device_name''<br />
<br />
Where {{ic|''device_name''}} is the interface of your wireless chipset.<br />
<br />
{{Warning|Do not use ''wifi-menu'' now. Instead, wait until you have finished this guide and have rebooted. It will not work now because a process spawned by this command will conflict with the one you have running outside of the chroot. Alternatively, you could just configure a network profile manually using the following templates, so that you do not have to worry about using ''wifi-menu'' at all.}}<br />
<br />
; Using manual netctl profiles<br />
<br />
See [[Netctl]] for general information, and [[Netctl#Example profiles]] for how to source and configure an example profile.<br />
<br />
===== Connect automatically to known networks =====<br />
<br />
{{Warning|This method cannot be used with explicitely enabled [[Netctl#Configuration|profiles]], i.e. through {{ic|netctl enable ''profile''}}.}}<br />
<br />
Install {{Pkg|wpa_actiond}}, which is required for {{ic|netctl-auto}}:<br />
<br />
# pacman -S wpa_actiond<br />
<br />
Enable the {{ic|netctl-auto}} service, which will connect to known networks and gracefully handle roaming and disconnects:<br />
<br />
# systemctl enable netctl-auto@''interface_name''.service<br />
<br />
{{Tip|[[netctl]] also provides {{ic|netctl-ifplugd}}, which can be used to handle wired profiles in conjunction with {{ic|netctl-auto}}.}}<br />
<br />
== Unmount the partitions and reboot ==<br />
<br />
Set the root [[password]] with:<br />
<br />
# passwd<br />
<br />
Exit from the chroot environment:<br />
<br />
# exit<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>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Mirrors&diff=396615Mirrors2015-08-30T09:22:31Z<p>Sushi Dude: /* Script to download from Mirrorlist Generator */ update-pacman-mirrorlist switched to HTTPS mirrors by default.</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package management]]<br />
[[ar:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[it:Mirrors]]<br />
[[ja:ミラー]]<br />
[[ru:Mirrors]]<br />
[[zh-CN:Mirrors]]<br />
{{Related articles start}}<br />
{{Related|Mirroring}}<br />
{{Related|pacman}}<br />
{{Related|reflector}}<br />
{{Related articles end}}<br />
<br />
This page is a guide to selecting and configuring your mirrors, and a listing of current available mirrors.<br />
<br />
== Enabling a specific mirror ==<br />
<br />
To enable mirrors, edit {{ic|/etc/pacman.d/mirrorlist}} and locate your geographic region. Uncomment mirrors you would like to use.<br />
<br />
Example:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
See [[#Mirror status]] and [[#Sorting mirrors]] for tools that help choosing mirrors.<br />
<br />
{{Tip|<br />
* Uncomment 5 favorite mirrors and place them at the top of the mirrorlist file. That way it's easy to find them and move them around if the first mirror on the list has problems. It also makes merging mirrorlist updates easier.<br />
* HTTP mirrors are faster than FTP, because of something called [[Wikipedia:HTTP persistent connection|persistent HTTP connection]]: with FTP, ''pacman'' has to establish a new connection to server each time it requests to download next package, resulting in a brief pause.}}<br />
<br />
It is also possible to specify mirrors in {{ic|/etc/pacman.conf}}. For the ''[core]'' repository, the default setup is:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
To use the ''HostEurope'' mirror as a default mirror, add it before the {{ic|Include}} line:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
pacman will now try to connect to this mirror first. Proceed to do the same for ''[testing]'', ''[extra]'', and ''[community]'', if applicable.<br />
<br />
{{Note|If mirrors have been stated directly in {{ic|pacman.conf}}, remember to use the same mirror for all repositories. Otherwise packages that are incompatible to each other may be installed, like linux from ''[core]'' and an older kernel module from ''[extra]''.}}<br />
<br />
=== Force pacman to refresh the package lists ===<br />
<br />
After creating/editing {{ic|/etc/pacman.d/mirrorlist}}, (manually or by using {{ic|rankmirrors}}) issue the following command:<br />
# pacman -Syyu<br />
<br />
{{Tip|Passing two {{ic|--refresh}} or {{ic|-y}} flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing {{ic|pacman -Syyu}} ''whenever changing to a new mirror'' is good practice and will avoid possible issues.}}<br />
<br />
== Mirror status ==<br />
<br />
Check the status of the Arch mirrors and how updated they are by visiting https://www.archlinux.org/mirrors/status/.<br />
<br />
You can generate an up to date mirrorlist [https://www.archlinux.org/mirrorlist/ here], automate the process with a [[#Script to download from Mirrorlist Generator|script]], or install [[Reflector]], a utility that generates a mirrorlist using Mirrorcheck's list; you can also manually check how up-to-date a mirror is by:<br />
#picking a server and browsing to "extra/os/";<br />
#accessing https://www.archlinux.org/ in another browser tab or window; and<br />
#comparing the last-modified date of the {{ic|i686}} directory on the mirror to the ''[extra]'' date on the homepage, in the ''Package Repositories'' box to the right.<br />
<br />
== Sorting mirrors ==<br />
<br />
When downloading packages pacman uses the mirrors in the order they are in {{ic|/etc/pacman.d/mirrorlist}}. If not using [[Reflector]] or a [[#Script to download from Mirrorlist Generator|script]], which have the ability to sort mirrors by both how updated they are and their speed, follow this demonstration of manual mirror sorting.<br />
<br />
{{Note|This does not apply to [[Improve pacman performance#Using_powerpill-light|powerpill-light]], which connects to many servers simultaneously to increase the overall download speed. The speed of individual connections becomes less relevant, and powerpill-light can be configured to require minimum speeds per connection.}}<br />
<br />
=== List by speed ===<br />
<br />
Take full advantage of using the fastest local mirror, which can be determined via the included Bash script, {{ic|/usr/bin/rankmirrors}}.<br />
<br />
Back up the existing {{ic|/etc/pacman.d/mirrorlist}}:<br />
<br />
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
Edit {{ic|/etc/pacman.d/mirrorlist.backup}} and uncomment mirrors for testing with {{ic|rankmirrors}}.<br />
<br />
Optionally run the following {{ic|sed}} line to uncomment every mirror:<br />
<br />
# sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{ic|-n 6}} means only output the 6 fastest mirrors:<br />
<br />
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist<br />
<br />
Run {{ic|rankmirrors -h}} for a list of all the available options.<br />
<br />
For the new {{ic|rankmirrors}} 1.5+ simply run<br />
<br />
# rankmirrors -g<br />
<br />
===Combined listing by speed and status===<br />
It is not a good idea to just use the fastest mirrors, since the fastest mirrors might be out of date. The preferred way would be to use [[#List by speed]], then sorting those 6 fastest mirrors by their [[#Mirror status]].<br />
<br />
Simply visit either one or both [[#Mirror status]] links and sort them by the ones that are more up to date. Move the more up to date mirrors to the top of {{ic|/etc/pacman.d/mirrorlist}} and if the mirrors are way out of date simply do not use those; repeat the process leaving out the outdated mirrors. So this ends up with a total of 6 mirrors that are sorted by speed and status, leaving out outdated mirrors.<br />
<br />
When having mirror issues the above should be repeated. Or repeat once in a while even if not having mirror problems, to keep {{ic|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
=== Script to download from Mirrorlist Generator ===<br />
<br />
{{AUR|update-pacman-mirrorlist}} is a minimalistic script that downloads a mirrorlist from a specified ranking server defaulting to the official [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator].<br />
<br />
Combined with the optional and included [[Systemd/Timers|systemd timer]], this script will automatically manage your mirrorlist for you with no intervention required.<br />
<br />
This script is a good choice for users who want low network and process overhead especially for large scale Arch Linux installations. Because all ranking is done on a single sophisticated server that takes multiple factors into account rather than on each individual client, the amount of load on the mirrors and the clients is significantly less.<br />
<br />
While the default settings are optimal for the majority of users, the mirrorlist output can be changed via query strings to the server. For example, to only output mirrors that are located in the United States, change {{ic|<nowiki>https://www.archlinux.org/mirrorlist/?use_mirror_status=on&protocol=https</nowiki>}} to {{ic|1=<nowiki>https://www.archlinux.org/mirrorlist/?use_mirror_status=on&protocol=https</nowiki>'''&country=US'''}} in the {{ic|/etc/update-pacman-mirrorlist}} configuration file.<br />
<br />
=== Using Reflector ===<br />
<br />
Alternatively, you can use [[Reflector]] to automatically retrieve the latest mirrorlist from the [https://www.archlinux.org/mirrors/status/ MirrorStatus] page, filter the most up-to-date mirrors, sort them by speed and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== List mirrors only for a specific country ===<br />
<br />
Can be useful to automate update of the mirror list only for a specific countries instead of making a speed test each time. Assumed that {{ic|mirrorlist.pacnew}} exist, the file creates after installation of the {{Pkg|pacman-mirrorlist}} update.<br />
<br />
{{bc|<nowiki>Cnt="China";<br />
awk -v GG=$Cnt '{if(match($0,GG) != "0")AA="1";if(AA == "1"){if( length($2) != "0" )print substr($0,2) ;else AA="0"} }' \<br />
/etc/pacman.d/mirrorlist.pacnew</nowiki>}}<br />
<br />
== Official mirrors ==<br />
<br />
The official Arch Linux mirror list is available from the {{pkg|pacman-mirrorlist}} package. To get an even more up-to-date list of mirrors, use the [https://www.archlinux.org/mirrorlist/ Pacman Mirror List Generator] page on the main site.<br />
<br />
In the unlikely scenario that you are without any configured mirrors and {{ic|pacman-mirrorlist}} is not installed, run the following command:<br />
# wget -O /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki><br />
<br />
Be sure to uncomment a preferred mirror as described above, then:<br />
# pacman -Syu pacman-mirrorlist<br />
<br />
If you want your mirror to be added to the official list, file a feature request. In the meantime, add it to the [[#Unofficial mirrors]] list at the end of this page.<br />
<br />
If you get an error stating that the {{ic|$arch}} variable is used but not defined, add the following to your {{ic|/etc/pacman.conf}}:<br />
Architecture = x86_64<br />
<br />
{{Note|You can also use the values {{ic|auto}} and {{ic|i686}} for the {{ic|Architecture}} variable.}}<br />
<br />
=== IPv6-ready mirrors ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/?ip_version=6 Pacman Mirrorlist Generator] can also be used to find a list of current IPv6 mirrors.<br />
<br />
== Unofficial mirrors ==<br />
<br />
These mirrors are ''not'' listed in {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== Global ===<br />
<br />
* http://sourceforge.net/projects/archlinux/files/ - ''ISO files only; Does not have any releases since 2006. Use it only if for getting older ISOs.''<br />
<br />
=== Tor Network ===<br />
These run as Tor hidden services and require a [[Tor]] client as well as a properly setup pacman to use.<br />
<br />
*http://cz2jqg7pj2hqanw7.onion/archlinux<br />
*ftp://mirror:mirror@cz2jqg7pj2hqanw7.onion/archlinux<br />
*http://rstpevyo7zx47bld.onion/archlinux<br />
<br />
=== Austria ===<br />
<br />
*http://gd.tuwien.ac.at/opsys/linux/archlinux/ - ''Vienna University of Technology''<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/<br />
<br />
=== Belarus ===<br />
<br />
*http://ftp.byfly.by/pub/archlinux/<br />
*ftp://ftp.byfly.by/pub/archlinux/<br />
<br />
=== Bulgaria ===<br />
<br />
*http://mirror.telepoint.bg/archlinux/<br />
*ftp://mirror.telepoint.bg/archlinux/<br />
<br />
=== China ===<br />
<br />
'''Telecom'''<br />
*http://mirror.bit.edu.cn/archlinux/ - ''Beijing Institute of Technology''<br />
*http://mirror.bjtu.edu.cn/archlinux/ - ''Beijing Jiaotong University''<br />
*rsync://mirror.bjtu.edu.cn/archlinux/<br />
*http://mirrors.aliyun.com/archlinux/ - ''Alibaba''<br />
<br />
'''Unicom'''<br />
*http://mirrors.sohu.com/archlinux/<br />
*http://mirrors.yun-idc.com/archlinux/<br />
<br />
'''Cernet'''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''Shanghai Jiaotong University''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(ipv4 only)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(ipv6 only)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''Lanzhou University''<br />
<br />
=== France ===<br />
<br />
*http://delta.archlinux.fr/ - ''With Delta package support. Needs xdelta3 package from extra to run.''<br />
*http://mirror.soa1.org/archlinux<br />
*ftp://mirror:mirror@mirror.soa1.org/archlinux<br />
<br />
=== Germany ===<br />
<br />
*http://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*ftp://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*http://ftp.u-tx.net/archlinux/<br />
*ftp://ftp.u-tx.net/archlinux/<br />
*http://mirror.michael-eckert.net/archlinux/<br />
*http://linux.rz.rub.de/archlinux/<br />
<br />
=== Hong Kong ===<br />
<br />
*http://hk.mirrors.linaxe.net/archlinux/<br />
<br />
=== India ===<br />
<br />
*http://ftp.iitm.ac.in/archlinux/<br />
*ftp://ftp.iitm.ac.in/archlinux/<br />
<br />
=== Indonesia ===<br />
<br />
*http://mirror.kavalinux.com/archlinux/ - ''only from Indonesia''<br />
*http://kambing.ui.ac.id/archlinux/<br />
*http://repo.ukdw.ac.id/archlinux/<br />
<br />
=== Iran ===<br />
<br />
*http://mirror.yazd.ac.ir/arch/<br />
<br />
=== Italy ===<br />
<br />
*http://mi.mirror.garr.it/mirrors/archlinux/<br />
<br />
=== Japan ===<br />
<br />
*http://ftp.nara.wide.ad.jp/pub/Linux/archlinux/ - ''NAra Institute of Science and Technology''<br />
*http://ftp.kddilabs.jp/Linux/packages/archlinux/<br />
*http://srv2.ftp.ne.jp/Linux/packages/archlinux/<br />
<br />
=== Kazakhstan ===<br />
<br />
*http://archlinux.kz/<br />
*http://mirror.neolabs.kz/archlinux/<br />
*http://mirror-kt.neolabs.kz/archlinux/<br />
<br />
=== Malaysia ===<br />
<br />
*http://mirror.oscc.org.my/archlinux/<br />
*http://mirrors.inetutils.net/archlinux/ - ''ISO and Core''<br />
<br />
=== New Zealand ===<br />
<br />
*http://mirror.ihug.co.nz/archlinux/<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only''<br />
<br />
=== Poland ===<br />
<br />
*ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
<br />
=== Russia ===<br />
<br />
*http://hatred.homelinux.net/archlinux/ - ''Vladivostok, without iso, with <sub>[http://hatred.homelinux.net/wiki/proekty:3spy:start 3SPY]</sub> project repos and [http://hatred.homelinux.net/archlinux/mingw32/os/i686 '''mingw32'''] repo''<br />
*http://mirrors.krasinfo.ru/archlinux/ - ''Krasnoyarsk, Classica-Service Ltd''<br />
*http://mirror.yandex.ru/archlinux/ - ''Moscow, [http://www.yandex.ru/ Yandex] LLC''<br />
<br />
=== Singapore ===<br />
<br />
*http://mirror.nus.edu.sg/archlinux/<br />
<br />
=== South Africa ===<br />
<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
*http://mirror.ufs.ac.za/archlinux/ - ''University of the Free State''<br />
*ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/<br />
*http://ftp.wa.co.za/pub/archlinux/ - ''Web Africa Networks''<br />
*ftp://ftp.wa.co.za/pub/archlinux/<br />
*http://archlinux.mirror.ac.za - ''TENET - Tertiary Education and Research Network of South Africa''<br />
*ftp://archlinux.mirror.ac.za<br />
<br />
=== South Korea ===<br />
<br />
*http://mirror.star4u.org/archlinux/<br />
*http://ftp2.lecl.net/pub/archlinux<br />
<br />
=== United States ===<br />
<br />
* http://archlinux.linuxfreedom.com - ''Contains numerous ISO images but does not contain the ISO dated 2011.08.19''<br />
* http://mirror.clarkson.edu/archlinux/<br />
* http://mirror.pointysoftware.net/archlinux/<br />
* http://il.mirrors.linaxe.net/archlinux/ - ''Server location - Chicago, IL''<br />
<br />
=== Viet Nam ===<br />
<br />
'''FPT TELECOM'''<br />
*http://mirror-fpt-telecom.fpt.net/archlinux/<br />
<br />
== See also ==<br />
<br />
* [http://wiki.gotux.net/code/bash/mirup MirUp] &ndash; pacman mirrorlist downloader/checker {{Dead link|2015|04|02}}</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Mirrors&diff=391792Mirrors2015-08-19T14:52:41Z<p>Sushi Dude: /* Enabling a specific mirror */ Recommended that users read the full "Sorting mirrors" section rather than just the List by speed subsection.</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package management]]<br />
[[ar:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[it:Mirrors]]<br />
[[ja:ミラー]]<br />
[[ru:Mirrors]]<br />
[[zh-CN:Mirrors]]<br />
{{Related articles start}}<br />
{{Related|Mirroring}}<br />
{{Related|pacman}}<br />
{{Related|reflector}}<br />
{{Related articles end}}<br />
<br />
This page is a guide to selecting and configuring your mirrors, and a listing of current available mirrors.<br />
<br />
== Enabling a specific mirror ==<br />
<br />
To enable mirrors, edit {{ic|/etc/pacman.d/mirrorlist}} and locate your geographic region. Uncomment mirrors you would like to use.<br />
<br />
Example:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
See [[#Mirror status]] and [[#Sorting mirrors]] for tools that help choosing mirrors.<br />
<br />
{{Tip|<br />
* Uncomment 5 favorite mirrors and place them at the top of the mirrorlist file. That way it's easy to find them and move them around if the first mirror on the list has problems. It also makes merging mirrorlist updates easier.<br />
* HTTP mirrors are faster than FTP, because of something called [[Wikipedia:HTTP persistent connection|persistent HTTP connection]]: with FTP, ''pacman'' has to establish a new connection to server each time it requests to download next package, resulting in a brief pause.}}<br />
<br />
It is also possible to specify mirrors in {{ic|/etc/pacman.conf}}. For the ''[core]'' repository, the default setup is:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
To use the ''HostEurope'' mirror as a default mirror, add it before the {{ic|Include}} line:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
pacman will now try to connect to this mirror first. Proceed to do the same for ''[testing]'', ''[extra]'', and ''[community]'', if applicable.<br />
<br />
{{Note|If mirrors have been stated directly in {{ic|pacman.conf}}, remember to use the same mirror for all repositories. Otherwise packages that are incompatible to each other may be installed, like linux from ''[core]'' and an older kernel module from ''[extra]''.}}<br />
<br />
=== Force pacman to refresh the package lists ===<br />
<br />
After creating/editing {{ic|/etc/pacman.d/mirrorlist}}, (manually or by using {{ic|rankmirrors}}) issue the following command:<br />
# pacman -Syyu<br />
<br />
{{Tip|Passing two {{ic|--refresh}} or {{ic|-y}} flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing {{ic|pacman -Syyu}} ''whenever changing to a new mirror'' is good practice and will avoid possible issues.}}<br />
<br />
== Mirror status ==<br />
<br />
Check the status of the Arch mirrors and how updated they are by visiting https://www.archlinux.org/mirrors/status/.<br />
<br />
You can generate an up to date mirrorlist [https://www.archlinux.org/mirrorlist/ here], automate the process with a [[#Script to download from Mirrorlist Generator|script]], or install [[Reflector]], a utility that generates a mirrorlist using Mirrorcheck's list; you can also manually check how up-to-date a mirror is by:<br />
#picking a server and browsing to "extra/os/";<br />
#accessing https://www.archlinux.org/ in another browser tab or window; and<br />
#comparing the last-modified date of the {{ic|i686}} directory on the mirror to the ''[extra]'' date on the homepage, in the ''Package Repositories'' box to the right.<br />
<br />
== Sorting mirrors ==<br />
<br />
When downloading packages pacman uses the mirrors in the order they are in {{ic|/etc/pacman.d/mirrorlist}}. If not using [[Reflector]] or a [[#Script to download from Mirrorlist Generator|script]], which have the ability to sort mirrors by both how updated they are and their speed, follow this demonstration of manual mirror sorting.<br />
<br />
{{Note|This does not apply to [[Improve pacman performance#Using_powerpill-light|powerpill-light]], which connects to many servers simultaneously to increase the overall download speed. The speed of individual connections becomes less relevant, and powerpill-light can be configured to require minimum speeds per connection.}}<br />
<br />
=== List by speed ===<br />
<br />
Take full advantage of using the fastest local mirror, which can be determined via the included Bash script, {{ic|/usr/bin/rankmirrors}}.<br />
<br />
Back up the existing {{ic|/etc/pacman.d/mirrorlist}}:<br />
<br />
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
Edit {{ic|/etc/pacman.d/mirrorlist.backup}} and uncomment mirrors for testing with {{ic|rankmirrors}}.<br />
<br />
Optionally run the following {{ic|sed}} line to uncomment every mirror:<br />
<br />
# sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{ic|-n 6}} means only output the 6 fastest mirrors:<br />
<br />
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist<br />
<br />
Run {{ic|rankmirrors -h}} for a list of all the available options.<br />
<br />
For the new {{ic|rankmirrors}} 1.5+ simply run<br />
<br />
# rankmirrors -g<br />
<br />
===Combined listing by speed and status===<br />
It is not a good idea to just use the fastest mirrors, since the fastest mirrors might be out of date. The preferred way would be to use [[#List by speed]], then sorting those 6 fastest mirrors by their [[#Mirror status]].<br />
<br />
Simply visit either one or both [[#Mirror status]] links and sort them by the ones that are more up to date. Move the more up to date mirrors to the top of {{ic|/etc/pacman.d/mirrorlist}} and if the mirrors are way out of date simply do not use those; repeat the process leaving out the outdated mirrors. So this ends up with a total of 6 mirrors that are sorted by speed and status, leaving out outdated mirrors.<br />
<br />
When having mirror issues the above should be repeated. Or repeat once in a while even if not having mirror problems, to keep {{ic|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
=== Script to download from Mirrorlist Generator ===<br />
<br />
{{AUR|update-pacman-mirrorlist}} is a minimalistic script that downloads a mirrorlist from a specified ranking server defaulting to the official [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator].<br />
<br />
Combined with the optional and included [[Systemd/Timers|systemd timer]], this script will automatically manage your mirrorlist for you with no intervention required.<br />
<br />
This script is a good choice for users who want low network and process overhead especially for large scale Arch Linux installations. Because all ranking is done on a single sophisticated server that takes multiple factors into account rather than on each individual client, the amount of load on the mirrors and the clients is significantly less.<br />
<br />
While the default settings are optimal for the majority of users, the mirrorlist output can be changed via query strings to the server. For example, to only output mirrors that are located in the United States, change {{ic|<nowiki>https://www.archlinux.org/mirrorlist/?use_mirror_status=on</nowiki>}} to {{ic|1=<nowiki>https://www.archlinux.org/mirrorlist/?use_mirror_status=on</nowiki>'''&country=US'''}} in the {{ic|/etc/update-pacman-mirrorlist}} configuration file.<br />
<br />
=== Using Reflector ===<br />
<br />
Alternatively, you can use [[Reflector]] to automatically retrieve the latest mirrorlist from the [https://www.archlinux.org/mirrors/status/ MirrorStatus] page, filter the most up-to-date mirrors, sort them by speed and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== List mirrors only for a specific country ===<br />
<br />
Can be useful to automate update of the mirror list only for a specific countries instead of making a speed test each time. Assumed that {{ic|mirrorlist.pacnew}} exist, the file creates after installation of the {{Pkg|pacman-mirrorlist}} update.<br />
<br />
{{bc|<nowiki>Cnt="China";<br />
awk -v GG=$Cnt '{if(match($0,GG) != "0")AA="1";if(AA == "1"){if( length($2) != "0" )print substr($0,2) ;else AA="0"} }' \<br />
/etc/pacman.d/mirrorlist.pacnew</nowiki>}}<br />
<br />
== Official mirrors ==<br />
<br />
The official Arch Linux mirror list is available from the {{pkg|pacman-mirrorlist}} package. To get an even more up-to-date list of mirrors, use the [https://www.archlinux.org/mirrorlist/ Pacman Mirror List Generator] page on the main site.<br />
<br />
In the unlikely scenario that you are without any configured mirrors and {{ic|pacman-mirrorlist}} is not installed, run the following command:<br />
# wget -O /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki><br />
<br />
Be sure to uncomment a preferred mirror as described above, then:<br />
# pacman -Syu pacman-mirrorlist<br />
<br />
If you want your mirror to be added to the official list, file a feature request. In the meantime, add it to the [[#Unofficial mirrors]] list at the end of this page.<br />
<br />
If you get an error stating that the {{ic|$arch}} variable is used but not defined, add the following to your {{ic|/etc/pacman.conf}}:<br />
Architecture = x86_64<br />
<br />
{{Note|You can also use the values {{ic|auto}} and {{ic|i686}} for the {{ic|Architecture}} variable.}}<br />
<br />
=== IPv6-ready mirrors ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/?ip_version=6 Pacman Mirrorlist Generator] can also be used to find a list of current IPv6 mirrors.<br />
<br />
== Unofficial mirrors ==<br />
<br />
These mirrors are ''not'' listed in {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== Global ===<br />
<br />
* http://sourceforge.net/projects/archlinux/files/ - ''ISO files only; Does not have any releases since 2006. Use it only if for getting older ISOs.''<br />
<br />
=== Tor Network ===<br />
These run as Tor hidden services and require a [[Tor]] client as well as a properly setup pacman to use.<br />
<br />
*http://cz2jqg7pj2hqanw7.onion/archlinux<br />
*ftp://mirror:mirror@cz2jqg7pj2hqanw7.onion/archlinux<br />
*http://rstpevyo7zx47bld.onion/archlinux<br />
<br />
=== Austria ===<br />
<br />
*http://gd.tuwien.ac.at/opsys/linux/archlinux/ - ''Vienna University of Technology''<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/<br />
<br />
=== Belarus ===<br />
<br />
*http://ftp.byfly.by/pub/archlinux/<br />
*ftp://ftp.byfly.by/pub/archlinux/<br />
<br />
=== Bulgaria ===<br />
<br />
*http://mirror.telepoint.bg/archlinux/<br />
*ftp://mirror.telepoint.bg/archlinux/<br />
<br />
=== China ===<br />
<br />
'''Telecom'''<br />
*http://mirror.bit.edu.cn/archlinux/ - ''Beijing Institute of Technology''<br />
*http://mirror.bjtu.edu.cn/archlinux/ - ''Beijing Jiaotong University''<br />
*rsync://mirror.bjtu.edu.cn/archlinux/<br />
*http://mirrors.aliyun.com/archlinux/ - ''Alibaba''<br />
<br />
'''Unicom'''<br />
*http://mirrors.sohu.com/archlinux/<br />
*http://mirrors.yun-idc.com/archlinux/<br />
<br />
'''Cernet'''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''Shanghai Jiaotong University''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(ipv4 only)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(ipv6 only)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''Lanzhou University''<br />
<br />
=== France ===<br />
<br />
*http://delta.archlinux.fr/ - ''With Delta package support. Needs xdelta3 package from extra to run.''<br />
*http://mirror.soa1.org/archlinux<br />
*ftp://mirror:mirror@mirror.soa1.org/archlinux<br />
<br />
=== Germany ===<br />
<br />
*http://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*ftp://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*http://ftp.u-tx.net/archlinux/<br />
*ftp://ftp.u-tx.net/archlinux/<br />
*http://mirror.michael-eckert.net/archlinux/<br />
*http://linux.rz.rub.de/archlinux/<br />
<br />
=== Hong Kong ===<br />
<br />
*http://hk.mirrors.linaxe.net/archlinux/<br />
<br />
=== India ===<br />
<br />
*http://ftp.iitm.ac.in/archlinux/<br />
*ftp://ftp.iitm.ac.in/archlinux/<br />
<br />
=== Indonesia ===<br />
<br />
*http://mirror.kavalinux.com/archlinux/ - ''only from Indonesia''<br />
*http://kambing.ui.ac.id/archlinux/<br />
*http://repo.ukdw.ac.id/archlinux/<br />
<br />
=== Iran ===<br />
<br />
*http://mirror.yazd.ac.ir/arch/<br />
<br />
=== Italy ===<br />
<br />
*http://mi.mirror.garr.it/mirrors/archlinux/<br />
<br />
=== Japan ===<br />
<br />
*http://ftp.nara.wide.ad.jp/pub/Linux/archlinux/ - ''NAra Institute of Science and Technology''<br />
*http://ftp.kddilabs.jp/Linux/packages/archlinux/<br />
*http://srv2.ftp.ne.jp/Linux/packages/archlinux/<br />
<br />
=== Kazakhstan ===<br />
<br />
*http://archlinux.kz/<br />
*http://mirror.neolabs.kz/archlinux/<br />
*http://mirror-kt.neolabs.kz/archlinux/<br />
<br />
=== Malaysia ===<br />
<br />
*http://mirror.oscc.org.my/archlinux/<br />
*http://mirrors.inetutils.net/archlinux/ - ''ISO and Core''<br />
<br />
=== New Zealand ===<br />
<br />
*http://mirror.ihug.co.nz/archlinux/<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only''<br />
<br />
=== Poland ===<br />
<br />
*ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
<br />
=== Russia ===<br />
<br />
*http://hatred.homelinux.net/archlinux/ - ''Vladivostok, without iso, with <sub>[http://hatred.homelinux.net/wiki/proekty:3spy:start 3SPY]</sub> project repos and [http://hatred.homelinux.net/archlinux/mingw32/os/i686 '''mingw32'''] repo''<br />
*http://mirrors.krasinfo.ru/archlinux/ - ''Krasnoyarsk, Classica-Service Ltd''<br />
*http://mirror.yandex.ru/archlinux/ - ''Moscow, [http://www.yandex.ru/ Yandex] LLC''<br />
<br />
=== Singapore ===<br />
<br />
*http://mirror.nus.edu.sg/archlinux/<br />
<br />
=== South Africa ===<br />
<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
*http://mirror.ufs.ac.za/archlinux/ - ''University of the Free State''<br />
*ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/<br />
*http://ftp.wa.co.za/pub/archlinux/ - ''Web Africa Networks''<br />
*ftp://ftp.wa.co.za/pub/archlinux/<br />
*http://archlinux.mirror.ac.za - ''TENET - Tertiary Education and Research Network of South Africa''<br />
*ftp://archlinux.mirror.ac.za<br />
<br />
=== South Korea ===<br />
<br />
*http://mirror.star4u.org/archlinux/<br />
*http://ftp2.lecl.net/pub/archlinux<br />
<br />
=== United States ===<br />
<br />
* http://archlinux.linuxfreedom.com - ''Contains numerous ISO images but does not contain the ISO dated 2011.08.19''<br />
* http://mirror.clarkson.edu/archlinux/<br />
* http://mirror.pointysoftware.net/archlinux/<br />
* http://il.mirrors.linaxe.net/archlinux/ - ''Server location - Chicago, IL''<br />
<br />
=== Viet Nam ===<br />
<br />
'''FPT TELECOM'''<br />
*http://mirror-fpt-telecom.fpt.net/archlinux/<br />
<br />
== See also ==<br />
<br />
* [http://wiki.gotux.net/code/bash/mirup MirUp] &ndash; pacman mirrorlist downloader/checker {{Dead link|2015|04|02}}</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Mirrors&diff=391789Mirrors2015-08-19T13:22:58Z<p>Sushi Dude: /* Script to download from Mirrorlist Generator */ Replaced reference to abandoned, orphaned from the AUR, and poorly designed script with a better one.</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package management]]<br />
[[ar:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[it:Mirrors]]<br />
[[ja:ミラー]]<br />
[[ru:Mirrors]]<br />
[[zh-CN:Mirrors]]<br />
{{Related articles start}}<br />
{{Related|Mirroring}}<br />
{{Related|pacman}}<br />
{{Related|reflector}}<br />
{{Related articles end}}<br />
<br />
This page is a guide to selecting and configuring your mirrors, and a listing of current available mirrors.<br />
<br />
== Enabling a specific mirror ==<br />
<br />
To enable mirrors, edit {{ic|/etc/pacman.d/mirrorlist}} and locate your geographic region. Uncomment mirrors you would like to use.<br />
<br />
Example:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
See [[#Mirror status]] and [[#List by speed]] for tools that help choosing mirrors.<br />
<br />
{{Tip|<br />
* Uncomment 5 favorite mirrors and place them at the top of the mirrorlist file. That way it's easy to find them and move them around if the first mirror on the list has problems. It also makes merging mirrorlist updates easier.<br />
* HTTP mirrors are faster than FTP, because of something called [[Wikipedia:HTTP persistent connection|persistent HTTP connection]]: with FTP, ''pacman'' has to establish a new connection to server each time it requests to download next package, resulting in a brief pause.}}<br />
<br />
It is also possible to specify mirrors in {{ic|/etc/pacman.conf}}. For the ''[core]'' repository, the default setup is:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
To use the ''HostEurope'' mirror as a default mirror, add it before the {{ic|Include}} line:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
pacman will now try to connect to this mirror first. Proceed to do the same for ''[testing]'', ''[extra]'', and ''[community]'', if applicable.<br />
<br />
{{Note|If mirrors have been stated directly in {{ic|pacman.conf}}, remember to use the same mirror for all repositories. Otherwise packages that are incompatible to each other may be installed, like linux from ''[core]'' and an older kernel module from ''[extra]''.}}<br />
<br />
=== Force pacman to refresh the package lists ===<br />
<br />
After creating/editing {{ic|/etc/pacman.d/mirrorlist}}, (manually or by using {{ic|rankmirrors}}) issue the following command:<br />
# pacman -Syyu<br />
<br />
{{Tip|Passing two {{ic|--refresh}} or {{ic|-y}} flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing {{ic|pacman -Syyu}} ''whenever changing to a new mirror'' is good practice and will avoid possible issues.}}<br />
<br />
== Mirror status ==<br />
<br />
Check the status of the Arch mirrors and how updated they are by visiting https://www.archlinux.org/mirrors/status/.<br />
<br />
You can generate an up to date mirrorlist [https://www.archlinux.org/mirrorlist/ here], automate the process with a [[#Script to download from Mirrorlist Generator|script]], or install [[Reflector]], a utility that generates a mirrorlist using Mirrorcheck's list; you can also manually check how up-to-date a mirror is by:<br />
#picking a server and browsing to "extra/os/";<br />
#accessing https://www.archlinux.org/ in another browser tab or window; and<br />
#comparing the last-modified date of the {{ic|i686}} directory on the mirror to the ''[extra]'' date on the homepage, in the ''Package Repositories'' box to the right.<br />
<br />
== Sorting mirrors ==<br />
<br />
When downloading packages pacman uses the mirrors in the order they are in {{ic|/etc/pacman.d/mirrorlist}}. If not using [[Reflector]] or a [[#Script to download from Mirrorlist Generator|script]], which have the ability to sort mirrors by both how updated they are and their speed, follow this demonstration of manual mirror sorting.<br />
<br />
{{Note|This does not apply to [[Improve pacman performance#Using_powerpill-light|powerpill-light]], which connects to many servers simultaneously to increase the overall download speed. The speed of individual connections becomes less relevant, and powerpill-light can be configured to require minimum speeds per connection.}}<br />
<br />
=== List by speed ===<br />
<br />
Take full advantage of using the fastest local mirror, which can be determined via the included Bash script, {{ic|/usr/bin/rankmirrors}}.<br />
<br />
Back up the existing {{ic|/etc/pacman.d/mirrorlist}}:<br />
<br />
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
Edit {{ic|/etc/pacman.d/mirrorlist.backup}} and uncomment mirrors for testing with {{ic|rankmirrors}}.<br />
<br />
Optionally run the following {{ic|sed}} line to uncomment every mirror:<br />
<br />
# sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{ic|-n 6}} means only output the 6 fastest mirrors:<br />
<br />
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist<br />
<br />
Run {{ic|rankmirrors -h}} for a list of all the available options.<br />
<br />
For the new {{ic|rankmirrors}} 1.5+ simply run<br />
<br />
# rankmirrors -g<br />
<br />
===Combined listing by speed and status===<br />
It is not a good idea to just use the fastest mirrors, since the fastest mirrors might be out of date. The preferred way would be to use [[#List by speed]], then sorting those 6 fastest mirrors by their [[#Mirror status]].<br />
<br />
Simply visit either one or both [[#Mirror status]] links and sort them by the ones that are more up to date. Move the more up to date mirrors to the top of {{ic|/etc/pacman.d/mirrorlist}} and if the mirrors are way out of date simply do not use those; repeat the process leaving out the outdated mirrors. So this ends up with a total of 6 mirrors that are sorted by speed and status, leaving out outdated mirrors.<br />
<br />
When having mirror issues the above should be repeated. Or repeat once in a while even if not having mirror problems, to keep {{ic|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
=== Script to download from Mirrorlist Generator ===<br />
<br />
{{AUR|update-pacman-mirrorlist}} is a minimalistic script that downloads a mirrorlist from a specified ranking server defaulting to the official [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator].<br />
<br />
Combined with the optional and included [[Systemd/Timers|systemd timer]], this script will automatically manage your mirrorlist for you with no intervention required.<br />
<br />
This script is a good choice for users who want low network and process overhead especially for large scale Arch Linux installations. Because all ranking is done on a single sophisticated server that takes multiple factors into account rather than on each individual client, the amount of load on the mirrors and the clients is significantly less.<br />
<br />
While the default settings are optimal for the majority of users, the mirrorlist output can be changed via query strings to the server. For example, to only output mirrors that are located in the United States, change {{ic|<nowiki>https://www.archlinux.org/mirrorlist/?use_mirror_status=on</nowiki>}} to {{ic|1=<nowiki>https://www.archlinux.org/mirrorlist/?use_mirror_status=on</nowiki>'''&country=US'''}} in the {{ic|/etc/update-pacman-mirrorlist}} configuration file.<br />
<br />
=== Using Reflector ===<br />
<br />
Alternatively, you can use [[Reflector]] to automatically retrieve the latest mirrorlist from the [https://www.archlinux.org/mirrors/status/ MirrorStatus] page, filter the most up-to-date mirrors, sort them by speed and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== List mirrors only for a specific country ===<br />
<br />
Can be useful to automate update of the mirror list only for a specific countries instead of making a speed test each time. Assumed that {{ic|mirrorlist.pacnew}} exist, the file creates after installation of the {{Pkg|pacman-mirrorlist}} update.<br />
<br />
{{bc|<nowiki>Cnt="China";<br />
awk -v GG=$Cnt '{if(match($0,GG) != "0")AA="1";if(AA == "1"){if( length($2) != "0" )print substr($0,2) ;else AA="0"} }' \<br />
/etc/pacman.d/mirrorlist.pacnew</nowiki>}}<br />
<br />
== Official mirrors ==<br />
<br />
The official Arch Linux mirror list is available from the {{pkg|pacman-mirrorlist}} package. To get an even more up-to-date list of mirrors, use the [https://www.archlinux.org/mirrorlist/ Pacman Mirror List Generator] page on the main site.<br />
<br />
In the unlikely scenario that you are without any configured mirrors and {{ic|pacman-mirrorlist}} is not installed, run the following command:<br />
# wget -O /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki><br />
<br />
Be sure to uncomment a preferred mirror as described above, then:<br />
# pacman -Syu pacman-mirrorlist<br />
<br />
If you want your mirror to be added to the official list, file a feature request. In the meantime, add it to the [[#Unofficial mirrors]] list at the end of this page.<br />
<br />
If you get an error stating that the {{ic|$arch}} variable is used but not defined, add the following to your {{ic|/etc/pacman.conf}}:<br />
Architecture = x86_64<br />
<br />
{{Note|You can also use the values {{ic|auto}} and {{ic|i686}} for the {{ic|Architecture}} variable.}}<br />
<br />
=== IPv6-ready mirrors ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/?ip_version=6 Pacman Mirrorlist Generator] can also be used to find a list of current IPv6 mirrors.<br />
<br />
== Unofficial mirrors ==<br />
<br />
These mirrors are ''not'' listed in {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== Global ===<br />
<br />
* http://sourceforge.net/projects/archlinux/files/ - ''ISO files only; Does not have any releases since 2006. Use it only if for getting older ISOs.''<br />
<br />
=== Tor Network ===<br />
These run as Tor hidden services and require a [[Tor]] client as well as a properly setup pacman to use.<br />
<br />
*http://cz2jqg7pj2hqanw7.onion/archlinux<br />
*ftp://mirror:mirror@cz2jqg7pj2hqanw7.onion/archlinux<br />
*http://rstpevyo7zx47bld.onion/archlinux<br />
<br />
=== Austria ===<br />
<br />
*http://gd.tuwien.ac.at/opsys/linux/archlinux/ - ''Vienna University of Technology''<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/<br />
<br />
=== Belarus ===<br />
<br />
*http://ftp.byfly.by/pub/archlinux/<br />
*ftp://ftp.byfly.by/pub/archlinux/<br />
<br />
=== Bulgaria ===<br />
<br />
*http://mirror.telepoint.bg/archlinux/<br />
*ftp://mirror.telepoint.bg/archlinux/<br />
<br />
=== China ===<br />
<br />
'''Telecom'''<br />
*http://mirror.bit.edu.cn/archlinux/ - ''Beijing Institute of Technology''<br />
*http://mirror.bjtu.edu.cn/archlinux/ - ''Beijing Jiaotong University''<br />
*rsync://mirror.bjtu.edu.cn/archlinux/<br />
*http://mirrors.aliyun.com/archlinux/ - ''Alibaba''<br />
<br />
'''Unicom'''<br />
*http://mirrors.sohu.com/archlinux/<br />
*http://mirrors.yun-idc.com/archlinux/<br />
<br />
'''Cernet'''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''Shanghai Jiaotong University''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(ipv4 only)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(ipv6 only)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''Lanzhou University''<br />
<br />
=== France ===<br />
<br />
*http://delta.archlinux.fr/ - ''With Delta package support. Needs xdelta3 package from extra to run.''<br />
*http://mirror.soa1.org/archlinux<br />
*ftp://mirror:mirror@mirror.soa1.org/archlinux<br />
<br />
=== Germany ===<br />
<br />
*http://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*ftp://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*http://ftp.u-tx.net/archlinux/<br />
*ftp://ftp.u-tx.net/archlinux/<br />
*http://mirror.michael-eckert.net/archlinux/<br />
*http://linux.rz.rub.de/archlinux/<br />
<br />
=== Hong Kong ===<br />
<br />
*http://hk.mirrors.linaxe.net/archlinux/<br />
<br />
=== India ===<br />
<br />
*http://ftp.iitm.ac.in/archlinux/<br />
*ftp://ftp.iitm.ac.in/archlinux/<br />
<br />
=== Indonesia ===<br />
<br />
*http://mirror.kavalinux.com/archlinux/ - ''only from Indonesia''<br />
*http://kambing.ui.ac.id/archlinux/<br />
*http://repo.ukdw.ac.id/archlinux/<br />
<br />
=== Iran ===<br />
<br />
*http://mirror.yazd.ac.ir/arch/<br />
<br />
=== Italy ===<br />
<br />
*http://mi.mirror.garr.it/mirrors/archlinux/<br />
<br />
=== Japan ===<br />
<br />
*http://ftp.nara.wide.ad.jp/pub/Linux/archlinux/ - ''NAra Institute of Science and Technology''<br />
*http://ftp.kddilabs.jp/Linux/packages/archlinux/<br />
*http://srv2.ftp.ne.jp/Linux/packages/archlinux/<br />
<br />
=== Kazakhstan ===<br />
<br />
*http://archlinux.kz/<br />
*http://mirror.neolabs.kz/archlinux/<br />
*http://mirror-kt.neolabs.kz/archlinux/<br />
<br />
=== Malaysia ===<br />
<br />
*http://mirror.oscc.org.my/archlinux/<br />
*http://mirrors.inetutils.net/archlinux/ - ''ISO and Core''<br />
<br />
=== New Zealand ===<br />
<br />
*http://mirror.ihug.co.nz/archlinux/<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only''<br />
<br />
=== Poland ===<br />
<br />
*ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
<br />
=== Russia ===<br />
<br />
*http://hatred.homelinux.net/archlinux/ - ''Vladivostok, without iso, with <sub>[http://hatred.homelinux.net/wiki/proekty:3spy:start 3SPY]</sub> project repos and [http://hatred.homelinux.net/archlinux/mingw32/os/i686 '''mingw32'''] repo''<br />
*http://mirrors.krasinfo.ru/archlinux/ - ''Krasnoyarsk, Classica-Service Ltd''<br />
*http://mirror.yandex.ru/archlinux/ - ''Moscow, [http://www.yandex.ru/ Yandex] LLC''<br />
<br />
=== Singapore ===<br />
<br />
*http://mirror.nus.edu.sg/archlinux/<br />
<br />
=== South Africa ===<br />
<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
*http://mirror.ufs.ac.za/archlinux/ - ''University of the Free State''<br />
*ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/<br />
*http://ftp.wa.co.za/pub/archlinux/ - ''Web Africa Networks''<br />
*ftp://ftp.wa.co.za/pub/archlinux/<br />
*http://archlinux.mirror.ac.za - ''TENET - Tertiary Education and Research Network of South Africa''<br />
*ftp://archlinux.mirror.ac.za<br />
<br />
=== South Korea ===<br />
<br />
*http://mirror.star4u.org/archlinux/<br />
*http://ftp2.lecl.net/pub/archlinux<br />
<br />
=== United States ===<br />
<br />
* http://archlinux.linuxfreedom.com - ''Contains numerous ISO images but does not contain the ISO dated 2011.08.19''<br />
* http://mirror.clarkson.edu/archlinux/<br />
* http://mirror.pointysoftware.net/archlinux/<br />
* http://il.mirrors.linaxe.net/archlinux/ - ''Server location - Chicago, IL''<br />
<br />
=== Viet Nam ===<br />
<br />
'''FPT TELECOM'''<br />
*http://mirror-fpt-telecom.fpt.net/archlinux/<br />
<br />
== See also ==<br />
<br />
* [http://wiki.gotux.net/code/bash/mirup MirUp] &ndash; pacman mirrorlist downloader/checker {{Dead link|2015|04|02}}</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Mirrors&diff=391787Mirrors2015-08-19T13:13:37Z<p>Sushi Dude: /* Sorting mirrors */ Linked to the Reflector wiki page rather than the package and included link to relevant script.</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package management]]<br />
[[ar:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[it:Mirrors]]<br />
[[ja:ミラー]]<br />
[[ru:Mirrors]]<br />
[[zh-CN:Mirrors]]<br />
{{Related articles start}}<br />
{{Related|Mirroring}}<br />
{{Related|pacman}}<br />
{{Related|reflector}}<br />
{{Related articles end}}<br />
<br />
This page is a guide to selecting and configuring your mirrors, and a listing of current available mirrors.<br />
<br />
== Enabling a specific mirror ==<br />
<br />
To enable mirrors, edit {{ic|/etc/pacman.d/mirrorlist}} and locate your geographic region. Uncomment mirrors you would like to use.<br />
<br />
Example:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
See [[#Mirror status]] and [[#List by speed]] for tools that help choosing mirrors.<br />
<br />
{{Tip|<br />
* Uncomment 5 favorite mirrors and place them at the top of the mirrorlist file. That way it's easy to find them and move them around if the first mirror on the list has problems. It also makes merging mirrorlist updates easier.<br />
* HTTP mirrors are faster than FTP, because of something called [[Wikipedia:HTTP persistent connection|persistent HTTP connection]]: with FTP, ''pacman'' has to establish a new connection to server each time it requests to download next package, resulting in a brief pause.}}<br />
<br />
It is also possible to specify mirrors in {{ic|/etc/pacman.conf}}. For the ''[core]'' repository, the default setup is:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
To use the ''HostEurope'' mirror as a default mirror, add it before the {{ic|Include}} line:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
pacman will now try to connect to this mirror first. Proceed to do the same for ''[testing]'', ''[extra]'', and ''[community]'', if applicable.<br />
<br />
{{Note|If mirrors have been stated directly in {{ic|pacman.conf}}, remember to use the same mirror for all repositories. Otherwise packages that are incompatible to each other may be installed, like linux from ''[core]'' and an older kernel module from ''[extra]''.}}<br />
<br />
=== Force pacman to refresh the package lists ===<br />
<br />
After creating/editing {{ic|/etc/pacman.d/mirrorlist}}, (manually or by using {{ic|rankmirrors}}) issue the following command:<br />
# pacman -Syyu<br />
<br />
{{Tip|Passing two {{ic|--refresh}} or {{ic|-y}} flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing {{ic|pacman -Syyu}} ''whenever changing to a new mirror'' is good practice and will avoid possible issues.}}<br />
<br />
== Mirror status ==<br />
<br />
Check the status of the Arch mirrors and how updated they are by visiting https://www.archlinux.org/mirrors/status/.<br />
<br />
You can generate an up to date mirrorlist [https://www.archlinux.org/mirrorlist/ here], automate the process with a [[#Script to download from Mirrorlist Generator|script]], or install [[Reflector]], a utility that generates a mirrorlist using Mirrorcheck's list; you can also manually check how up-to-date a mirror is by:<br />
#picking a server and browsing to "extra/os/";<br />
#accessing https://www.archlinux.org/ in another browser tab or window; and<br />
#comparing the last-modified date of the {{ic|i686}} directory on the mirror to the ''[extra]'' date on the homepage, in the ''Package Repositories'' box to the right.<br />
<br />
== Sorting mirrors ==<br />
<br />
When downloading packages pacman uses the mirrors in the order they are in {{ic|/etc/pacman.d/mirrorlist}}. If not using [[Reflector]] or a [[#Script to download from Mirrorlist Generator|script]], which have the ability to sort mirrors by both how updated they are and their speed, follow this demonstration of manual mirror sorting.<br />
<br />
{{Note|This does not apply to [[Improve pacman performance#Using_powerpill-light|powerpill-light]], which connects to many servers simultaneously to increase the overall download speed. The speed of individual connections becomes less relevant, and powerpill-light can be configured to require minimum speeds per connection.}}<br />
<br />
=== List by speed ===<br />
<br />
Take full advantage of using the fastest local mirror, which can be determined via the included Bash script, {{ic|/usr/bin/rankmirrors}}.<br />
<br />
Back up the existing {{ic|/etc/pacman.d/mirrorlist}}:<br />
<br />
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
Edit {{ic|/etc/pacman.d/mirrorlist.backup}} and uncomment mirrors for testing with {{ic|rankmirrors}}.<br />
<br />
Optionally run the following {{ic|sed}} line to uncomment every mirror:<br />
<br />
# sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{ic|-n 6}} means only output the 6 fastest mirrors:<br />
<br />
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist<br />
<br />
Run {{ic|rankmirrors -h}} for a list of all the available options.<br />
<br />
For the new {{ic|rankmirrors}} 1.5+ simply run<br />
<br />
# rankmirrors -g<br />
<br />
===Combined listing by speed and status===<br />
It is not a good idea to just use the fastest mirrors, since the fastest mirrors might be out of date. The preferred way would be to use [[#List by speed]], then sorting those 6 fastest mirrors by their [[#Mirror status]].<br />
<br />
Simply visit either one or both [[#Mirror status]] links and sort them by the ones that are more up to date. Move the more up to date mirrors to the top of {{ic|/etc/pacman.d/mirrorlist}} and if the mirrors are way out of date simply do not use those; repeat the process leaving out the outdated mirrors. So this ends up with a total of 6 mirrors that are sorted by speed and status, leaving out outdated mirrors.<br />
<br />
When having mirror issues the above should be repeated. Or repeat once in a while even if not having mirror problems, to keep {{ic|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
=== Script to download from Mirrorlist Generator ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] ranks mirrors based on geography, availability, and tiering. A script is available that can backup the previous mirrorlist then install a Mirrorlist Generator version. To install it use the AUR package {{AUR|armrr-git}} or download it with {{ic|curl -O https://raw.githubusercontent.com/Gen2ly/armrr/master/armrr}}. Run {{ic|armrr [*country code]}} or just {{ic|armrr}} for a country code prompt. Type {{ic|armrr -h,--help}} for more details.<br />
<br />
=== Using Reflector ===<br />
<br />
Alternatively, you can use [[Reflector]] to automatically retrieve the latest mirrorlist from the [https://www.archlinux.org/mirrors/status/ MirrorStatus] page, filter the most up-to-date mirrors, sort them by speed and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== List mirrors only for a specific country ===<br />
<br />
Can be useful to automate update of the mirror list only for a specific countries instead of making a speed test each time. Assumed that {{ic|mirrorlist.pacnew}} exist, the file creates after installation of the {{Pkg|pacman-mirrorlist}} update.<br />
<br />
{{bc|<nowiki>Cnt="China";<br />
awk -v GG=$Cnt '{if(match($0,GG) != "0")AA="1";if(AA == "1"){if( length($2) != "0" )print substr($0,2) ;else AA="0"} }' \<br />
/etc/pacman.d/mirrorlist.pacnew</nowiki>}}<br />
<br />
== Official mirrors ==<br />
<br />
The official Arch Linux mirror list is available from the {{pkg|pacman-mirrorlist}} package. To get an even more up-to-date list of mirrors, use the [https://www.archlinux.org/mirrorlist/ Pacman Mirror List Generator] page on the main site.<br />
<br />
In the unlikely scenario that you are without any configured mirrors and {{ic|pacman-mirrorlist}} is not installed, run the following command:<br />
# wget -O /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki><br />
<br />
Be sure to uncomment a preferred mirror as described above, then:<br />
# pacman -Syu pacman-mirrorlist<br />
<br />
If you want your mirror to be added to the official list, file a feature request. In the meantime, add it to the [[#Unofficial mirrors]] list at the end of this page.<br />
<br />
If you get an error stating that the {{ic|$arch}} variable is used but not defined, add the following to your {{ic|/etc/pacman.conf}}:<br />
Architecture = x86_64<br />
<br />
{{Note|You can also use the values {{ic|auto}} and {{ic|i686}} for the {{ic|Architecture}} variable.}}<br />
<br />
=== IPv6-ready mirrors ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/?ip_version=6 Pacman Mirrorlist Generator] can also be used to find a list of current IPv6 mirrors.<br />
<br />
== Unofficial mirrors ==<br />
<br />
These mirrors are ''not'' listed in {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== Global ===<br />
<br />
* http://sourceforge.net/projects/archlinux/files/ - ''ISO files only; Does not have any releases since 2006. Use it only if for getting older ISOs.''<br />
<br />
=== Tor Network ===<br />
These run as Tor hidden services and require a [[Tor]] client as well as a properly setup pacman to use.<br />
<br />
*http://cz2jqg7pj2hqanw7.onion/archlinux<br />
*ftp://mirror:mirror@cz2jqg7pj2hqanw7.onion/archlinux<br />
*http://rstpevyo7zx47bld.onion/archlinux<br />
<br />
=== Austria ===<br />
<br />
*http://gd.tuwien.ac.at/opsys/linux/archlinux/ - ''Vienna University of Technology''<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/<br />
<br />
=== Belarus ===<br />
<br />
*http://ftp.byfly.by/pub/archlinux/<br />
*ftp://ftp.byfly.by/pub/archlinux/<br />
<br />
=== Bulgaria ===<br />
<br />
*http://mirror.telepoint.bg/archlinux/<br />
*ftp://mirror.telepoint.bg/archlinux/<br />
<br />
=== China ===<br />
<br />
'''Telecom'''<br />
*http://mirror.bit.edu.cn/archlinux/ - ''Beijing Institute of Technology''<br />
*http://mirror.bjtu.edu.cn/archlinux/ - ''Beijing Jiaotong University''<br />
*rsync://mirror.bjtu.edu.cn/archlinux/<br />
*http://mirrors.aliyun.com/archlinux/ - ''Alibaba''<br />
<br />
'''Unicom'''<br />
*http://mirrors.sohu.com/archlinux/<br />
*http://mirrors.yun-idc.com/archlinux/<br />
<br />
'''Cernet'''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''Shanghai Jiaotong University''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(ipv4 only)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(ipv6 only)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''Lanzhou University''<br />
<br />
=== France ===<br />
<br />
*http://delta.archlinux.fr/ - ''With Delta package support. Needs xdelta3 package from extra to run.''<br />
*http://mirror.soa1.org/archlinux<br />
*ftp://mirror:mirror@mirror.soa1.org/archlinux<br />
<br />
=== Germany ===<br />
<br />
*http://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*ftp://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*http://ftp.u-tx.net/archlinux/<br />
*ftp://ftp.u-tx.net/archlinux/<br />
*http://mirror.michael-eckert.net/archlinux/<br />
*http://linux.rz.rub.de/archlinux/<br />
<br />
=== Hong Kong ===<br />
<br />
*http://hk.mirrors.linaxe.net/archlinux/<br />
<br />
=== India ===<br />
<br />
*http://ftp.iitm.ac.in/archlinux/<br />
*ftp://ftp.iitm.ac.in/archlinux/<br />
<br />
=== Indonesia ===<br />
<br />
*http://mirror.kavalinux.com/archlinux/ - ''only from Indonesia''<br />
*http://kambing.ui.ac.id/archlinux/<br />
*http://repo.ukdw.ac.id/archlinux/<br />
<br />
=== Iran ===<br />
<br />
*http://mirror.yazd.ac.ir/arch/<br />
<br />
=== Italy ===<br />
<br />
*http://mi.mirror.garr.it/mirrors/archlinux/<br />
<br />
=== Japan ===<br />
<br />
*http://ftp.nara.wide.ad.jp/pub/Linux/archlinux/ - ''NAra Institute of Science and Technology''<br />
*http://ftp.kddilabs.jp/Linux/packages/archlinux/<br />
*http://srv2.ftp.ne.jp/Linux/packages/archlinux/<br />
<br />
=== Kazakhstan ===<br />
<br />
*http://archlinux.kz/<br />
*http://mirror.neolabs.kz/archlinux/<br />
*http://mirror-kt.neolabs.kz/archlinux/<br />
<br />
=== Malaysia ===<br />
<br />
*http://mirror.oscc.org.my/archlinux/<br />
*http://mirrors.inetutils.net/archlinux/ - ''ISO and Core''<br />
<br />
=== New Zealand ===<br />
<br />
*http://mirror.ihug.co.nz/archlinux/<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only''<br />
<br />
=== Poland ===<br />
<br />
*ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
<br />
=== Russia ===<br />
<br />
*http://hatred.homelinux.net/archlinux/ - ''Vladivostok, without iso, with <sub>[http://hatred.homelinux.net/wiki/proekty:3spy:start 3SPY]</sub> project repos and [http://hatred.homelinux.net/archlinux/mingw32/os/i686 '''mingw32'''] repo''<br />
*http://mirrors.krasinfo.ru/archlinux/ - ''Krasnoyarsk, Classica-Service Ltd''<br />
*http://mirror.yandex.ru/archlinux/ - ''Moscow, [http://www.yandex.ru/ Yandex] LLC''<br />
<br />
=== Singapore ===<br />
<br />
*http://mirror.nus.edu.sg/archlinux/<br />
<br />
=== South Africa ===<br />
<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
*http://mirror.ufs.ac.za/archlinux/ - ''University of the Free State''<br />
*ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/<br />
*http://ftp.wa.co.za/pub/archlinux/ - ''Web Africa Networks''<br />
*ftp://ftp.wa.co.za/pub/archlinux/<br />
*http://archlinux.mirror.ac.za - ''TENET - Tertiary Education and Research Network of South Africa''<br />
*ftp://archlinux.mirror.ac.za<br />
<br />
=== South Korea ===<br />
<br />
*http://mirror.star4u.org/archlinux/<br />
*http://ftp2.lecl.net/pub/archlinux<br />
<br />
=== United States ===<br />
<br />
* http://archlinux.linuxfreedom.com - ''Contains numerous ISO images but does not contain the ISO dated 2011.08.19''<br />
* http://mirror.clarkson.edu/archlinux/<br />
* http://mirror.pointysoftware.net/archlinux/<br />
* http://il.mirrors.linaxe.net/archlinux/ - ''Server location - Chicago, IL''<br />
<br />
=== Viet Nam ===<br />
<br />
'''FPT TELECOM'''<br />
*http://mirror-fpt-telecom.fpt.net/archlinux/<br />
<br />
== See also ==<br />
<br />
* [http://wiki.gotux.net/code/bash/mirup MirUp] &ndash; pacman mirrorlist downloader/checker {{Dead link|2015|04|02}}</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Mirrors&diff=391783Mirrors2015-08-19T12:52:01Z<p>Sushi Dude: /* IPv6-ready mirrors */ Linked to mirrorlist that includes HTTPS and HTTP links.</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package management]]<br />
[[ar:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[it:Mirrors]]<br />
[[ja:ミラー]]<br />
[[ru:Mirrors]]<br />
[[zh-CN:Mirrors]]<br />
{{Related articles start}}<br />
{{Related|Mirroring}}<br />
{{Related|pacman}}<br />
{{Related|reflector}}<br />
{{Related articles end}}<br />
<br />
This page is a guide to selecting and configuring your mirrors, and a listing of current available mirrors.<br />
<br />
== Enabling a specific mirror ==<br />
<br />
To enable mirrors, edit {{ic|/etc/pacman.d/mirrorlist}} and locate your geographic region. Uncomment mirrors you would like to use.<br />
<br />
Example:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
See [[#Mirror status]] and [[#List by speed]] for tools that help choosing mirrors.<br />
<br />
{{Tip|<br />
* Uncomment 5 favorite mirrors and place them at the top of the mirrorlist file. That way it's easy to find them and move them around if the first mirror on the list has problems. It also makes merging mirrorlist updates easier.<br />
* HTTP mirrors are faster than FTP, because of something called [[Wikipedia:HTTP persistent connection|persistent HTTP connection]]: with FTP, ''pacman'' has to establish a new connection to server each time it requests to download next package, resulting in a brief pause.}}<br />
<br />
It is also possible to specify mirrors in {{ic|/etc/pacman.conf}}. For the ''[core]'' repository, the default setup is:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
To use the ''HostEurope'' mirror as a default mirror, add it before the {{ic|Include}} line:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
pacman will now try to connect to this mirror first. Proceed to do the same for ''[testing]'', ''[extra]'', and ''[community]'', if applicable.<br />
<br />
{{Note|If mirrors have been stated directly in {{ic|pacman.conf}}, remember to use the same mirror for all repositories. Otherwise packages that are incompatible to each other may be installed, like linux from ''[core]'' and an older kernel module from ''[extra]''.}}<br />
<br />
=== Force pacman to refresh the package lists ===<br />
<br />
After creating/editing {{ic|/etc/pacman.d/mirrorlist}}, (manually or by using {{ic|rankmirrors}}) issue the following command:<br />
# pacman -Syyu<br />
<br />
{{Tip|Passing two {{ic|--refresh}} or {{ic|-y}} flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing {{ic|pacman -Syyu}} ''whenever changing to a new mirror'' is good practice and will avoid possible issues.}}<br />
<br />
== Mirror status ==<br />
<br />
Check the status of the Arch mirrors and how updated they are by visiting https://www.archlinux.org/mirrors/status/.<br />
<br />
You can generate an up to date mirrorlist [https://www.archlinux.org/mirrorlist/ here], automate the process with a [[#Script to download from Mirrorlist Generator|script]], or install [[Reflector]], a utility that generates a mirrorlist using Mirrorcheck's list; you can also manually check how up-to-date a mirror is by:<br />
#picking a server and browsing to "extra/os/";<br />
#accessing https://www.archlinux.org/ in another browser tab or window; and<br />
#comparing the last-modified date of the {{ic|i686}} directory on the mirror to the ''[extra]'' date on the homepage, in the ''Package Repositories'' box to the right.<br />
<br />
== Sorting mirrors ==<br />
<br />
When downloading packages pacman uses the mirrors in the order they are in {{ic|/etc/pacman.d/mirrorlist}}. If not using {{Pkg|reflector}}, which has the ability to sort mirrors by both how updated they are and their speed, follow this demonstration of manual mirror sorting.<br />
<br />
{{Note|This does not apply to [[Improve pacman performance#Using_powerpill-light|powerpill-light]], which connects to many servers simultaneously to increase the overall download speed. The speed of individual connections becomes less relevant, and powerpill-light can be configured to require minimum speeds per connection.}}<br />
<br />
=== List by speed ===<br />
<br />
Take full advantage of using the fastest local mirror, which can be determined via the included Bash script, {{ic|/usr/bin/rankmirrors}}.<br />
<br />
Back up the existing {{ic|/etc/pacman.d/mirrorlist}}:<br />
<br />
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
Edit {{ic|/etc/pacman.d/mirrorlist.backup}} and uncomment mirrors for testing with {{ic|rankmirrors}}.<br />
<br />
Optionally run the following {{ic|sed}} line to uncomment every mirror:<br />
<br />
# sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{ic|-n 6}} means only output the 6 fastest mirrors:<br />
<br />
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist<br />
<br />
Run {{ic|rankmirrors -h}} for a list of all the available options.<br />
<br />
For the new {{ic|rankmirrors}} 1.5+ simply run<br />
<br />
# rankmirrors -g<br />
<br />
===Combined listing by speed and status===<br />
It is not a good idea to just use the fastest mirrors, since the fastest mirrors might be out of date. The preferred way would be to use [[#List by speed]], then sorting those 6 fastest mirrors by their [[#Mirror status]].<br />
<br />
Simply visit either one or both [[#Mirror status]] links and sort them by the ones that are more up to date. Move the more up to date mirrors to the top of {{ic|/etc/pacman.d/mirrorlist}} and if the mirrors are way out of date simply do not use those; repeat the process leaving out the outdated mirrors. So this ends up with a total of 6 mirrors that are sorted by speed and status, leaving out outdated mirrors.<br />
<br />
When having mirror issues the above should be repeated. Or repeat once in a while even if not having mirror problems, to keep {{ic|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
=== Script to download from Mirrorlist Generator ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] ranks mirrors based on geography, availability, and tiering. A script is available that can backup the previous mirrorlist then install a Mirrorlist Generator version. To install it use the AUR package {{AUR|armrr-git}} or download it with {{ic|curl -O https://raw.githubusercontent.com/Gen2ly/armrr/master/armrr}}. Run {{ic|armrr [*country code]}} or just {{ic|armrr}} for a country code prompt. Type {{ic|armrr -h,--help}} for more details.<br />
<br />
=== Using Reflector ===<br />
<br />
Alternatively, you can use [[Reflector]] to automatically retrieve the latest mirrorlist from the [https://www.archlinux.org/mirrors/status/ MirrorStatus] page, filter the most up-to-date mirrors, sort them by speed and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== List mirrors only for a specific country ===<br />
<br />
Can be useful to automate update of the mirror list only for a specific countries instead of making a speed test each time. Assumed that {{ic|mirrorlist.pacnew}} exist, the file creates after installation of the {{Pkg|pacman-mirrorlist}} update.<br />
<br />
{{bc|<nowiki>Cnt="China";<br />
awk -v GG=$Cnt '{if(match($0,GG) != "0")AA="1";if(AA == "1"){if( length($2) != "0" )print substr($0,2) ;else AA="0"} }' \<br />
/etc/pacman.d/mirrorlist.pacnew</nowiki>}}<br />
<br />
== Official mirrors ==<br />
<br />
The official Arch Linux mirror list is available from the {{pkg|pacman-mirrorlist}} package. To get an even more up-to-date list of mirrors, use the [https://www.archlinux.org/mirrorlist/ Pacman Mirror List Generator] page on the main site.<br />
<br />
In the unlikely scenario that you are without any configured mirrors and {{ic|pacman-mirrorlist}} is not installed, run the following command:<br />
# wget -O /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki><br />
<br />
Be sure to uncomment a preferred mirror as described above, then:<br />
# pacman -Syu pacman-mirrorlist<br />
<br />
If you want your mirror to be added to the official list, file a feature request. In the meantime, add it to the [[#Unofficial mirrors]] list at the end of this page.<br />
<br />
If you get an error stating that the {{ic|$arch}} variable is used but not defined, add the following to your {{ic|/etc/pacman.conf}}:<br />
Architecture = x86_64<br />
<br />
{{Note|You can also use the values {{ic|auto}} and {{ic|i686}} for the {{ic|Architecture}} variable.}}<br />
<br />
=== IPv6-ready mirrors ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/?ip_version=6 Pacman Mirrorlist Generator] can also be used to find a list of current IPv6 mirrors.<br />
<br />
== Unofficial mirrors ==<br />
<br />
These mirrors are ''not'' listed in {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== Global ===<br />
<br />
* http://sourceforge.net/projects/archlinux/files/ - ''ISO files only; Does not have any releases since 2006. Use it only if for getting older ISOs.''<br />
<br />
=== Tor Network ===<br />
These run as Tor hidden services and require a [[Tor]] client as well as a properly setup pacman to use.<br />
<br />
*http://cz2jqg7pj2hqanw7.onion/archlinux<br />
*ftp://mirror:mirror@cz2jqg7pj2hqanw7.onion/archlinux<br />
*http://rstpevyo7zx47bld.onion/archlinux<br />
<br />
=== Austria ===<br />
<br />
*http://gd.tuwien.ac.at/opsys/linux/archlinux/ - ''Vienna University of Technology''<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/<br />
<br />
=== Belarus ===<br />
<br />
*http://ftp.byfly.by/pub/archlinux/<br />
*ftp://ftp.byfly.by/pub/archlinux/<br />
<br />
=== Bulgaria ===<br />
<br />
*http://mirror.telepoint.bg/archlinux/<br />
*ftp://mirror.telepoint.bg/archlinux/<br />
<br />
=== China ===<br />
<br />
'''Telecom'''<br />
*http://mirror.bit.edu.cn/archlinux/ - ''Beijing Institute of Technology''<br />
*http://mirror.bjtu.edu.cn/archlinux/ - ''Beijing Jiaotong University''<br />
*rsync://mirror.bjtu.edu.cn/archlinux/<br />
*http://mirrors.aliyun.com/archlinux/ - ''Alibaba''<br />
<br />
'''Unicom'''<br />
*http://mirrors.sohu.com/archlinux/<br />
*http://mirrors.yun-idc.com/archlinux/<br />
<br />
'''Cernet'''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''Shanghai Jiaotong University''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(ipv4 only)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(ipv6 only)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''Lanzhou University''<br />
<br />
=== France ===<br />
<br />
*http://delta.archlinux.fr/ - ''With Delta package support. Needs xdelta3 package from extra to run.''<br />
*http://mirror.soa1.org/archlinux<br />
*ftp://mirror:mirror@mirror.soa1.org/archlinux<br />
<br />
=== Germany ===<br />
<br />
*http://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*ftp://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*http://ftp.u-tx.net/archlinux/<br />
*ftp://ftp.u-tx.net/archlinux/<br />
*http://mirror.michael-eckert.net/archlinux/<br />
*http://linux.rz.rub.de/archlinux/<br />
<br />
=== Hong Kong ===<br />
<br />
*http://hk.mirrors.linaxe.net/archlinux/<br />
<br />
=== India ===<br />
<br />
*http://ftp.iitm.ac.in/archlinux/<br />
*ftp://ftp.iitm.ac.in/archlinux/<br />
<br />
=== Indonesia ===<br />
<br />
*http://mirror.kavalinux.com/archlinux/ - ''only from Indonesia''<br />
*http://kambing.ui.ac.id/archlinux/<br />
*http://repo.ukdw.ac.id/archlinux/<br />
<br />
=== Iran ===<br />
<br />
*http://mirror.yazd.ac.ir/arch/<br />
<br />
=== Italy ===<br />
<br />
*http://mi.mirror.garr.it/mirrors/archlinux/<br />
<br />
=== Japan ===<br />
<br />
*http://ftp.nara.wide.ad.jp/pub/Linux/archlinux/ - ''NAra Institute of Science and Technology''<br />
*http://ftp.kddilabs.jp/Linux/packages/archlinux/<br />
*http://srv2.ftp.ne.jp/Linux/packages/archlinux/<br />
<br />
=== Kazakhstan ===<br />
<br />
*http://archlinux.kz/<br />
*http://mirror.neolabs.kz/archlinux/<br />
*http://mirror-kt.neolabs.kz/archlinux/<br />
<br />
=== Malaysia ===<br />
<br />
*http://mirror.oscc.org.my/archlinux/<br />
*http://mirrors.inetutils.net/archlinux/ - ''ISO and Core''<br />
<br />
=== New Zealand ===<br />
<br />
*http://mirror.ihug.co.nz/archlinux/<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only''<br />
<br />
=== Poland ===<br />
<br />
*ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
<br />
=== Russia ===<br />
<br />
*http://hatred.homelinux.net/archlinux/ - ''Vladivostok, without iso, with <sub>[http://hatred.homelinux.net/wiki/proekty:3spy:start 3SPY]</sub> project repos and [http://hatred.homelinux.net/archlinux/mingw32/os/i686 '''mingw32'''] repo''<br />
*http://mirrors.krasinfo.ru/archlinux/ - ''Krasnoyarsk, Classica-Service Ltd''<br />
*http://mirror.yandex.ru/archlinux/ - ''Moscow, [http://www.yandex.ru/ Yandex] LLC''<br />
<br />
=== Singapore ===<br />
<br />
*http://mirror.nus.edu.sg/archlinux/<br />
<br />
=== South Africa ===<br />
<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
*http://mirror.ufs.ac.za/archlinux/ - ''University of the Free State''<br />
*ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/<br />
*http://ftp.wa.co.za/pub/archlinux/ - ''Web Africa Networks''<br />
*ftp://ftp.wa.co.za/pub/archlinux/<br />
*http://archlinux.mirror.ac.za - ''TENET - Tertiary Education and Research Network of South Africa''<br />
*ftp://archlinux.mirror.ac.za<br />
<br />
=== South Korea ===<br />
<br />
*http://mirror.star4u.org/archlinux/<br />
*http://ftp2.lecl.net/pub/archlinux<br />
<br />
=== United States ===<br />
<br />
* http://archlinux.linuxfreedom.com - ''Contains numerous ISO images but does not contain the ISO dated 2011.08.19''<br />
* http://mirror.clarkson.edu/archlinux/<br />
* http://mirror.pointysoftware.net/archlinux/<br />
* http://il.mirrors.linaxe.net/archlinux/ - ''Server location - Chicago, IL''<br />
<br />
=== Viet Nam ===<br />
<br />
'''FPT TELECOM'''<br />
*http://mirror-fpt-telecom.fpt.net/archlinux/<br />
<br />
== See also ==<br />
<br />
* [http://wiki.gotux.net/code/bash/mirup MirUp] &ndash; pacman mirrorlist downloader/checker {{Dead link|2015|04|02}}</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Mirrors&diff=391782Mirrors2015-08-19T12:34:40Z<p>Sushi Dude: Removed redundant information that is already explained in the "Enabling a specific mirror" section.</p>
<hr />
<div>[[Category:About Arch]]<br />
[[Category:Package management]]<br />
[[ar:Mirrors]]<br />
[[es:Mirrors]]<br />
[[fr:Miroirs]]<br />
[[it:Mirrors]]<br />
[[ja:ミラー]]<br />
[[ru:Mirrors]]<br />
[[zh-CN:Mirrors]]<br />
{{Related articles start}}<br />
{{Related|Mirroring}}<br />
{{Related|pacman}}<br />
{{Related|reflector}}<br />
{{Related articles end}}<br />
<br />
This page is a guide to selecting and configuring your mirrors, and a listing of current available mirrors.<br />
<br />
== Enabling a specific mirror ==<br />
<br />
To enable mirrors, edit {{ic|/etc/pacman.d/mirrorlist}} and locate your geographic region. Uncomment mirrors you would like to use.<br />
<br />
Example:<br />
<br />
# Any<br />
# Server = <nowiki>ftp://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki><br />
'''Server = <nowiki>http://mirrors.kernel.org/archlinux/$repo/os/$arch</nowiki>'''<br />
<br />
See [[#Mirror status]] and [[#List by speed]] for tools that help choosing mirrors.<br />
<br />
{{Tip|<br />
* Uncomment 5 favorite mirrors and place them at the top of the mirrorlist file. That way it's easy to find them and move them around if the first mirror on the list has problems. It also makes merging mirrorlist updates easier.<br />
* HTTP mirrors are faster than FTP, because of something called [[Wikipedia:HTTP persistent connection|persistent HTTP connection]]: with FTP, ''pacman'' has to establish a new connection to server each time it requests to download next package, resulting in a brief pause.}}<br />
<br />
It is also possible to specify mirrors in {{ic|/etc/pacman.conf}}. For the ''[core]'' repository, the default setup is:<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
To use the ''HostEurope'' mirror as a default mirror, add it before the {{ic|Include}} line:<br />
[core]<br />
'''Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/$arch</nowiki>'''<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
pacman will now try to connect to this mirror first. Proceed to do the same for ''[testing]'', ''[extra]'', and ''[community]'', if applicable.<br />
<br />
{{Note|If mirrors have been stated directly in {{ic|pacman.conf}}, remember to use the same mirror for all repositories. Otherwise packages that are incompatible to each other may be installed, like linux from ''[core]'' and an older kernel module from ''[extra]''.}}<br />
<br />
=== Force pacman to refresh the package lists ===<br />
<br />
After creating/editing {{ic|/etc/pacman.d/mirrorlist}}, (manually or by using {{ic|rankmirrors}}) issue the following command:<br />
# pacman -Syyu<br />
<br />
{{Tip|Passing two {{ic|--refresh}} or {{ic|-y}} flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing {{ic|pacman -Syyu}} ''whenever changing to a new mirror'' is good practice and will avoid possible issues.}}<br />
<br />
== Mirror status ==<br />
<br />
Check the status of the Arch mirrors and how updated they are by visiting https://www.archlinux.org/mirrors/status/.<br />
<br />
You can generate an up to date mirrorlist [https://www.archlinux.org/mirrorlist/ here], automate the process with a [[#Script to download from Mirrorlist Generator|script]], or install [[Reflector]], a utility that generates a mirrorlist using Mirrorcheck's list; you can also manually check how up-to-date a mirror is by:<br />
#picking a server and browsing to "extra/os/";<br />
#accessing https://www.archlinux.org/ in another browser tab or window; and<br />
#comparing the last-modified date of the {{ic|i686}} directory on the mirror to the ''[extra]'' date on the homepage, in the ''Package Repositories'' box to the right.<br />
<br />
== Sorting mirrors ==<br />
<br />
When downloading packages pacman uses the mirrors in the order they are in {{ic|/etc/pacman.d/mirrorlist}}. If not using {{Pkg|reflector}}, which has the ability to sort mirrors by both how updated they are and their speed, follow this demonstration of manual mirror sorting.<br />
<br />
{{Note|This does not apply to [[Improve pacman performance#Using_powerpill-light|powerpill-light]], which connects to many servers simultaneously to increase the overall download speed. The speed of individual connections becomes less relevant, and powerpill-light can be configured to require minimum speeds per connection.}}<br />
<br />
=== List by speed ===<br />
<br />
Take full advantage of using the fastest local mirror, which can be determined via the included Bash script, {{ic|/usr/bin/rankmirrors}}.<br />
<br />
Back up the existing {{ic|/etc/pacman.d/mirrorlist}}:<br />
<br />
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup<br />
<br />
Edit {{ic|/etc/pacman.d/mirrorlist.backup}} and uncomment mirrors for testing with {{ic|rankmirrors}}.<br />
<br />
Optionally run the following {{ic|sed}} line to uncomment every mirror:<br />
<br />
# sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{ic|-n 6}} means only output the 6 fastest mirrors:<br />
<br />
# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist<br />
<br />
Run {{ic|rankmirrors -h}} for a list of all the available options.<br />
<br />
For the new {{ic|rankmirrors}} 1.5+ simply run<br />
<br />
# rankmirrors -g<br />
<br />
===Combined listing by speed and status===<br />
It is not a good idea to just use the fastest mirrors, since the fastest mirrors might be out of date. The preferred way would be to use [[#List by speed]], then sorting those 6 fastest mirrors by their [[#Mirror status]].<br />
<br />
Simply visit either one or both [[#Mirror status]] links and sort them by the ones that are more up to date. Move the more up to date mirrors to the top of {{ic|/etc/pacman.d/mirrorlist}} and if the mirrors are way out of date simply do not use those; repeat the process leaving out the outdated mirrors. So this ends up with a total of 6 mirrors that are sorted by speed and status, leaving out outdated mirrors.<br />
<br />
When having mirror issues the above should be repeated. Or repeat once in a while even if not having mirror problems, to keep {{ic|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
=== Script to download from Mirrorlist Generator ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/ Pacman Mirrorlist Generator] ranks mirrors based on geography, availability, and tiering. A script is available that can backup the previous mirrorlist then install a Mirrorlist Generator version. To install it use the AUR package {{AUR|armrr-git}} or download it with {{ic|curl -O https://raw.githubusercontent.com/Gen2ly/armrr/master/armrr}}. Run {{ic|armrr [*country code]}} or just {{ic|armrr}} for a country code prompt. Type {{ic|armrr -h,--help}} for more details.<br />
<br />
=== Using Reflector ===<br />
<br />
Alternatively, you can use [[Reflector]] to automatically retrieve the latest mirrorlist from the [https://www.archlinux.org/mirrors/status/ MirrorStatus] page, filter the most up-to-date mirrors, sort them by speed and overwrite the file {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== List mirrors only for a specific country ===<br />
<br />
Can be useful to automate update of the mirror list only for a specific countries instead of making a speed test each time. Assumed that {{ic|mirrorlist.pacnew}} exist, the file creates after installation of the {{Pkg|pacman-mirrorlist}} update.<br />
<br />
{{bc|<nowiki>Cnt="China";<br />
awk -v GG=$Cnt '{if(match($0,GG) != "0")AA="1";if(AA == "1"){if( length($2) != "0" )print substr($0,2) ;else AA="0"} }' \<br />
/etc/pacman.d/mirrorlist.pacnew</nowiki>}}<br />
<br />
== Official mirrors ==<br />
<br />
The official Arch Linux mirror list is available from the {{pkg|pacman-mirrorlist}} package. To get an even more up-to-date list of mirrors, use the [https://www.archlinux.org/mirrorlist/ Pacman Mirror List Generator] page on the main site.<br />
<br />
In the unlikely scenario that you are without any configured mirrors and {{ic|pacman-mirrorlist}} is not installed, run the following command:<br />
# wget -O /etc/pacman.d/mirrorlist <nowiki>https://www.archlinux.org/mirrorlist/all/</nowiki><br />
<br />
Be sure to uncomment a preferred mirror as described above, then:<br />
# pacman -Syu pacman-mirrorlist<br />
<br />
If you want your mirror to be added to the official list, file a feature request. In the meantime, add it to the [[#Unofficial mirrors]] list at the end of this page.<br />
<br />
If you get an error stating that the {{ic|$arch}} variable is used but not defined, add the following to your {{ic|/etc/pacman.conf}}:<br />
Architecture = x86_64<br />
<br />
{{Note|You can also use the values {{ic|auto}} and {{ic|i686}} for the {{ic|Architecture}} variable.}}<br />
<br />
=== IPv6-ready mirrors ===<br />
<br />
The [https://www.archlinux.org/mirrorlist/?country=all&protocol=http&ip_version=6 pacman mirror list generator] can also be used to find a list of current IPv6 mirrors.<br />
<br />
== Unofficial mirrors ==<br />
<br />
These mirrors are ''not'' listed in {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
=== Global ===<br />
<br />
* http://sourceforge.net/projects/archlinux/files/ - ''ISO files only; Does not have any releases since 2006. Use it only if for getting older ISOs.''<br />
<br />
=== Tor Network ===<br />
These run as Tor hidden services and require a [[Tor]] client as well as a properly setup pacman to use.<br />
<br />
*http://cz2jqg7pj2hqanw7.onion/archlinux<br />
*ftp://mirror:mirror@cz2jqg7pj2hqanw7.onion/archlinux<br />
*http://rstpevyo7zx47bld.onion/archlinux<br />
<br />
=== Austria ===<br />
<br />
*http://gd.tuwien.ac.at/opsys/linux/archlinux/ - ''Vienna University of Technology''<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/<br />
<br />
=== Belarus ===<br />
<br />
*http://ftp.byfly.by/pub/archlinux/<br />
*ftp://ftp.byfly.by/pub/archlinux/<br />
<br />
=== Bulgaria ===<br />
<br />
*http://mirror.telepoint.bg/archlinux/<br />
*ftp://mirror.telepoint.bg/archlinux/<br />
<br />
=== China ===<br />
<br />
'''Telecom'''<br />
*http://mirror.bit.edu.cn/archlinux/ - ''Beijing Institute of Technology''<br />
*http://mirror.bjtu.edu.cn/archlinux/ - ''Beijing Jiaotong University''<br />
*rsync://mirror.bjtu.edu.cn/archlinux/<br />
*http://mirrors.aliyun.com/archlinux/ - ''Alibaba''<br />
<br />
'''Unicom'''<br />
*http://mirrors.sohu.com/archlinux/<br />
*http://mirrors.yun-idc.com/archlinux/<br />
<br />
'''Cernet'''<br />
*http://ftp.sjtu.edu.cn/archlinux/ - ''Shanghai Jiaotong University''<br />
*http://mirrors.4.tuna.tsinghua.edu.cn/archlinux/ ''(ipv4 only)''<br />
*http://mirrors.6.tuna.tsinghua.edu.cn/archlinux/ ''(ipv6 only)''<br />
*http://mirror.lzu.edu.cn/archlinux/ - ''Lanzhou University''<br />
<br />
=== France ===<br />
<br />
*http://delta.archlinux.fr/ - ''With Delta package support. Needs xdelta3 package from extra to run.''<br />
*http://mirror.soa1.org/archlinux<br />
*ftp://mirror:mirror@mirror.soa1.org/archlinux<br />
<br />
=== Germany ===<br />
<br />
*http://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*ftp://ftp.uni-erlangen.de/mirrors/archlinux/<br />
*http://ftp.u-tx.net/archlinux/<br />
*ftp://ftp.u-tx.net/archlinux/<br />
*http://mirror.michael-eckert.net/archlinux/<br />
*http://linux.rz.rub.de/archlinux/<br />
<br />
=== Hong Kong ===<br />
<br />
*http://hk.mirrors.linaxe.net/archlinux/<br />
<br />
=== India ===<br />
<br />
*http://ftp.iitm.ac.in/archlinux/<br />
*ftp://ftp.iitm.ac.in/archlinux/<br />
<br />
=== Indonesia ===<br />
<br />
*http://mirror.kavalinux.com/archlinux/ - ''only from Indonesia''<br />
*http://kambing.ui.ac.id/archlinux/<br />
*http://repo.ukdw.ac.id/archlinux/<br />
<br />
=== Iran ===<br />
<br />
*http://mirror.yazd.ac.ir/arch/<br />
<br />
=== Italy ===<br />
<br />
*http://mi.mirror.garr.it/mirrors/archlinux/<br />
<br />
=== Japan ===<br />
<br />
*http://ftp.nara.wide.ad.jp/pub/Linux/archlinux/ - ''NAra Institute of Science and Technology''<br />
*http://ftp.kddilabs.jp/Linux/packages/archlinux/<br />
*http://srv2.ftp.ne.jp/Linux/packages/archlinux/<br />
<br />
=== Kazakhstan ===<br />
<br />
*http://archlinux.kz/<br />
*http://mirror.neolabs.kz/archlinux/<br />
*http://mirror-kt.neolabs.kz/archlinux/<br />
<br />
=== Malaysia ===<br />
<br />
*http://mirror.oscc.org.my/archlinux/<br />
*http://mirrors.inetutils.net/archlinux/ - ''ISO and Core''<br />
<br />
=== New Zealand ===<br />
<br />
*http://mirror.ihug.co.nz/archlinux/<br />
*http://mirror.ece.auckland.ac.nz/archlinux/ ''NZ only''<br />
<br />
=== Poland ===<br />
<br />
*ftp://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
*rsync://ftp.icm.edu.pl/pub/Linux/dist/archlinux/ - ICM UW<br />
<br />
=== Russia ===<br />
<br />
*http://hatred.homelinux.net/archlinux/ - ''Vladivostok, without iso, with <sub>[http://hatred.homelinux.net/wiki/proekty:3spy:start 3SPY]</sub> project repos and [http://hatred.homelinux.net/archlinux/mingw32/os/i686 '''mingw32'''] repo''<br />
*http://mirrors.krasinfo.ru/archlinux/ - ''Krasnoyarsk, Classica-Service Ltd''<br />
*http://mirror.yandex.ru/archlinux/ - ''Moscow, [http://www.yandex.ru/ Yandex] LLC''<br />
<br />
=== Singapore ===<br />
<br />
*http://mirror.nus.edu.sg/archlinux/<br />
<br />
=== South Africa ===<br />
<br />
*http://ftp.leg.uct.ac.za/pub/linux/arch/ - ''University of Cape Town''<br />
*ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
*http://mirror.ufs.ac.za/archlinux/ - ''University of the Free State''<br />
*ftp://mirror.ufs.ac.za/os/linux/distros/archlinux/<br />
*http://ftp.wa.co.za/pub/archlinux/ - ''Web Africa Networks''<br />
*ftp://ftp.wa.co.za/pub/archlinux/<br />
*http://archlinux.mirror.ac.za - ''TENET - Tertiary Education and Research Network of South Africa''<br />
*ftp://archlinux.mirror.ac.za<br />
<br />
=== South Korea ===<br />
<br />
*http://mirror.star4u.org/archlinux/<br />
*http://ftp2.lecl.net/pub/archlinux<br />
<br />
=== United States ===<br />
<br />
* http://archlinux.linuxfreedom.com - ''Contains numerous ISO images but does not contain the ISO dated 2011.08.19''<br />
* http://mirror.clarkson.edu/archlinux/<br />
* http://mirror.pointysoftware.net/archlinux/<br />
* http://il.mirrors.linaxe.net/archlinux/ - ''Server location - Chicago, IL''<br />
<br />
=== Viet Nam ===<br />
<br />
'''FPT TELECOM'''<br />
*http://mirror-fpt-telecom.fpt.net/archlinux/<br />
<br />
== See also ==<br />
<br />
* [http://wiki.gotux.net/code/bash/mirup MirUp] &ndash; pacman mirrorlist downloader/checker {{Dead link|2015|04|02}}</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Eclipse&diff=386246Eclipse2015-07-22T07:48:52Z<p>Sushi Dude: Reference the new package conflict issue report.</p>
<hr />
<div>[[Category:Development]]<br />
[[it:Eclipse]]<br />
[[ja:Eclipse]]<br />
[[ru:Eclipse]]<br />
[[zh-CN:Eclipse]]<br />
[https://eclipse.org Eclipse] is an open source community project, which aims to provide a universal development platform. The Eclipse project is most widely known for its cross-platform integrated development environment (IDE). The Arch Linux packages (and this guide) relate specifically to the IDE.<br />
<br />
The Eclipse IDE is largely written in Java but can be used to develop applications in a number of languages, including Java, C/C++, PHP, Perl and Python. The IDE can also provide subversion support and task management.<br />
<br />
== Installation ==<br />
<br />
[[Pacman|Install]] the {{Pkg|eclipse-java}} package from the [[official repositories]].<br />
This base package has [[Java]] development support built in. Alternatively, {{Pkg|eclipse-cpp}} is meant for C++ development.<br />
For some reason, these two packages are in conflict, and you will have to decide the one you want to use (see https://bugs.archlinux.org/task/45577).<br />
<br />
== Plugins ==<br />
<br />
Many plugins are easily installed using '''pacman''' (see [[Eclipse plugin package guidelines]] for further informations). This will also keep them up-to-date. Alternatively, you can choose either the [[#Eclipse Marketplace|Eclipse Marketplace]] or the internal [[#plugin manager|plugin manager]].<br />
<br />
=== Add the default update site ===<br />
<br />
Make sure that you check that the default update site for your version of Eclipse is configured so that plugin dependencies can automatically be installed. The most current version of Eclipse is Mars and the default update site for it is: http://download.eclipse.org/releases/mars. Go to Help > Install new Software > Add, fill the name to easily identify the update site later - for instance, Mars Software Repository - and fill the location with the url.<br />
<br />
=== Eclipse Marketplace ===<br />
<br />
{{Note|make sure you have followed the [[#Add the default update site|Add the default update site]] section.}}<br />
To use the Eclipse Marketplace, install it first: go to Help > Install new software > Switch to the default update site > General Purpose Tools > Marketplace Client. Restart Eclipse and it will be available in Help > Eclipse Marketplace.<br />
<br />
=== Plugin manager ===<br />
<br />
{{Note|make sure you have followed the [[#Add the default update site|Add the default update site]] section.}}<br />
Use Eclipse's plugin manager to download and install plugins from their original repositories: in this case you have to find the needed repository in the plugin's website, then go to ''Help > Install New Software...'', enter the repository in the ''Work with'' field, select the plugin to install from the list below and follow the instructions.<br />
<br />
{{Note|<br />
* If you install plugins with Eclipse's plugin manager, you are advised to launch Eclipse as root: this way the plugins will be installed in {{ic|/usr/lib/eclipse/plugins/}}; if you installed them as normal user, they would be stored in a version-dependent folder inside {{ic|~/.eclipse/}}, and, after upgrading Eclipse, they wouldn't be recognized any longer.<br />
* Do not use Eclipse as root for your everyday work.<br />
}}<br />
<br />
==== Updates via plugin manager ====<br />
<br />
Run Eclipse and select ''Help > Check for Updates''. If you have installed them as root as advised in the section above, you have to run Eclipse as root.<br />
<br />
For plugins to be updated, you should check to have their update repositories enabled in ''Window > Preferences > Install/Update > Available Software Sites'': you can find each plugin's repository(es) on the respective project website. To add, edit, remove... repositories just use the buttons on the right of the ''Available Software Sites'' panel. For Eclipse 4.5 (Mars), check you have enabled this repository:<br />
<br />
http://download.eclipse.org/releases/mars<br />
<br />
To receive update notifications, go to ''Window > Preferences > Install/Update > Automatic Updates''. If you want to receive notifications for plugins installed as root, you should run Eclipse as root, go to ''Window > Preferences > Install/Update > Available Software Sites'', select the repositories related to the installed plugins and ''Export'' them, then run Eclipse as normal user and ''Import'' them in the same panel.<br />
<br />
=== List of plugins ===<br />
<br />
* {{App|AVR|AVR microcontroller plugin.|http://avr-eclipse.sourceforge.net/wiki/index.php/The_AVR_Eclipse_Plugin|{{AUR|eclipse-avr}}}}<br />
* {{App|Aptana|HTML5/CSS3/JavaScript/Ruby/Rails/PHP/Pydev/Django support. Also available as standalone application.|http://www.aptana.com/|{{AUR|eclipse-aptana}} {{AUR|aptana-studio}}}}<br />
* {{App|Eclipse CDT|C/C++ support.|https://www.eclipse.org/cdt/|{{Pkg|eclipse-cpp}}}}<br />
* {{App|Eclipse PDT|[[PHP]] support.|https://www.eclipse.org/pdt/|{{AUR|eclipse-pdt}}}}<br />
* {{App|EclipseFP|[[Haskell]] support.|https://eclipsefp.github.io/|{{AUR|eclipse-eclipsefp}}}}<br />
* {{App|EGit|[[Git]] support.|https://www.eclipse.org/egit|{{AUR|eclipse-egit}}}}<br />
* {{App|EPIC|Perl support.|http://www.epic-ide.org/|{{AUR|eclipse-epic}}}}<br />
* {{App|IvyDE|IvyDE dependency Manager.|https://ant.apache.org/ivy/ivyde/|{{AUR|eclipse-ivyde}}}}<br />
* {{App|Markdown|Markdown editor plugin for Eclipse.|http://www.winterwell.com/software/markdown-editor.php|{{AUR|eclipse-markdown}}}}<br />
* {{App|MercurialEclipse|[[Mercurial]] support.|https://bitbucket.org/mercurialeclipse/main/wiki/Home|{{AUR|eclipse-mercurial}}}}<br />
* {{App|Mylyn|Task lists support.|https://www.eclipse.org/mylyn/|{{AUR|eclipse-mylyn}}}}<br />
* {{App|PHPEclipse|Alternative PHP support.|http://www.phpeclipse.com/|{{AUR|eclipse-phpeclipse}}}}<br />
* {{App|PyDev|[[Python]] support.|http://pydev.org/|{{AUR|eclipse-pydev}}}}<br />
* {{App|Subclipse|[[Subversion]] support.|http://subclipse.tigris.org/|{{AUR|eclipse-subclipse}}}}<br />
* {{App|Subversive|Alternative Subversion support.|https://www.eclipse.org/subversive/|{{AUR|eclipse-subversive}}}}<br />
* {{App|TestNG|TestNG support.|http://testng.org/doc/eclipse.html|{{AUR|eclipse-testng}}}}<br />
* {{App|TeXlipse|[[LaTeX]] support.|http://texlipse.sourceforge.net/|{{AUR|texlipse}}}}<br />
* {{App|Eclipse PTP|Parallel Programming C/C++ support.|https://www.eclipse.org/ptp/|{{AUR|eclipse-ptp}}}}<br />
<br />
== Enable javadoc integration ==<br />
<br />
Want to see API entries when hovering the mouse pointer over standard Java methods?<br />
<br />
=== Online version ===<br />
<br />
If you have constant Internet access on your machine, you can use the on-line documentation:<br />
<br />
# Go to ''Window > Preferences'', then go to ''Java > Installed JREs''.<br />
# There should be one named "java" with the type "Standard VM". Select this and click ''Edit''.<br />
# Select the {{ic|/opt/java/jre/lib/rt.jar}} item under "JRE system libraries:", then click ''Javadoc Location...''.<br />
# Enter "https://docs.oracle.com/javase/8/docs/api/" in the "Javadoc location path:" text field.<br />
<br />
=== Offline version ===<br />
<br />
You can store the documentation locally by installing the {{Pkg|openjdk8-doc}} package. Eclipse may be able to find the javadocs automatically. If that doesn't work, set Javadoc location for rt.jar to {{ic|file:/usr/share/doc/java8-openjdk/api}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Crash on first boot or when choosing ''Help > Welcome'' ===<br />
<br />
Add the following line to {{ic|/usr/share/eclipse/eclipse.ini}}:<br />
<br />
-Dorg.eclipse.swt.browser.UseWebKitGTK=true<br />
<br />
If Firefox is installed try also:<br />
<br />
-Dorg.eclipse.swt.browser.DefaultType=mozilla<br />
<br />
=== Ctrl+X closes Eclipse ===<br />
<br />
Part of [https://bugs.eclipse.org/bugs/show_bug.cgi?id=318177 this] bug. Just look in {{ic|~/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi}} and delete the wrong {{ic|Ctrl+X}} combination. Usually it is the first one.<br />
<br />
=== Eclipse 4 not respecting dark/custom gtk themes resulting in white background ===<br />
<br />
====4.2.0 and 4.3.0====<br />
Remove or move to backup sub folder all of the .css files from:<br />
/usr/share/eclipse/plugins/org.eclipse.platform_4.2.0.v201206081400/css/<br />
<br />
Solution source: https://www.eclipse.org/forums/index.php/m/872214/<br />
<br />
This also works with version 4.3.x (Kepler) by backing up the css folder from /usr/share/eclipse/plugins/org.eclipse.platform_4.3.xxx/css/<br />
<br />
====4.4.0 (Luna)====<br />
<br />
Luna Supplies a Dark theme which can be enabled in Preferences > Appearance and selecting the 'Dark' theme.<br />
<br />
The dark theme uses its own colours rather than the GTK theme colours, if you prefer it to fully respect GTK colour settings, then remove or move to backup sub folder all of the .css files from: /usr/share/eclipse/plugins/org.eclipse.ui.themes_1.0.0.xxxx/css/<br />
<br />
=== Tooltips have dark background color with Gnome 3.6 Adwaita theme ===<br />
<br />
Comment out the second-to-last line in {{ic|/usr/share/themes/Adwaita/gtk-2.0/gtkrc}} like this<br />
<br />
#widget "gtk-tooltip*" style "tooltips"<br />
<br />
Related bugs: <br />
<br />
* https://bugzilla.gnome.org/show_bug.cgi?id=688285 <br />
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=381010 (WONTFIX)<br />
<br />
=== Toggle buttons states are the same for selected/not selected ===<br />
<br />
Comment out the last line in {{ic|/usr/share/themes/Adwaita/gtk-2.0/gtkrc}} like this<br />
<br />
#widget "*swt*toolbar*" style "null"<br />
<br />
To apply the fixed theme, use {{ic|gnome-tweak-tool}} to select a different theme and cycle back to Adwaita.<br />
<br />
Related bugs: <br />
<br />
* https://bugzilla.gnome.org/show_bug.cgi?id=687519<br />
<br />
=== Change Default Window Title Font Size ===<br />
<br />
You can't change the window title font size using the Eclipse preferences, you must edit the actual theme .css files. Note, that you will have to redo this when you upgrade eclipse.<br />
They are located under<br />
/usr/share/eclipse/plugins/org.eclipse.platform_4.3.<your version number>/css<br />
Open the appropriate file with your text editor, ie e4_default_gtk.css if you are using the "GTK theme".<br />
Search for .MPartStack, and change the font-size to your desired size<br />
.MPartStack {<br />
font-size: 9;<br />
swt-simple: false;<br />
swt-mru-visible: false;<br />
}<br />
<br />
== See also ==<br />
<br />
* [https://www.ibm.com/developerworks/library/os-ecl-subversion/ How to use Subversion with Eclipse]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Eclipse&diff=386235Eclipse2015-07-22T03:02:05Z<p>Sushi Dude: Reference the package conflict issue report.</p>
<hr />
<div>[[Category:Development]]<br />
[[it:Eclipse]]<br />
[[ja:Eclipse]]<br />
[[ru:Eclipse]]<br />
[[zh-CN:Eclipse]]<br />
[https://eclipse.org Eclipse] is an open source community project, which aims to provide a universal development platform. The Eclipse project is most widely known for its cross-platform integrated development environment (IDE). The Arch Linux packages (and this guide) relate specifically to the IDE.<br />
<br />
The Eclipse IDE is largely written in Java but can be used to develop applications in a number of languages, including Java, C/C++, PHP, Perl and Python. The IDE can also provide subversion support and task management.<br />
<br />
== Installation ==<br />
<br />
[[Pacman|Install]] the {{Pkg|eclipse-java}} package from the [[official repositories]].<br />
This base package has [[Java]] development support built in. Alternatively, {{Pkg|eclipse-cpp}} is meant for C++ development.<br />
For some reason, these two packages are in conflict, and you will have to decide the one you want to use (see https://bugs.archlinux.org/task/45734).<br />
<br />
== Plugins ==<br />
<br />
Many plugins are easily installed using '''pacman''' (see [[Eclipse plugin package guidelines]] for further informations). This will also keep them up-to-date. Alternatively, you can choose either the [[#Eclipse Marketplace|Eclipse Marketplace]] or the internal [[#plugin manager|plugin manager]].<br />
<br />
=== Add the default update site ===<br />
<br />
Make sure that you check that the default update site for your version of Eclipse is configured so that plugin dependencies can automatically be installed. The most current version of Eclipse is Mars and the default update site for it is: http://download.eclipse.org/releases/mars. Go to Help > Install new Software > Add, fill the name to easily identify the update site later - for instance, Mars Software Repository - and fill the location with the url.<br />
<br />
=== Eclipse Marketplace ===<br />
<br />
{{Note|make sure you have followed the [[#Add the default update site|Add the default update site]] section.}}<br />
To use the Eclipse Marketplace, install it first: go to Help > Install new software > Switch to the default update site > General Purpose Tools > Marketplace Client. Restart Eclipse and it will be available in Help > Eclipse Marketplace.<br />
<br />
=== Plugin manager ===<br />
<br />
{{Note|make sure you have followed the [[#Add the default update site|Add the default update site]] section.}}<br />
Use Eclipse's plugin manager to download and install plugins from their original repositories: in this case you have to find the needed repository in the plugin's website, then go to ''Help > Install New Software...'', enter the repository in the ''Work with'' field, select the plugin to install from the list below and follow the instructions.<br />
<br />
{{Note|<br />
* If you install plugins with Eclipse's plugin manager, you are advised to launch Eclipse as root: this way the plugins will be installed in {{ic|/usr/lib/eclipse/plugins/}}; if you installed them as normal user, they would be stored in a version-dependent folder inside {{ic|~/.eclipse/}}, and, after upgrading Eclipse, they wouldn't be recognized any longer.<br />
* Do not use Eclipse as root for your everyday work.<br />
}}<br />
<br />
==== Updates via plugin manager ====<br />
<br />
Run Eclipse and select ''Help > Check for Updates''. If you have installed them as root as advised in the section above, you have to run Eclipse as root.<br />
<br />
For plugins to be updated, you should check to have their update repositories enabled in ''Window > Preferences > Install/Update > Available Software Sites'': you can find each plugin's repository(es) on the respective project website. To add, edit, remove... repositories just use the buttons on the right of the ''Available Software Sites'' panel. For Eclipse 4.5 (Mars), check you have enabled this repository:<br />
<br />
http://download.eclipse.org/releases/mars<br />
<br />
To receive update notifications, go to ''Window > Preferences > Install/Update > Automatic Updates''. If you want to receive notifications for plugins installed as root, you should run Eclipse as root, go to ''Window > Preferences > Install/Update > Available Software Sites'', select the repositories related to the installed plugins and ''Export'' them, then run Eclipse as normal user and ''Import'' them in the same panel.<br />
<br />
=== List of plugins ===<br />
<br />
* {{App|AVR|AVR microcontroller plugin.|http://avr-eclipse.sourceforge.net/wiki/index.php/The_AVR_Eclipse_Plugin|{{AUR|eclipse-avr}}}}<br />
* {{App|Aptana|HTML5/CSS3/JavaScript/Ruby/Rails/PHP/Pydev/Django support. Also available as standalone application.|http://www.aptana.com/|{{AUR|eclipse-aptana}} {{AUR|aptana-studio}}}}<br />
* {{App|Eclipse CDT|C/C++ support.|https://www.eclipse.org/cdt/|{{Pkg|eclipse-cpp}}}}<br />
* {{App|Eclipse PDT|[[PHP]] support.|https://www.eclipse.org/pdt/|{{AUR|eclipse-pdt}}}}<br />
* {{App|EclipseFP|[[Haskell]] support.|https://eclipsefp.github.io/|{{AUR|eclipse-eclipsefp}}}}<br />
* {{App|EGit|[[Git]] support.|https://www.eclipse.org/egit|{{AUR|eclipse-egit}}}}<br />
* {{App|EPIC|Perl support.|http://www.epic-ide.org/|{{AUR|eclipse-epic}}}}<br />
* {{App|IvyDE|IvyDE dependency Manager.|https://ant.apache.org/ivy/ivyde/|{{AUR|eclipse-ivyde}}}}<br />
* {{App|Markdown|Markdown editor plugin for Eclipse.|http://www.winterwell.com/software/markdown-editor.php|{{AUR|eclipse-markdown}}}}<br />
* {{App|MercurialEclipse|[[Mercurial]] support.|https://bitbucket.org/mercurialeclipse/main/wiki/Home|{{AUR|eclipse-mercurial}}}}<br />
* {{App|Mylyn|Task lists support.|https://www.eclipse.org/mylyn/|{{AUR|eclipse-mylyn}}}}<br />
* {{App|PHPEclipse|Alternative PHP support.|http://www.phpeclipse.com/|{{AUR|eclipse-phpeclipse}}}}<br />
* {{App|PyDev|[[Python]] support.|http://pydev.org/|{{AUR|eclipse-pydev}}}}<br />
* {{App|Subclipse|[[Subversion]] support.|http://subclipse.tigris.org/|{{AUR|eclipse-subclipse}}}}<br />
* {{App|Subversive|Alternative Subversion support.|https://www.eclipse.org/subversive/|{{AUR|eclipse-subversive}}}}<br />
* {{App|TestNG|TestNG support.|http://testng.org/doc/eclipse.html|{{AUR|eclipse-testng}}}}<br />
* {{App|TeXlipse|[[LaTeX]] support.|http://texlipse.sourceforge.net/|{{AUR|texlipse}}}}<br />
* {{App|Eclipse PTP|Parallel Programming C/C++ support.|https://www.eclipse.org/ptp/|{{AUR|eclipse-ptp}}}}<br />
<br />
== Enable javadoc integration ==<br />
<br />
Want to see API entries when hovering the mouse pointer over standard Java methods?<br />
<br />
=== Online version ===<br />
<br />
If you have constant Internet access on your machine, you can use the on-line documentation:<br />
<br />
# Go to ''Window > Preferences'', then go to ''Java > Installed JREs''.<br />
# There should be one named "java" with the type "Standard VM". Select this and click ''Edit''.<br />
# Select the {{ic|/opt/java/jre/lib/rt.jar}} item under "JRE system libraries:", then click ''Javadoc Location...''.<br />
# Enter "https://docs.oracle.com/javase/8/docs/api/" in the "Javadoc location path:" text field.<br />
<br />
=== Offline version ===<br />
<br />
You can store the documentation locally by installing the {{Pkg|openjdk8-doc}} package. Eclipse may be able to find the javadocs automatically. If that doesn't work, set Javadoc location for rt.jar to {{ic|file:/usr/share/doc/java8-openjdk/api}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Crash on first boot or when choosing ''Help > Welcome'' ===<br />
<br />
Add the following line to {{ic|/usr/share/eclipse/eclipse.ini}}:<br />
<br />
-Dorg.eclipse.swt.browser.UseWebKitGTK=true<br />
<br />
If Firefox is installed try also:<br />
<br />
-Dorg.eclipse.swt.browser.DefaultType=mozilla<br />
<br />
=== Ctrl+X closes Eclipse ===<br />
<br />
Part of [https://bugs.eclipse.org/bugs/show_bug.cgi?id=318177 this] bug. Just look in {{ic|~/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi}} and delete the wrong {{ic|Ctrl+X}} combination. Usually it is the first one.<br />
<br />
=== Eclipse 4 not respecting dark/custom gtk themes resulting in white background ===<br />
<br />
====4.2.0 and 4.3.0====<br />
Remove or move to backup sub folder all of the .css files from:<br />
/usr/share/eclipse/plugins/org.eclipse.platform_4.2.0.v201206081400/css/<br />
<br />
Solution source: https://www.eclipse.org/forums/index.php/m/872214/<br />
<br />
This also works with version 4.3.x (Kepler) by backing up the css folder from /usr/share/eclipse/plugins/org.eclipse.platform_4.3.xxx/css/<br />
<br />
====4.4.0 (Luna)====<br />
<br />
Luna Supplies a Dark theme which can be enabled in Preferences > Appearance and selecting the 'Dark' theme.<br />
<br />
The dark theme uses its own colours rather than the GTK theme colours, if you prefer it to fully respect GTK colour settings, then remove or move to backup sub folder all of the .css files from: /usr/share/eclipse/plugins/org.eclipse.ui.themes_1.0.0.xxxx/css/<br />
<br />
=== Tooltips have dark background color with Gnome 3.6 Adwaita theme ===<br />
<br />
Comment out the second-to-last line in {{ic|/usr/share/themes/Adwaita/gtk-2.0/gtkrc}} like this<br />
<br />
#widget "gtk-tooltip*" style "tooltips"<br />
<br />
Related bugs: <br />
<br />
* https://bugzilla.gnome.org/show_bug.cgi?id=688285 <br />
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=381010 (WONTFIX)<br />
<br />
=== Toggle buttons states are the same for selected/not selected ===<br />
<br />
Comment out the last line in {{ic|/usr/share/themes/Adwaita/gtk-2.0/gtkrc}} like this<br />
<br />
#widget "*swt*toolbar*" style "null"<br />
<br />
To apply the fixed theme, use {{ic|gnome-tweak-tool}} to select a different theme and cycle back to Adwaita.<br />
<br />
Related bugs: <br />
<br />
* https://bugzilla.gnome.org/show_bug.cgi?id=687519<br />
<br />
=== Change Default Window Title Font Size ===<br />
<br />
You can't change the window title font size using the Eclipse preferences, you must edit the actual theme .css files. Note, that you will have to redo this when you upgrade eclipse.<br />
They are located under<br />
/usr/share/eclipse/plugins/org.eclipse.platform_4.3.<your version number>/css<br />
Open the appropriate file with your text editor, ie e4_default_gtk.css if you are using the "GTK theme".<br />
Search for .MPartStack, and change the font-size to your desired size<br />
.MPartStack {<br />
font-size: 9;<br />
swt-simple: false;<br />
swt-mru-visible: false;<br />
}<br />
<br />
== See also ==<br />
<br />
* [https://www.ibm.com/developerworks/library/os-ecl-subversion/ How to use Subversion with Eclipse]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Eclipse&diff=386234Eclipse2015-07-22T02:57:53Z<p>Sushi Dude: Recommend the use of the updated, Java 8, API.</p>
<hr />
<div>[[Category:Development]]<br />
[[it:Eclipse]]<br />
[[ja:Eclipse]]<br />
[[ru:Eclipse]]<br />
[[zh-CN:Eclipse]]<br />
[https://eclipse.org Eclipse] is an open source community project, which aims to provide a universal development platform. The Eclipse project is most widely known for its cross-platform integrated development environment (IDE). The Arch Linux packages (and this guide) relate specifically to the IDE.<br />
<br />
The Eclipse IDE is largely written in Java but can be used to develop applications in a number of languages, including Java, C/C++, PHP, Perl and Python. The IDE can also provide subversion support and task management.<br />
<br />
== Installation ==<br />
<br />
[[Pacman|Install]] the {{Pkg|eclipse-java}} package from the [[official repositories]].<br />
This base package has [[Java]] development support built in. Alternatively, {{Pkg|eclipse-cpp}} is meant for C++ development. For some reason, these two packages are in conflict, and you will have to decide the one you want to use.<br />
<br />
== Plugins ==<br />
<br />
Many plugins are easily installed using '''pacman''' (see [[Eclipse plugin package guidelines]] for further informations). This will also keep them up-to-date. Alternatively, you can choose either the [[#Eclipse Marketplace|Eclipse Marketplace]] or the internal [[#plugin manager|plugin manager]].<br />
<br />
=== Add the default update site ===<br />
<br />
Make sure that you check that the default update site for your version of Eclipse is configured so that plugin dependencies can automatically be installed. The most current version of Eclipse is Mars and the default update site for it is: http://download.eclipse.org/releases/mars. Go to Help > Install new Software > Add, fill the name to easily identify the update site later - for instance, Mars Software Repository - and fill the location with the url.<br />
<br />
=== Eclipse Marketplace ===<br />
<br />
{{Note|make sure you have followed the [[#Add the default update site|Add the default update site]] section.}}<br />
To use the Eclipse Marketplace, install it first: go to Help > Install new software > Switch to the default update site > General Purpose Tools > Marketplace Client. Restart Eclipse and it will be available in Help > Eclipse Marketplace.<br />
<br />
=== Plugin manager ===<br />
<br />
{{Note|make sure you have followed the [[#Add the default update site|Add the default update site]] section.}}<br />
Use Eclipse's plugin manager to download and install plugins from their original repositories: in this case you have to find the needed repository in the plugin's website, then go to ''Help > Install New Software...'', enter the repository in the ''Work with'' field, select the plugin to install from the list below and follow the instructions.<br />
<br />
{{Note|<br />
* If you install plugins with Eclipse's plugin manager, you are advised to launch Eclipse as root: this way the plugins will be installed in {{ic|/usr/lib/eclipse/plugins/}}; if you installed them as normal user, they would be stored in a version-dependent folder inside {{ic|~/.eclipse/}}, and, after upgrading Eclipse, they wouldn't be recognized any longer.<br />
* Do not use Eclipse as root for your everyday work.<br />
}}<br />
<br />
==== Updates via plugin manager ====<br />
<br />
Run Eclipse and select ''Help > Check for Updates''. If you have installed them as root as advised in the section above, you have to run Eclipse as root.<br />
<br />
For plugins to be updated, you should check to have their update repositories enabled in ''Window > Preferences > Install/Update > Available Software Sites'': you can find each plugin's repository(es) on the respective project website. To add, edit, remove... repositories just use the buttons on the right of the ''Available Software Sites'' panel. For Eclipse 4.5 (Mars), check you have enabled this repository:<br />
<br />
http://download.eclipse.org/releases/mars<br />
<br />
To receive update notifications, go to ''Window > Preferences > Install/Update > Automatic Updates''. If you want to receive notifications for plugins installed as root, you should run Eclipse as root, go to ''Window > Preferences > Install/Update > Available Software Sites'', select the repositories related to the installed plugins and ''Export'' them, then run Eclipse as normal user and ''Import'' them in the same panel.<br />
<br />
=== List of plugins ===<br />
<br />
* {{App|AVR|AVR microcontroller plugin.|http://avr-eclipse.sourceforge.net/wiki/index.php/The_AVR_Eclipse_Plugin|{{AUR|eclipse-avr}}}}<br />
* {{App|Aptana|HTML5/CSS3/JavaScript/Ruby/Rails/PHP/Pydev/Django support. Also available as standalone application.|http://www.aptana.com/|{{AUR|eclipse-aptana}} {{AUR|aptana-studio}}}}<br />
* {{App|Eclipse CDT|C/C++ support.|https://www.eclipse.org/cdt/|{{Pkg|eclipse-cpp}}}}<br />
* {{App|Eclipse PDT|[[PHP]] support.|https://www.eclipse.org/pdt/|{{AUR|eclipse-pdt}}}}<br />
* {{App|EclipseFP|[[Haskell]] support.|https://eclipsefp.github.io/|{{AUR|eclipse-eclipsefp}}}}<br />
* {{App|EGit|[[Git]] support.|https://www.eclipse.org/egit|{{AUR|eclipse-egit}}}}<br />
* {{App|EPIC|Perl support.|http://www.epic-ide.org/|{{AUR|eclipse-epic}}}}<br />
* {{App|IvyDE|IvyDE dependency Manager.|https://ant.apache.org/ivy/ivyde/|{{AUR|eclipse-ivyde}}}}<br />
* {{App|Markdown|Markdown editor plugin for Eclipse.|http://www.winterwell.com/software/markdown-editor.php|{{AUR|eclipse-markdown}}}}<br />
* {{App|MercurialEclipse|[[Mercurial]] support.|https://bitbucket.org/mercurialeclipse/main/wiki/Home|{{AUR|eclipse-mercurial}}}}<br />
* {{App|Mylyn|Task lists support.|https://www.eclipse.org/mylyn/|{{AUR|eclipse-mylyn}}}}<br />
* {{App|PHPEclipse|Alternative PHP support.|http://www.phpeclipse.com/|{{AUR|eclipse-phpeclipse}}}}<br />
* {{App|PyDev|[[Python]] support.|http://pydev.org/|{{AUR|eclipse-pydev}}}}<br />
* {{App|Subclipse|[[Subversion]] support.|http://subclipse.tigris.org/|{{AUR|eclipse-subclipse}}}}<br />
* {{App|Subversive|Alternative Subversion support.|https://www.eclipse.org/subversive/|{{AUR|eclipse-subversive}}}}<br />
* {{App|TestNG|TestNG support.|http://testng.org/doc/eclipse.html|{{AUR|eclipse-testng}}}}<br />
* {{App|TeXlipse|[[LaTeX]] support.|http://texlipse.sourceforge.net/|{{AUR|texlipse}}}}<br />
* {{App|Eclipse PTP|Parallel Programming C/C++ support.|https://www.eclipse.org/ptp/|{{AUR|eclipse-ptp}}}}<br />
<br />
== Enable javadoc integration ==<br />
<br />
Want to see API entries when hovering the mouse pointer over standard Java methods?<br />
<br />
=== Online version ===<br />
<br />
If you have constant Internet access on your machine, you can use the on-line documentation:<br />
<br />
# Go to ''Window > Preferences'', then go to ''Java > Installed JREs''.<br />
# There should be one named "java" with the type "Standard VM". Select this and click ''Edit''.<br />
# Select the {{ic|/opt/java/jre/lib/rt.jar}} item under "JRE system libraries:", then click ''Javadoc Location...''.<br />
# Enter "https://docs.oracle.com/javase/8/docs/api/" in the "Javadoc location path:" text field.<br />
<br />
=== Offline version ===<br />
<br />
You can store the documentation locally by installing the {{Pkg|openjdk8-doc}} package. Eclipse may be able to find the javadocs automatically. If that doesn't work, set Javadoc location for rt.jar to {{ic|file:/usr/share/doc/java8-openjdk/api}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Crash on first boot or when choosing ''Help > Welcome'' ===<br />
<br />
Add the following line to {{ic|/usr/share/eclipse/eclipse.ini}}:<br />
<br />
-Dorg.eclipse.swt.browser.UseWebKitGTK=true<br />
<br />
If Firefox is installed try also:<br />
<br />
-Dorg.eclipse.swt.browser.DefaultType=mozilla<br />
<br />
=== Ctrl+X closes Eclipse ===<br />
<br />
Part of [https://bugs.eclipse.org/bugs/show_bug.cgi?id=318177 this] bug. Just look in {{ic|~/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi}} and delete the wrong {{ic|Ctrl+X}} combination. Usually it is the first one.<br />
<br />
=== Eclipse 4 not respecting dark/custom gtk themes resulting in white background ===<br />
<br />
====4.2.0 and 4.3.0====<br />
Remove or move to backup sub folder all of the .css files from:<br />
/usr/share/eclipse/plugins/org.eclipse.platform_4.2.0.v201206081400/css/<br />
<br />
Solution source: https://www.eclipse.org/forums/index.php/m/872214/<br />
<br />
This also works with version 4.3.x (Kepler) by backing up the css folder from /usr/share/eclipse/plugins/org.eclipse.platform_4.3.xxx/css/<br />
<br />
====4.4.0 (Luna)====<br />
<br />
Luna Supplies a Dark theme which can be enabled in Preferences > Appearance and selecting the 'Dark' theme.<br />
<br />
The dark theme uses its own colours rather than the GTK theme colours, if you prefer it to fully respect GTK colour settings, then remove or move to backup sub folder all of the .css files from: /usr/share/eclipse/plugins/org.eclipse.ui.themes_1.0.0.xxxx/css/<br />
<br />
=== Tooltips have dark background color with Gnome 3.6 Adwaita theme ===<br />
<br />
Comment out the second-to-last line in {{ic|/usr/share/themes/Adwaita/gtk-2.0/gtkrc}} like this<br />
<br />
#widget "gtk-tooltip*" style "tooltips"<br />
<br />
Related bugs: <br />
<br />
* https://bugzilla.gnome.org/show_bug.cgi?id=688285 <br />
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=381010 (WONTFIX)<br />
<br />
=== Toggle buttons states are the same for selected/not selected ===<br />
<br />
Comment out the last line in {{ic|/usr/share/themes/Adwaita/gtk-2.0/gtkrc}} like this<br />
<br />
#widget "*swt*toolbar*" style "null"<br />
<br />
To apply the fixed theme, use {{ic|gnome-tweak-tool}} to select a different theme and cycle back to Adwaita.<br />
<br />
Related bugs: <br />
<br />
* https://bugzilla.gnome.org/show_bug.cgi?id=687519<br />
<br />
=== Change Default Window Title Font Size ===<br />
<br />
You can't change the window title font size using the Eclipse preferences, you must edit the actual theme .css files. Note, that you will have to redo this when you upgrade eclipse.<br />
They are located under<br />
/usr/share/eclipse/plugins/org.eclipse.platform_4.3.<your version number>/css<br />
Open the appropriate file with your text editor, ie e4_default_gtk.css if you are using the "GTK theme".<br />
Search for .MPartStack, and change the font-size to your desired size<br />
.MPartStack {<br />
font-size: 9;<br />
swt-simple: false;<br />
swt-mru-visible: false;<br />
}<br />
<br />
== See also ==<br />
<br />
* [https://www.ibm.com/developerworks/library/os-ecl-subversion/ How to use Subversion with Eclipse]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Eclipse&diff=386233Eclipse2015-07-22T02:54:07Z<p>Sushi Dude: Switched links to HTTPS where possible. Fixed a broken link.</p>
<hr />
<div>[[Category:Development]]<br />
[[it:Eclipse]]<br />
[[ja:Eclipse]]<br />
[[ru:Eclipse]]<br />
[[zh-CN:Eclipse]]<br />
[https://eclipse.org Eclipse] is an open source community project, which aims to provide a universal development platform. The Eclipse project is most widely known for its cross-platform integrated development environment (IDE). The Arch Linux packages (and this guide) relate specifically to the IDE.<br />
<br />
The Eclipse IDE is largely written in Java but can be used to develop applications in a number of languages, including Java, C/C++, PHP, Perl and Python. The IDE can also provide subversion support and task management.<br />
<br />
== Installation ==<br />
<br />
[[Pacman|Install]] the {{Pkg|eclipse-java}} package from the [[official repositories]].<br />
This base package has [[Java]] development support built in. Alternatively, {{Pkg|eclipse-cpp}} is meant for C++ development. For some reason, these two packages are in conflict, and you will have to decide the one you want to use.<br />
<br />
== Plugins ==<br />
<br />
Many plugins are easily installed using '''pacman''' (see [[Eclipse plugin package guidelines]] for further informations). This will also keep them up-to-date. Alternatively, you can choose either the [[#Eclipse Marketplace|Eclipse Marketplace]] or the internal [[#plugin manager|plugin manager]].<br />
<br />
=== Add the default update site ===<br />
<br />
Make sure that you check that the default update site for your version of Eclipse is configured so that plugin dependencies can automatically be installed. The most current version of Eclipse is Mars and the default update site for it is: http://download.eclipse.org/releases/mars. Go to Help > Install new Software > Add, fill the name to easily identify the update site later - for instance, Mars Software Repository - and fill the location with the url.<br />
<br />
=== Eclipse Marketplace ===<br />
<br />
{{Note|make sure you have followed the [[#Add the default update site|Add the default update site]] section.}}<br />
To use the Eclipse Marketplace, install it first: go to Help > Install new software > Switch to the default update site > General Purpose Tools > Marketplace Client. Restart Eclipse and it will be available in Help > Eclipse Marketplace.<br />
<br />
=== Plugin manager ===<br />
<br />
{{Note|make sure you have followed the [[#Add the default update site|Add the default update site]] section.}}<br />
Use Eclipse's plugin manager to download and install plugins from their original repositories: in this case you have to find the needed repository in the plugin's website, then go to ''Help > Install New Software...'', enter the repository in the ''Work with'' field, select the plugin to install from the list below and follow the instructions.<br />
<br />
{{Note|<br />
* If you install plugins with Eclipse's plugin manager, you are advised to launch Eclipse as root: this way the plugins will be installed in {{ic|/usr/lib/eclipse/plugins/}}; if you installed them as normal user, they would be stored in a version-dependent folder inside {{ic|~/.eclipse/}}, and, after upgrading Eclipse, they wouldn't be recognized any longer.<br />
* Do not use Eclipse as root for your everyday work.<br />
}}<br />
<br />
==== Updates via plugin manager ====<br />
<br />
Run Eclipse and select ''Help > Check for Updates''. If you have installed them as root as advised in the section above, you have to run Eclipse as root.<br />
<br />
For plugins to be updated, you should check to have their update repositories enabled in ''Window > Preferences > Install/Update > Available Software Sites'': you can find each plugin's repository(es) on the respective project website. To add, edit, remove... repositories just use the buttons on the right of the ''Available Software Sites'' panel. For Eclipse 4.5 (Mars), check you have enabled this repository:<br />
<br />
http://download.eclipse.org/releases/mars<br />
<br />
To receive update notifications, go to ''Window > Preferences > Install/Update > Automatic Updates''. If you want to receive notifications for plugins installed as root, you should run Eclipse as root, go to ''Window > Preferences > Install/Update > Available Software Sites'', select the repositories related to the installed plugins and ''Export'' them, then run Eclipse as normal user and ''Import'' them in the same panel.<br />
<br />
=== List of plugins ===<br />
<br />
* {{App|AVR|AVR microcontroller plugin.|http://avr-eclipse.sourceforge.net/wiki/index.php/The_AVR_Eclipse_Plugin|{{AUR|eclipse-avr}}}}<br />
* {{App|Aptana|HTML5/CSS3/JavaScript/Ruby/Rails/PHP/Pydev/Django support. Also available as standalone application.|http://www.aptana.com/|{{AUR|eclipse-aptana}} {{AUR|aptana-studio}}}}<br />
* {{App|Eclipse CDT|C/C++ support.|https://www.eclipse.org/cdt/|{{Pkg|eclipse-cpp}}}}<br />
* {{App|Eclipse PDT|[[PHP]] support.|https://www.eclipse.org/pdt/|{{AUR|eclipse-pdt}}}}<br />
* {{App|EclipseFP|[[Haskell]] support.|https://eclipsefp.github.io/|{{AUR|eclipse-eclipsefp}}}}<br />
* {{App|EGit|[[Git]] support.|https://www.eclipse.org/egit|{{AUR|eclipse-egit}}}}<br />
* {{App|EPIC|Perl support.|http://www.epic-ide.org/|{{AUR|eclipse-epic}}}}<br />
* {{App|IvyDE|IvyDE dependency Manager.|https://ant.apache.org/ivy/ivyde/|{{AUR|eclipse-ivyde}}}}<br />
* {{App|Markdown|Markdown editor plugin for Eclipse.|http://www.winterwell.com/software/markdown-editor.php|{{AUR|eclipse-markdown}}}}<br />
* {{App|MercurialEclipse|[[Mercurial]] support.|https://bitbucket.org/mercurialeclipse/main/wiki/Home|{{AUR|eclipse-mercurial}}}}<br />
* {{App|Mylyn|Task lists support.|https://www.eclipse.org/mylyn/|{{AUR|eclipse-mylyn}}}}<br />
* {{App|PHPEclipse|Alternative PHP support.|http://www.phpeclipse.com/|{{AUR|eclipse-phpeclipse}}}}<br />
* {{App|PyDev|[[Python]] support.|http://pydev.org/|{{AUR|eclipse-pydev}}}}<br />
* {{App|Subclipse|[[Subversion]] support.|http://subclipse.tigris.org/|{{AUR|eclipse-subclipse}}}}<br />
* {{App|Subversive|Alternative Subversion support.|https://www.eclipse.org/subversive/|{{AUR|eclipse-subversive}}}}<br />
* {{App|TestNG|TestNG support.|http://testng.org/doc/eclipse.html|{{AUR|eclipse-testng}}}}<br />
* {{App|TeXlipse|[[LaTeX]] support.|http://texlipse.sourceforge.net/|{{AUR|texlipse}}}}<br />
* {{App|Eclipse PTP|Parallel Programming C/C++ support.|https://www.eclipse.org/ptp/|{{AUR|eclipse-ptp}}}}<br />
<br />
== Enable javadoc integration ==<br />
<br />
Want to see API entries when hovering the mouse pointer over standard Java methods?<br />
<br />
=== Online version ===<br />
<br />
If you have constant Internet access on your machine, you can use the on-line documentation:<br />
<br />
# Go to ''Window > Preferences'', then go to ''Java > Installed JREs''.<br />
# There should be one named "java" with the type "Standard VM". Select this and click ''Edit''.<br />
# Select the {{ic|/opt/java/jre/lib/rt.jar}} item under "JRE system libraries:", then click ''Javadoc Location...''.<br />
# Enter "https://docs.oracle.com/javase/7/docs/api/" in the "Javadoc location path:" text field.<br />
<br />
=== Offline version ===<br />
<br />
You can store the documentation locally by installing the {{Pkg|openjdk8-doc}} package. Eclipse may be able to find the javadocs automatically. If that doesn't work, set Javadoc location for rt.jar to {{ic|file:/usr/share/doc/java8-openjdk/api}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Crash on first boot or when choosing ''Help > Welcome'' ===<br />
<br />
Add the following line to {{ic|/usr/share/eclipse/eclipse.ini}}:<br />
<br />
-Dorg.eclipse.swt.browser.UseWebKitGTK=true<br />
<br />
If Firefox is installed try also:<br />
<br />
-Dorg.eclipse.swt.browser.DefaultType=mozilla<br />
<br />
=== Ctrl+X closes Eclipse ===<br />
<br />
Part of [https://bugs.eclipse.org/bugs/show_bug.cgi?id=318177 this] bug. Just look in {{ic|~/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi}} and delete the wrong {{ic|Ctrl+X}} combination. Usually it is the first one.<br />
<br />
=== Eclipse 4 not respecting dark/custom gtk themes resulting in white background ===<br />
<br />
====4.2.0 and 4.3.0====<br />
Remove or move to backup sub folder all of the .css files from:<br />
/usr/share/eclipse/plugins/org.eclipse.platform_4.2.0.v201206081400/css/<br />
<br />
Solution source: https://www.eclipse.org/forums/index.php/m/872214/<br />
<br />
This also works with version 4.3.x (Kepler) by backing up the css folder from /usr/share/eclipse/plugins/org.eclipse.platform_4.3.xxx/css/<br />
<br />
====4.4.0 (Luna)====<br />
<br />
Luna Supplies a Dark theme which can be enabled in Preferences > Appearance and selecting the 'Dark' theme.<br />
<br />
The dark theme uses its own colours rather than the GTK theme colours, if you prefer it to fully respect GTK colour settings, then remove or move to backup sub folder all of the .css files from: /usr/share/eclipse/plugins/org.eclipse.ui.themes_1.0.0.xxxx/css/<br />
<br />
=== Tooltips have dark background color with Gnome 3.6 Adwaita theme ===<br />
<br />
Comment out the second-to-last line in {{ic|/usr/share/themes/Adwaita/gtk-2.0/gtkrc}} like this<br />
<br />
#widget "gtk-tooltip*" style "tooltips"<br />
<br />
Related bugs: <br />
<br />
* https://bugzilla.gnome.org/show_bug.cgi?id=688285 <br />
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=381010 (WONTFIX)<br />
<br />
=== Toggle buttons states are the same for selected/not selected ===<br />
<br />
Comment out the last line in {{ic|/usr/share/themes/Adwaita/gtk-2.0/gtkrc}} like this<br />
<br />
#widget "*swt*toolbar*" style "null"<br />
<br />
To apply the fixed theme, use {{ic|gnome-tweak-tool}} to select a different theme and cycle back to Adwaita.<br />
<br />
Related bugs: <br />
<br />
* https://bugzilla.gnome.org/show_bug.cgi?id=687519<br />
<br />
=== Change Default Window Title Font Size ===<br />
<br />
You can't change the window title font size using the Eclipse preferences, you must edit the actual theme .css files. Note, that you will have to redo this when you upgrade eclipse.<br />
They are located under<br />
/usr/share/eclipse/plugins/org.eclipse.platform_4.3.<your version number>/css<br />
Open the appropriate file with your text editor, ie e4_default_gtk.css if you are using the "GTK theme".<br />
Search for .MPartStack, and change the font-size to your desired size<br />
.MPartStack {<br />
font-size: 9;<br />
swt-simple: false;<br />
swt-mru-visible: false;<br />
}<br />
<br />
== See also ==<br />
<br />
* [https://www.ibm.com/developerworks/library/os-ecl-subversion/ How to use Subversion with Eclipse]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Eclipse_plugin_package_guidelines&diff=355831Eclipse plugin package guidelines2015-01-08T02:59:16Z<p>Sushi Dude: /* Sample PKGBUILD */ Replaced spaces used for indentation with tabs. See https://wiki.archlinux.org/index.php/DeveloperWiki:Bash_Coding_Style</p>
<hr />
<div>[[Category:Package development]]<br />
[[it:Eclipse Plugin Package Guidelines]]<br />
{{Package Guidelines}}<br />
<br />
There are many ways to install working [[Eclipse]] plugins, especially since the introduction of the ''dropins'' directory in Eclipse 3.4, but some of them are messy, and having a standardized and consistent way of packaging is very important to lead to a clean system structure. It's not easy, however, to achieve this without the packager knowing every detail about how Eclipse plugins work. This page aims to define a standard and simple structure for Eclipse plugin [[PKGBUILD]]s, so that the filesystem structure can remain consistent between all plugins without having the packager to start again for every new package.<br />
<br />
== Eclipse plugin structure and installation ==<br />
The typical Eclipse plugin contains two directories, {{ic|features}} and {{ic|plugins}}, and since Eclipse 3.3 they could only be placed in {{ic|/usr/share/eclipse/}}. The content of these two directories could be mixed with that of other plugins, and it created a mess and rendered the structure difficult to manage. It was also very difficult to tell at a glance which package contained which file.<br />
<br />
This installation method is still supported in Eclipse 3.4, but the preferred one is now using the {{ic|/usr/share/eclipse/dropins/}} directory. Inside this directory can live an unlimited number of subdirectories, each one containing its own {{ic|features}} and {{ic|plugins}} subdirectories. This allows to keep a tidy and clean structure, and should be the standard packaging way.<br />
<br />
== Packaging ==<br />
<br />
=== Sample PKGBUILD ===<br />
Here is an example, we will detail how to customize it below.<br />
<br />
{{hc|PKGBUILD-eclipse.proto|<nowiki><br />
pkgname=eclipse-mylyn<br />
pkgver=3.0.3<br />
pkgrel=1<br />
pkgdesc="A task-focused interface for Eclipse"<br />
arch=('i686' 'x86_64')<br />
url="http://www.eclipse.org/mylyn/"<br />
license=('EPL')<br />
depends=('eclipse')<br />
optdepends=('bugzilla: ticketing support')<br />
source=(http://download.eclipse.org/tools/mylyn/update/mylyn-${pkgver}-e3.4.zip)<br />
md5sums=('e98cd7ab3c5d5aeb7c32845844f85c22')<br />
<br />
prepare() {<br />
# remove features and plug-ins containing sources<br />
rm features/*.source_*<br />
rm plugins/*.source_*<br />
# remove gz files<br />
rm plugins/*.pack.gz<br />
}<br />
<br />
package() {<br />
_dest=${pkgdir}/usr/share/eclipse/dropins/${pkgname/eclipse-}/eclipse<br />
<br />
# Features<br />
find features -type f | while read _feature ; do<br />
if [[ ${_feature} =~ (.*\.jar$) ]] ; then<br />
install -dm755 ${_dest}/${_feature%*.jar}<br />
cd ${_dest}/${_feature/.jar}<br />
# extract features (otherwise they are not visible in about dialog)<br />
jar xf ${srcdir}/${_feature} || return 1<br />
else<br />
install -Dm644 ${_feature} ${_dest}/${_feature}<br />
fi<br />
done<br />
<br />
# Plugins<br />
find plugins -type f | while read _plugin ; do<br />
install -Dm644 "${_plugin}" "${_dest}/${_plugin}"<br />
done<br />
}<br />
</nowiki>}}<br />
<br />
=== How to customize the build ===<br />
The main variable which needs to be customized is the {{Ic|pkgname}}. If you are packaging a typical plugin, then this is the only thing you need to do: most plugins are distributed in zip files which only contain the two {{ic|features}} and {{ic|plugins}} subdirectories. So, if you are packaging the {{Ic|foo}} plugin and the source file only contains the {{ic|features}} and {{ic|plugins}}, you just need to change {{Ic|pkgname}} to {{Ic|eclipse-foo}} and you are set.<br />
<br />
Read on to get to the internals of the PKGBUILD, which help to understand how to setup the build for all the other cases.<br />
<br />
=== In-depth PKGBUILD review ===<br />
<br />
==== Package naming ====<br />
Packages should be named {{Ic|eclipse-''pluginname''}}, so that they are recognizable as Eclipse-related packages and it is easy to extract the plugin name with a simple shell substitution like {{Ic|<nowiki>${pkgname/eclipse-}</nowiki>}}, not having to resort to an unneeded {{Ic|<nowiki>${_realname}</nowiki>}} variable. The plugin name is necessary to tidy up everything during installation and to avoid conflicts.<br />
<br />
==== Files ====<br />
<br />
===== Extraction =====<br />
Some plugins need the features to be extracted from jar files. The {{Ic|jar}} utility, already included in the JRE, is used to do this. However, {{Ic|jar}} cannot extract to directories other than the current one: this means that, after every directory creation, it is necessary to {{Ic|cd}} inside it before extracting. The {{Ic|<nowiki>${_dest}</nowiki>}} variable is used in this context to improve readability and PKGBUILD tidiness.<br />
<br />
===== Locations =====<br />
As we said, source archives provide two directories, {{ic|features}} and {{ic|plugins}}, each one packed up with jar files. The preferred dropins structure should look like this:<br />
<br />
/usr/share/eclipse/dropins/pluginname/eclipse/features/feature1/...<br />
/usr/share/eclipse/dropins/pluginname/eclipse/features/feature2/...<br />
/usr/share/eclipse/dropins/pluginname/eclipse/plugins/plugin1.jar<br />
/usr/share/eclipse/dropins/pluginname/eclipse/plugins/plugin2.jar<br />
<br />
This structure allows for mixing different versions of libraries that may be needed by different plugins while being clear about which package owns what. It will also avoid conflicts in case different packages provide the same library. The only alternative would be splitting every package from its libraries, with all the extra fuss it requires, and it would not even be guaranteed to work because of packages needing older library versions.<br />
Features have to be unjarred since Eclipse will not detect them otherwise, and the whole plugin installation will not work. This happens because Eclipse treats update sites and local installations differently (do not ask why, it just does).<br />
<br />
==== The build() function ====<br />
First thing to be noticed is the {{Ic|<nowiki>cd ${srcdir}</nowiki>}} command. Usually source archives extract the {{ic|features}} and {{ic|plugins}} folders directly under {{Ic|<nowiki>${srcdir}</nowiki>}}, but this is not always the case. Anyway, for most non-''(de facto)''-standard plugins this is the only line that needs to be changed.<br />
<br />
Some released features include their sources, too. For a normal release version these sources are not needed and can be removed. Furthermore same features include {{Ic|*.pack.gz}} files, which contain the same files compared to the jar archives. So these files can be removed, too.<br />
<br />
Next is the {{Ic|features}} section. It creates the necessary directories, one for every jar file, and extracts the jar in the corresponding directory. Similarly, the {{Ic|plugins}} section installs the jar files in their directory. A while cycle is used to prevent funny-named files.</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Eclipse_plugin_package_guidelines&diff=354872Eclipse plugin package guidelines2015-01-01T21:04:52Z<p>Sushi Dude: /* Sample PKGBUILD */ Added double quotes around plugin install parameters as there are many scenarios where not having them will cause issues.</p>
<hr />
<div>[[Category:Package development]]<br />
[[it:Eclipse Plugin Package Guidelines]]<br />
{{Package Guidelines}}<br />
<br />
There are many ways to install working [[Eclipse]] plugins, especially since the introduction of the ''dropins'' directory in Eclipse 3.4, but some of them are messy, and having a standardized and consistent way of packaging is very important to lead to a clean system structure. It's not easy, however, to achieve this without the packager knowing every detail about how Eclipse plugins work. This page aims to define a standard and simple structure for Eclipse plugin [[PKGBUILD]]s, so that the filesystem structure can remain consistent between all plugins without having the packager to start again for every new package.<br />
<br />
== Eclipse plugin structure and installation ==<br />
The typical Eclipse plugin contains two directories, {{ic|features}} and {{ic|plugins}}, and since Eclipse 3.3 they could only be placed in {{ic|/usr/share/eclipse/}}. The content of these two directories could be mixed with that of other plugins, and it created a mess and rendered the structure difficult to manage. It was also very difficult to tell at a glance which package contained which file.<br />
<br />
This installation method is still supported in Eclipse 3.4, but the preferred one is now using the {{ic|/usr/share/eclipse/dropins/}} directory. Inside this directory can live an unlimited number of subdirectories, each one containing its own {{ic|features}} and {{ic|plugins}} subdirectories. This allows to keep a tidy and clean structure, and should be the standard packaging way.<br />
<br />
== Packaging ==<br />
<br />
=== Sample PKGBUILD ===<br />
Here is an example, we will detail how to customize it below.<br />
<br />
{{hc|PKGBUILD-eclipse.proto|<nowiki><br />
pkgname=eclipse-mylyn<br />
pkgver=3.0.3<br />
pkgrel=1<br />
pkgdesc="A task-focused interface for Eclipse"<br />
arch=('i686' 'x86_64')<br />
url="http://www.eclipse.org/mylyn/"<br />
license=('EPL')<br />
depends=('eclipse')<br />
optdepends=('bugzilla: ticketing support')<br />
source=(http://download.eclipse.org/tools/mylyn/update/mylyn-${pkgver}-e3.4.zip)<br />
md5sums=('e98cd7ab3c5d5aeb7c32845844f85c22')<br />
<br />
prepare() {<br />
# remove features and plug-ins containing sources<br />
rm features/*.source_*<br />
rm plugins/*.source_*<br />
# remove gz files<br />
rm plugins/*.pack.gz<br />
}<br />
<br />
package() {<br />
_dest=${pkgdir}/usr/share/eclipse/dropins/${pkgname/eclipse-}/eclipse<br />
<br />
# Features<br />
find features -type f | while read _feature ; do<br />
if [[ ${_feature} =~ (.*\.jar$) ]] ; then<br />
install -dm755 ${_dest}/${_feature%*.jar}<br />
cd ${_dest}/${_feature/.jar}<br />
# extract features (otherwise they are not visible in about dialog)<br />
jar xf ${srcdir}/${_feature} || return 1<br />
else<br />
install -Dm644 ${_feature} ${_dest}/${_feature}<br />
fi<br />
done<br />
<br />
# Plugins<br />
find plugins -type f | while read _plugin ; do<br />
install -Dm644 "${_plugin}" "${_dest}/${_plugin}"<br />
done<br />
}<br />
</nowiki>}}<br />
<br />
=== How to customize the build ===<br />
The main variable which needs to be customized is the {{Ic|pkgname}}. If you are packaging a typical plugin, then this is the only thing you need to do: most plugins are distributed in zip files which only contain the two {{ic|features}} and {{ic|plugins}} subdirectories. So, if you are packaging the {{Ic|foo}} plugin and the source file only contains the {{ic|features}} and {{ic|plugins}}, you just need to change {{Ic|pkgname}} to {{Ic|eclipse-foo}} and you are set.<br />
<br />
Read on to get to the internals of the PKGBUILD, which help to understand how to setup the build for all the other cases.<br />
<br />
=== In-depth PKGBUILD review ===<br />
<br />
==== Package naming ====<br />
Packages should be named {{Ic|eclipse-''pluginname''}}, so that they are recognizable as Eclipse-related packages and it is easy to extract the plugin name with a simple shell substitution like {{Ic|<nowiki>${pkgname/eclipse-}</nowiki>}}, not having to resort to an unneeded {{Ic|<nowiki>${_realname}</nowiki>}} variable. The plugin name is necessary to tidy up everything during installation and to avoid conflicts.<br />
<br />
==== Files ====<br />
<br />
===== Extraction =====<br />
Some plugins need the features to be extracted from jar files. The {{Ic|jar}} utility, already included in the JRE, is used to do this. However, {{Ic|jar}} cannot extract to directories other than the current one: this means that, after every directory creation, it is necessary to {{Ic|cd}} inside it before extracting. The {{Ic|<nowiki>${_dest}</nowiki>}} variable is used in this context to improve readability and PKGBUILD tidiness.<br />
<br />
===== Locations =====<br />
As we said, source archives provide two directories, {{ic|features}} and {{ic|plugins}}, each one packed up with jar files. The preferred dropins structure should look like this:<br />
<br />
/usr/share/eclipse/dropins/pluginname/eclipse/features/feature1/...<br />
/usr/share/eclipse/dropins/pluginname/eclipse/features/feature2/...<br />
/usr/share/eclipse/dropins/pluginname/eclipse/plugins/plugin1.jar<br />
/usr/share/eclipse/dropins/pluginname/eclipse/plugins/plugin2.jar<br />
<br />
This structure allows for mixing different versions of libraries that may be needed by different plugins while being clear about which package owns what. It will also avoid conflicts in case different packages provide the same library. The only alternative would be splitting every package from its libraries, with all the extra fuss it requires, and it would not even be guaranteed to work because of packages needing older library versions.<br />
Features have to be unjarred since Eclipse will not detect them otherwise, and the whole plugin installation will not work. This happens because Eclipse treats update sites and local installations differently (do not ask why, it just does).<br />
<br />
==== The build() function ====<br />
First thing to be noticed is the {{Ic|<nowiki>cd ${srcdir}</nowiki>}} command. Usually source archives extract the {{ic|features}} and {{ic|plugins}} folders directly under {{Ic|<nowiki>${srcdir}</nowiki>}}, but this is not always the case. Anyway, for most non-''(de facto)''-standard plugins this is the only line that needs to be changed.<br />
<br />
Some released features include their sources, too. For a normal release version these sources are not needed and can be removed. Furthermore same features include {{Ic|*.pack.gz}} files, which contain the same files compared to the jar archives. So these files can be removed, too.<br />
<br />
Next is the {{Ic|features}} section. It creates the necessary directories, one for every jar file, and extracts the jar in the corresponding directory. Similarly, the {{Ic|plugins}} section installs the jar files in their directory. A while cycle is used to prevent funny-named files.</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=GNOME/Files&diff=340468GNOME/Files2014-10-18T05:58:33Z<p>Sushi Dude: /* Nautilus is no longer the default file manager */ The desktop file for Nautilus has been renamed.</p>
<hr />
<div>[[Category: File managers]]<br />
[[Category: GNOME]]<br />
[[ar:Nautilus]]<br />
[[es:Nautilus]]<br />
{{Related articles start}}<br />
{{Related|GNOME}}<br />
{{Related|File manager functionality}}<br />
{{Related|Nemo}}<br />
{{Related|Thunar}}<br />
{{Related|PCManFM}}<br />
{{Related articles end}}<br />
<br />
[http://live.gnome.org/Nautilus Nautilus] is the default file manager for [https://live.gnome.org/ GNOME]. <br />
<br />
The Nautilus file manager provides a simple and integrated way to manage your files and applications. You can use the file manager to do the following:<br />
<br />
* Create folders and documents<br />
* Display your files and folders<br />
* Search and manage your files<br />
* Run scripts and launch applications<br />
* Customize the appearance of files and folders<br />
* Open special locations on your computer<br />
* Write data to a CD or DVD<br />
* Install and remove fonts<br />
<br />
== Installation ==<br />
<br />
[[Pacman|Install]] {{Pkg|nautilus}} from the [[official repositories]]. Nautilus is part of the {{Grp|gnome}} group.<br />
<br />
{{Note|Nautilus does not depend on the {{Pkg|gnome-shell}} package, but it does require {{Pkg|gnome-desktop}}.}}<br />
<br />
* [[Pacman|Install]] package {{Pkg|gvfs-smb}} from the [[Official repositories]] for Windows network shares<br />
* [[Pacman|Install]] package {{Pkg|gvfs-afp}} and {{Pkg|avahi}} from the [[Official repositories]] for accessing apple network shares. In addition to installing [[Avahi]], it must be [[systemd#Using units|enabled]] too.<br />
<br />
== Configuration ==<br />
<br />
Nautilus is simple to configure graphically, but not all options are available in the preferences menu. More options are available with ''dconf-editor'' under {{ic|org.gnome.nautilus}}.<br />
<br />
=== Desktop Management ===<br />
<br />
Nautilus, by default, no longer controls the background/desktop in gnome-shell. If you need icons on your desktop you can easily configure nautilus to handle the desktop.<br />
<br />
In {{Pkg|gnome-tweak-tool}}, choose: ''Desktop > Icons on Desktop > ON''. You may have to restart nautilus by running {{ic|killall nautilus; nautilus}} or if you are running [[Gnome]], press {{ic|ALT+F2}}, type {{ic|r}}, and press {{ic|Enter}}. <br />
<br />
Alternatively you can use {{ic|dconf-editor}} to change the same setting. Expand {{ic|org > gnome > desktop}} and click on ''background''. Tick the option labelled ''show-desktop-icons''.<br />
<br />
{{Note|Nautilus will manage the desktop when using the ''GNOME Classic'' session.}}<br />
<br />
=== Change default item view ===<br />
<br />
You can change the default view for the items by setting the {{ic|default-folder-viewer}} variable, e.g. for the list view:<br />
<br />
$ gsettings set org.gnome.nautilus.preferences default-folder-viewer 'list-view'<br />
<br />
=== Remove folders from the places sidebar ===<br />
<br />
The displayed folders are specified in {{ic|~/.config/user-dirs.dirs}} and can be altered with any editor. An execution of {{ic|xdg-user-dirs-update}} will change them again, thus it may be advisable to set the file permissions to read-only.<br />
<br />
=== Always show text-entry location ===<br />
<br />
The standard Nautilus toolbar shows a button bar interface for path navigation. To enter path locations using the ''keyboard'', you must expose the location text-entry field. This is done by pressing {{ic|Ctrl+l}}<br />
<br />
To make the location text-entry field always present, use gsettings as shown. <br />
<br />
$ gsettings set org.gnome.nautilus.preferences always-use-location-entry true<br />
<br />
{{Note|After changing this setting, you will not be able to expose the button bar. Only when the setting is '''false''' can both forms of location navigation be employed.}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Plugins ===<br />
<br />
Some programs can add extra functionality to Nautilus. Here are a few packages in the official repositories that do just that.<br />
<br />
* {{App|Nautilus Actions|Configures programs to be launched when files are selected in Nautilus|http://www.nautilus-actions.org/|{{Pkg|nautilus-actions}}}}<br />
* {{App|Nautilus Terminal|Terminal embedded in Nautilus. It is always open in the current folder, and follows the navigation.|http://projects.flogisoft.com/nautilus-terminal/|{{Pkg|nautilus-terminal}}}}<br />
* {{App|Open in Terminal|A nautilus plugin for opening terminals in arbitrary local paths|http://ftp.gnome.org/pub/GNOME/sources/nautilus-open-terminal|{{Pkg|nautilus-open-terminal}}}}<br />
{{Tip|This plugin is not needed if you have {{Pkg|gnome-terminal}} installed: since version 3.10.0-2 it provides the extension {{ic|/usr/lib/nautilus/extensions-3.0/libterminal-nautilus.so}} which creates an entry in Nautilus' context menu for opening the selected directory in a new terminal (see [[https://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/gnome-terminal&id=b143484f73a75663abacb69435fd663c348861d2 commit]]).}} <br />
* {{App|Send to Menu|Nautilus context menu for sending files.|http://download.gnome.org/sources/nautilus-sendto/|{{Pkg|nautilus-sendto}}}}<br />
* {{App|Seahorse Nautilus|PGP encryption and signing for nautilus|http://git.gnome.org/browse/seahorse-nautilus/|{{Pkg|seahorse-nautilus}}}}<br />
<br />
=== Thumbnails for videos ===<br />
<br />
Install {{Pkg|ffmpegthumbnailer}}.<br />
<br />
=== Create an empty document in Nautilus 3.6 and above ===<br />
<br />
Gnome 3.6 brought changes to Nautilus. The option to create an empty document has been removed from the right-click menu in Nautilus. To get this option back one has to create a {{ic|~/Templates/}} folder in your home folder and place an empty file inside the folder through your favourite Terminal by {{ic|touch ~/Templates/new<br />
}} or by using any other file manager. Then just restart Nautilus.<br />
<br />
On non-English installations, the templates directory might have another name. One can find the actual directory with {{ic|xdg-user-dir TEMPLATES}}.<br />
<br />
=== Use delete key to move to trash in Nautilus 3.6 and above ===<br />
<br />
By default Nautilus no longer uses the delete key to move files to trash. To revert this, use:<br />
<br />
{{hc|~/.config/nautilus/accels|<br />
''<s>; (gtk_accel_path "<Actions>/DirViewActions/Trash" "<Primary>Delete")</s>''<br />
(gtk_accel_path "<Actions>/DirViewActions/Trash" "Delete")<br />
}}<br />
<br />
And restart Nautilus with:<br />
<br />
$ nautilus -q<br />
<br />
== Troubleshooting ==<br />
<br />
=== Nautilus is no longer the default file manager ===<br />
{{Merge|GNOME#File_browser.2Freplace_Files|}}<br />
<br />
If Nautilus is not recognised as the default file manager, set Nautilus as default handler for the mime type ''inode/directory'':<br />
<br />
$ xdg-mime default org.gnome.Nautilus.desktop inode/directory<br />
<br />
..which will generate:<br />
<br />
{{hc|~/.local/share/applications/mimeapps.list|2=<br />
[Default Applications]<br />
inode/directory=org.gnome.Nautilus.desktop<br />
}}<br />
<br />
{{tip|If you want the change to be systemwide run the command above as root or create a {{ic|mimeapps.list}} file in {{ic|/usr/share/applications}} and add the line there instead.}}<br />
<br />
=== Sort before files does not work ===<br />
<br />
Setting "Sort folders before files" does not have the desired effect in Nautilus 3.12. [http://gexperts.com/wp/?p=25] To set it manually, issue:<br />
<br />
$ gsettings set org.gnome.nautilus.preferences sort-directories-first true<br />
$ gsettings set org.gtk.Settings.FileChooser sort-directories-first true</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Linux-ck&diff=326075Linux-ck2014-07-21T18:52:15Z<p>Sushi Dude: /* Running Virtualbox with Linux-ck */ Fixed broken link; virtualbox-ck-modules was merged into virtualbox-ck-host-modules. Elaborated on recommendation. Various minor formatting changes.</p>
<hr />
<div>[[Category:Kernel]]<br />
[[ru:Linux-ck]]<br />
[[zh-CN:Linux-ck]]<br />
{{Related articles start}}<br />
{{Related|Linux-ck/Changelog}}<br />
{{Related|Repo-ck}}<br />
{{Related|Modprobed-db}}<br />
{{Related articles end}}<br />
<br />
== General package details ==<br />
<br />
{{AUR|Linux-ck}} is a package available in the [[AUR]] and in the [[#2._Use_Pre-Compiled_Packages|unofficial linux-ck repo]] that allows users to run a kernel/headers setup patched with Con Kolivas' ck1 patchset, including the Brain Fuck Scheduler (BFS). Many Archers elect to use this package for the BFS' excellent desktop interactivity and responsiveness under any load situation. Additionally, the bfs imparts performance gains beyond interactivity. For example, see: [http://repo-ck.com/bench/cpu_schedulers_compared.pdf CPU_Schedulers_Compared.pdf].<br />
<br />
=== Release cycle ===<br />
<br />
Linux-ck roughly follows the release cycle of the official ARCH kernel. The following are requirements for its release:<br />
<br />
* Upstream code<br />
* CK's Patchset<br />
* BFQ Patchset<br />
* ARCH config/config.x86_64 sets for major version jumps only<br />
<br />
=== Package defaults ===<br />
<br />
There are '''three''' modifications to the config files:<br />
# The options that the ck patchset enable/disable.<br />
# The options that the BFQ patchset need to compile without user interaction.<br />
# Apply [https://github.com/graysky2/kernel_gcc_patch GCC patch] that enables additional CPU optimizations at compile time (these options are not part of the standard linux-ck package and are only available when the user compiles custom options).<br />
<br />
'''All other options are set to the ARCH defaults outlined in the main kernel's config files.''' Users are of course free to modify them! The linux-ck package contains an option to switch on the '''nconfig''' config editor (see section below). For some suggestions, see CK's [http://ck.kolivas.org/patches/bfs/bfs-configuration-faq.txt BFS configuration FAQ].<br />
<br />
=== Long-Term Support (LTS) CK releases ===<br />
<br />
In addition to the linux-ck package, there are the following LTS kernel releases patched with the above patchsets, with the previously mentioned modifications to the config files:<br />
<br />
* {{AUR|linux-lts-ck}} - The current ArchLinux LTS kernel patched with the CK patchset<br />
* {{AUR|linux-lts310-ck}} - The 3.10 LTS kernel patched with the CK patchset<br />
* {{AUR|linux-lts312-ck}} - The 3.12 LTS kernel patched with the CK patchset<br />
<br />
'''These three packages are not maintained by graysky and pre-packaged versions will not be found in the unofficial ck repo.'''<br />
<br />
== Installation options ==<br />
<br />
{{Note|As with *any* additional kernel, users will need to manually edit their boot loader's config file to make it aware of the new kernel images. For example, users of [[GRUB]] should execute "grub-mkconfig -o /boot/grub/grub.cfg". Syslinux, GRUB-legacy, etc. will need to be modified as well.}}<br />
<br />
Users have two options to get these kernel packages.<br />
<br />
=== 1. Compile the package from source ===<br />
<br />
The [[AUR]] contains entries for both packages mentioned above.<br />
<br />
Users can customize the linux-ck package via tweaks in the PKGBUILD:<br />
<br />
* Optional nconfig for user specific tweaking.<br />
* Option to compile a minimal set of modules via a make localmodconfig.<br />
* Option to bypass the standard ARCH config options and simply use the current kernel's .config file.<br />
* Optionally set the [http://algo.ing.unimo.it/people/paolo/disk_sched/ BFQ I/O scheduler] as default.<br />
<br />
More details about these options are provided in the PKGBUILD itself via line comments. Be sure to read them if compiling from the AUR!<br />
<br />
{{Note|There are related PKGBUILDs in the AUR for other common modules unique to linux-ck. For example {{AUR|nvidia-ck}}, {{AUR|nvidia-304xx-ck}},{{AUR|lirc-ck}}, and {{AUR|broadcom-wl-ck}}.}}<br />
<br />
===2 . Use pre-compiled packages ===<br />
<br />
If users would rather not spend the time to compile on their own, an unofficial repo maintained by [[User:Graysky|graysky]] is available to the community.<br />
<br />
For details, see: [[Repo-ck]].<br />
<br />
== How to enable the BFQ I/O Scheduler ==<br />
<br />
Budget Fair Queueing is a disk scheduler which allows each process/thread to be assigned a portion of the disk throughput.<br />
<br />
=== Globally (for all devices) ===<br />
<br />
If compiling from the AUR, simply set the BFQ flag to yes in the PKGBUILD prior to building.<br />
_BFQ_enable_="y"<br />
<br />
If using the repo packages, append "elevator=bfq" to the kernel boot line in {{ic|/boot/grub/grub.cfg}} if using grub or in {{ic|/etc/default/grub}} under the '''GRUB_CMDLINE_LINUX_DEFAULT="quiet"''' line followed by rebuilding {{ic|/boot/grub/grub.cfg}} via the standard "grub-mkconfig -o /boot/grub/grub.cfg" command.<br />
<br />
=== Selectively (for only specified devices) ===<br />
<br />
An alternative method is to direct the kernel to use it on a device-by-device basis. For example, to enable it for {{ic|/dev/sda}} simply:<br />
# echo bfq > /sys/block/sda/queue/scheduler<br />
<br />
To confirm, simply ''cat'' the same file:<br />
# cat /sys/block/sda/queue/scheduler<br />
noop deadline cfq [bfq] <br />
<br />
Note that doing it this way will not survive a reboot. To make the change automatically at the next system boot, place lines in {{ic|/etc/tmpfiles.d/IO_scheduler.conf}}:<br />
<br />
w /sys/block/sda/queue/scheduler - - - - bfq<br />
<br />
== Troubleshooting ==<br />
<br />
=== Running VirtualBox with Linux-ck ===<br />
<br />
VirtualBox works just fine with custom kernels such as Linux-ck ''without'' the need to keep any of the official ARCH kernel-headers packages on the system!<br />
<br />
Don't forget to add users to the ''vboxusers '' group:<br />
# gpasswd -a USERNAME vboxusers<br />
<br />
==== Option 1. Use the unofficial repo (recommended if linux-ck is installed from Repo-ck) ====<br />
<br />
{{Note|As of 17-Oct-2012, Repo-ck users can enjoy these modules as pre-compiled packages in the repo itself. If you built your linux-ck from the AUR you '''cannot use the repo''' as all packages in the repo are matched groups.}}<br />
<br />
See the [[Repo-ck]] article to set up http://repo-ck.com for pacman to use directly.<br />
<br />
==== Option 2. The virtualbox-ck-host-modules package (recommended if linux-ck is built by you from the AUR) ====<br />
<br />
Install the {{AUR|virtualbox-ck-host-modules}} package and then install '''virtualbox''' package.<br />
<br />
==== Option 3. Use DKMS (more complicated, recommended with LTS releases) ====<br />
<br />
Install '''virtualbox''' with the '''virtualbox-host-dkms''' package. Then setup dkms as follows:<br />
# pacman -S virtualbox virtualbox-host-dkms<br />
# dkms install vboxhost/4.3.12<br />
<br />
{{Note|Make sure to substitute the correct version number of virtualbox in the second command. At the time of writing, 4.3.12 is current.}}<br />
<br />
=== Downgrading ===<br />
<br />
Users wishing to downgrade to a previous version of linux-ck, have several options:<br />
* Source archives are [http://repo-ck.com/bench.htm available] dating back to linux-ck-3.3.7-1. <br />
* [http://pkgbuild.com/git/aur-mirror.git/log/linux-ck AUR.git] holds AUR git commits for linux-ck dating back to linux-ck-2.6.39.3-1.<br />
<br />
=== Forum support ===<br />
<br />
Always feel free to open a thread in the forums for support. Be sure to give the thread a descriptive title to draw attention to the fact that the post relates to the Linux- ck package.<br />
<br />
== A little about the BFS ==<br />
<br />
The Brain Fuck Scheduler is a desktop orientated cpu process scheduler with extremely low latencies for excellent interactivity within normal load levels.<br />
<br />
=== BFS design goals ===<br />
<br />
The BFS has two major design goals:<br />
#Achieve excellent desktop interactivity and responsiveness without heuristics and tuning knobs that are difficult to understand, impossible to model and predict the effect of, and when tuned to one workload cause massive detriment to another.<br />
#Completely do away with the complex designs of the past for the cpu process scheduler and instead implement one that is very simple in basic design.<br />
<br />
For additional information, see the [[linux-ck#Further_Reading_on_BFS_and_CK_Patchset]] section of this article.<br />
<br />
=== An example video about queuing theory ===<br />
<br />
See [http://www.youtube.com/watch?v=F5Ri_HhziI0 this video] about queuing theory for an interesting parallel with<br />
supermarket checkouts. Quote from CK, "the relevance of that video is that BFS uses a single queue, whereas the mainline Linux kernel uses a multiple queue design. The people are tasks, and the checkouts are CPUs. Of course there's a lot more to a CPU scheduler than just the queue design, but I thought this video was very relevant."<br />
<br />
=== Some performance-based metrics: BFS vs. CFS ===<br />
<br />
A major benefit of using the BFS is increased responsiveness. The benefits however, are not limited to desktop feel. [[User:Graysky|Graysky]] put together some non-responsiveness based benchmarks to compare it to the CFS contained in the "stock" linux kernel. Seven different machines were used to see if differences exist and, to what degree they scale using performance based metrics. Again, these end-points were never factors in the primary design goals of the bfs. Results were encouraging. <br />
<br />
For those not wanting to see the full report, here is the conclusion:<br />
Kernels patched with the ck1 patch set including the bfs outperformed the vanilla kernel using the cfs at nearly all the performance-based benchmarks tested. Further study with a larger test set could be conducted, but based on the small test set of 7 PCs evaluated, these increases in process queuing, efficiency/speed are, on the whole, independent of CPU type (mono, dual, quad, hyperthreaded, etc.), CPU architecture (32-bit and 64-bit) and of CPU multiplicity (mono or dual socket).<br />
<br />
Moreover, several "modern" CPUs (Intel C2D and Ci7) that represent common workstations and laptops, consistently outperformed the cfs in the vanilla kernel at all benchmarks. Efficiency and speed gains were small to moderate.<br />
<br />
[[http://repo-ck.com/bench/cpu_schedulers_compared.pdf CPU_Schedulers_Compared.pdf]] is available for download.<br />
<br />
=== Check if enabled ===<br />
<br />
This start-up message should appear in the kernel ring buffer when BFS in enabled:<br />
# dmesg | grep scheduler<br />
...<br />
[ 0.380500] BFS CPU scheduler v0.420 by Con Kolivas.<br />
<br />
== BFS myths==<br />
<br />
=== BFS patched kernels CAN in fact use systemd ===<br />
<br />
{{Accuracy|User sessions seem to be working fine in conjunction with Linux-ck. Please verify.}}<br />
<br />
It is a common mistake to think that BFS does not support cgroups. It does support cgroups, just not all the cgroup features. Systemd works with BFS patched kernels, though systemd user sessions are broken for now, as some of those missing features are required to start {{ic|systemd --user}}.<br />
<br />
== Further Reading on BFS and CK Patchset ==<br />
<br />
* [http://ck.kolivas.org/patches/bfs/bfs-faq.txt Con Kolivas' White Paper on the BFS]<br />
* [http://en.wikipedia.org/wiki/Brain_Fuck_Scheduler Wikipedia's BFS Article]<br />
* [http://ck-hack.blogspot.com/ Con Kolivas' Blog]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Font_configuration&diff=304196Font configuration2014-03-12T20:05:19Z<p>Sushi Dude: Recommend use of local configuration file rather than the global one.</p>
<hr />
<div>[[Category:Fonts]]<br />
[[it:Font Configuration]]<br />
[[ja:Font Configuration]]<br />
[[ru:Font Configuration]]<br />
[[sr:Font Configuration]]<br />
[[tr:Yazıtipi_yapılandırması]]<br />
[[zh-CN:Font Configuration]]<br />
{{Related articles start}}<br />
{{Related|Fonts}}<br />
{{Related|Font Configuration/fontconfig Examples}}<br />
{{Related|Infinality-bundle+fonts}}<br />
{{Related|Java Runtime Environment Fonts}}<br />
{{Related|MS Fonts}}<br />
{{Related|X Logical Font Description}}<br />
{{Related articles end}}<br />
<br />
Fontconfig is a library designed to provide a list of available [[fonts]] to applications, and also for configuration for how fonts get rendered. See package {{Pkg|fontconfig}} and [[Wikipedia:Fontconfig]]. The Free type library ({{Pkg|freetype2}} package) renders the fonts, based on this configuration.<br />
<br />
Though Fontconfig is the standard in today's Linux, some applications still rely on the original method of font selection and display, the [[X Logical Font Description]].<br />
<br />
The font rendering packages on Arch Linux includes support for ''freetype2'' with the bytecode interpreter (BCI) enabled. Patched packages exist for better font rendering, especially with an LCD monitor. See [[#Patched packages]] below. The [[#Infinality|Infinality]] package allows both auto-hinting and subpixel rendering, allows the LCD filter to be tweaked without recompiling, and allows the auto-hinter to work well with bold fonts.<br />
<br />
== Font paths ==<br />
<br />
For fonts to be known to applications, they must be cataloged for easy and quick access.<br />
<br />
The font paths initially known to Fontconfig are: {{ic|/usr/share/fonts/}} and {{ic|~/.fonts/}} (of which Fontconfig will scan recursively). For ease of organization and installation, it is recommended to use these font paths when [[Fonts#Installation|adding fonts]].<br />
<br />
To see a list of known Fontconfig fonts:<br />
$ fc-list : file<br />
<br />
See {{ic|man fc-list}} for more output formats.<br />
<br />
Check for Xorg's known font paths by reviewing its log:<br />
$ grep /fonts /var/log/Xorg.0.log<br />
<br />
{{Tip|You can also check the list of [[Xorg]]'s known font paths using the command {{ic|xset q}}.}}<br />
<br />
Keep in mind that Xorg does not search recursively through the {{ic|/usr/share/fonts/}} directory like Fontconfig does. To add a path, the full path must be used:<br />
Section "Files"<br />
FontPath "/usr/share/fonts/local/"<br />
EndSection<br />
<br />
If you want font paths to be set on a per-user basis, you can add and remove font paths from the default by adding the following line(s) to {{ic|~/.xinitrc}}:<br />
xset +fp /usr/share/fonts/local/ # Prepend a custom font path to Xorg's list of known font paths<br />
xset -fp /usr/share/fonts/sucky_fonts/ # Remove the specified font path from Xorg's list of known font paths<br />
<br />
To see a list of known Xorg fonts use {{ic|xlsfonts}}, from the {{Pkg|xorg-xlsfonts}} package.<br />
<br />
== Fontconfig configuration ==<br />
<br />
Fontconfig is documented in the [http://www.freedesktop.org/software/fontconfig/fontconfig-user.html fonts-conf] man page.<br />
<br />
Configuration can be done per-user through {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}, and globally with {{ic|/etc/fonts/local.conf}}. The settings in the per-user configuration have precedence over the global configuration. Both these files use the same syntax.<br />
{{Note|Configuration files and directories: {{ic|~/.fonts.conf/}}, {{ic|~/.fonts.conf.d/}} and {{ic|~/.fontconfig/*.cache-*}} are deprecated since {{Pkg|fontconfig}} 2.10.1 ([http://cgit.freedesktop.org/fontconfig/commit/?id&#61;8c255fb185d5651b57380b0a9443001e8051b29d upstream commit]) and will not be read by default in the future versions of the package. New paths are {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}, {{ic|$XDG_CONFIG_HOME/fontconfig/conf.d/NN-name.conf}} and {{ic|$XDG_CACHE_HOME/fontconfig/*.cache-*}} respectively. If using the second location, make sure the naming is valid (where {{ic|NN}} is a two digit number like {{ic|00}}, {{ic|10}}, or {{ic|99}}).}}<br />
<br />
Fontconfig gathers all its configurations in a central file ({{ic|/etc/fonts/fonts.conf}}). This file is replaced during fontconfig updates and shouldn't be edited. Fontconfig-aware applications source this file to know available fonts and how they get rendered. This file is a conglomeration of rules from the global configuration ({{ic|/etc/fonts/local.conf}}), the configured presets in {{ic|/etc/fonts/conf.d/}}, and the user configuration file ({{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}). {{ic|fc-cache}} can be used to rebuild fontconfig's configuration, although changes will only be visible in newly launched applications.<br />
<br />
{{Note|For some desktop environments (such as [[GNOME]] and [[KDE]]) using the ''Font Control Panel'' will automatically create or overwrite the user font configuration file. For these desktop environments, it is best to match your already defined font configurations to get the expected behavior.}}<br />
<br />
Fontconfig configuration files use [[Wikipedia:XML|XML]] format and need these headers:<br />
<br />
{{bc|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<br />
<!-- settings go here --><br />
<br />
</fontconfig><br />
</nowiki>}}<br />
<br />
The configuration examples in this article omit these tags.<br />
<br />
=== Presets ===<br />
<br />
There are presets installed in the directory {{ic|/etc/fonts/conf.avail}}. They can be enabled by creating [[Wikipedia:Symbolic link|symbolic link]]s to them, both per-user and globally, as described in {{ic|/etc/fonts/conf.d/README}}. These presets will override matching settings in their respective configuration files.<br />
<br />
For example, to enable sub-pixel RGB rendering globally:<br />
<br />
# cd /etc/fonts/conf.d<br />
# ln -s ../conf.avail/10-sub-pixel-rgb.conf<br />
<br />
To do the same but instead for a per-user configuration:<br />
<br />
$ mkdir $XDG_CONFIG_HOME/fontconfig/conf.d<br />
$ ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf $XDG_CONFIG_HOME/fontconfig/conf.d<br />
<br />
=== Anti-aliasing ===<br />
<br />
[[Wikipedia:Font rasterization|Font rasterization]] converts vector font data to bitmap data so that it can be displayed. The result can appear jagged due to [[Wikipedia:Aliasing|aliasing]]. [[Wikipedia:Anti-aliasing|anti-aliasing]] is enabled by default and increases the apparent resolution of font edges.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Some applications, like [[Gnome|Gnome 3]] may [[#Troubleshooting|override default anti-alias settings]].}}<br />
<br />
=== Hinting ===<br />
<br />
[[Wikipedia:Font hinting|Font hinting]] (also known as instructing) is the use of mathematical instructions to adjust the display of an outline font so that it lines up with a rasterized grid, (i.e. the pixel grid of the display). Its intended effect is to make fonts appear more crisp so that they are more readable. Fonts will line up correctly without hinting when displays have around 300 [[Wikipedia:Dots per inch|DPI]]. Two types of hinting are available.<br />
<br />
==== Byte-Code Interpreter (BCI) ====<br />
<br />
Using BCI hinting, instructions in TrueType fonts fonts are rendered according to FreeTypes's interpreter. BCI hinting works well with fonts with good hinting instructions. To enable hinting:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="hinting" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Autohinter ====<br />
<br />
The Autohinter attempts to do automatic hinting and disregards any existing hinting information. Originally it was the default because TrueType2 fonts were patent-protected but now that these patents have expired there's very little reason to use it. It does work better with fonts that have broken or no hinting information but it will be strongly sub-optimal for fonts with good hinting information. Generally common fonts are of the later kind so autohinter will not be useful. To enable auto-hinting:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="autohint" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Hintstyle ====<br />
<br />
Hintstyle is the amount of font reshaping done to line up to the grid. Hinting values are: {{ic|hintnone}}, {{ic|hintslight}}, {{ic|hintmedium}}, and {{ic|hintfull}}. {{ic|hintslight}} will make the font more fuzzy to line up to the grid but will be better in retaining font shape, while {{ic|hintfull}} will be a crisp font that aligns well to the pixel grid but will lose a greater amount of font shape. Preferences vary.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="hintstyle" mode="assign"><br />
<const>hintfull</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Some applications, like [[Gnome|Gnome 3]] may [[#Troubleshooting|override default hinting settings.]]}}<br />
<br />
=== Subpixel rendering ===<br />
<br />
Most monitors manufactured today use the Red, Green, Blue (RGB) specification. Fontconfig will need to know your monitor type to be able to display your fonts correctly. Monitors are either: '''RGB''' (most common), '''BGR''', '''V-RGB''' (vertical), or '''V-BGR'''. A monitor test can be found [http://www.lagom.nl/lcd-test/subpixel.php here]).<br />
<br />
To enable subpixel rendering:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="rgba" mode="assign"><br />
<const>rgb</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Subpixel rendering effectively triples the horizontal (or vertical) resolution for fonts by making use of subpixels. The autohinter and subpixel rendering are not designed to work together and should not be used in combination without the [[#Infinality: the generic way|Infinality]] patch set.}}<br />
<br />
==== LCD filter ====<br />
<br />
When using subpixel rendering, you should enable the LCD filter, which is designed to reduce colour fringing. This is described under [http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html LCD filtering] in the FreeType 2 API reference. Different options are described under [http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html#FT_LcdFilter FT_LcdFilter], and are illustrated by this [http://www.spasche.net/files/lcdfiltering/ LCD filter test] page.<br />
<br />
The {{ic|lcddefault}} filter will work for most users. Other filters are available that can be used in special situations: {{ic|lcdlight}}; a lighter filter ideal for fonts that look too bold or fuzzy, {{ic|lcdlegacy}}, the original Cairo filter; and {{ic|lcdnone}} to disable it entirely.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Advanced LCD filter specification ====<br />
<br />
If the available, built-in LCD filters are not satisfactory, it is possible to tweak the font rendering very specifically by building a custom freetype2 package and modifying the hardcoded filters. The [[Arch Build System]] can be used to build and install packages from source.<br />
<br />
First, refresh the freetype2 PKGBUILD as root:<br />
<br />
# abs extra/freetype2<br />
<br />
This example uses {{ic|/var/abs/build}} as the build directory, substitute it according to your personal ABS setup. Download and extract the freetype2 package as a regular user:<br />
<br />
$ cd /var/abs/build<br />
$ cp -r ../extra/freetype2 .<br />
$ cd freetype2<br />
$ makepkg -o<br />
<br />
Edit the file {{ic|src/freetype-VERSION/src/base/ftlcdfil.c}} and look up the definition of the constant {{ic|default_filter[5]}}:<br />
<br />
static const FT_Byte default_filter[5] =<br />
{ 0x10, 0x40, 0x70, 0x40, 0x10 };<br />
<br />
This constant defines a low-pass filter applied to the rendered glyph. Modify it as needed. Save the file, build and install the custom package:<br />
<br />
$ makepkg -e<br />
# pacman -Rd freetype2<br />
# pacman -U freetype2-VERSION-ARCH.pkg.tar.xz<br />
<br />
Reboot or restart X. The lcddefault filter should now render fonts differently.<br />
<br />
=== Disable auto-hinter for bold fonts ===<br />
<br />
The auto-hinter uses sophisticated methods for font rendering, but often makes bold fonts too wide. Fortunately, a solution can be turning off the autohinter for bold fonts while leaving it on for the rest:<br />
...<br />
<match target="font"><br />
<test name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<edit name="autohint" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
...<br />
<br />
=== Enable anti-aliasing only for bigger fonts ===<br />
<br />
Some users prefer the sharper rendering that anti-aliasing does not offer:<br />
<br />
{{bc|<nowiki><br />
...<br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="size" qual="any" compare="more"><br />
<double>12</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="pixelsize" qual="any" compare="more"><br />
<double>16</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
...<br />
</nowiki>}}<br />
<br />
=== Replace fonts ===<br />
<br />
The most reliable way to do this is to add an XML fragment similar to the one below. ''Using the "binding" attribute will give you better results'', for example, in Firefox where you may not want to change properties of font being replaced. This will cause Ubuntu to be used in place of Georgia:<br />
...<br />
<match target="pattern"><br />
<test qual="any" name="family"><string>georgia</string></test><br />
<edit name="family" mode="assign" binding="same"><string>Ubuntu</string></edit><br />
</match><br />
...<br />
An alternate approach is to set the "preferred" font, but ''this only works if the original font is not on the system'', in which case the one specified will be substituted:<br />
...<br />
< !-- Replace Helvetica with Bitstream Vera Sans Mono --><br />
< !-- Note, an alias for Helvetica should already exist in default conf files --><br />
<alias><br />
<family>Helvetica</family><br />
<prefer><family>Bitstream Vera Sans Mono</family></prefer><br />
<default><family>fixed</family></default><br />
</alias><br />
...<br />
<br />
=== Disable bitmap fonts ===<br />
<br />
To disable bitmap fonts in fontconfig, use {{ic|70-no-bitmaps.conf}} (which is not placed by fontconfig by default):<br />
<br />
# cd /etc/fonts/conf.d<br />
# rm 70-yes-bitmaps.conf<br />
# ln -s ../conf.avail/70-no-bitmaps.conf<br />
<br />
This oneliner should also work:<br />
<br />
# ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d/<br />
<br />
You may not need to remove {{ic|70-yes-bitmaps.conf}} if it does not exist. You can choose which fonts to replace bitmaps fonts with (Helvetica, Courier and Times bitmap mapts to TTF fonts) by:<br />
<br />
{{hc|~/.config/fontconfig/conf.d/29-replace-bitmap-fonts.conf|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<!-- Replace generic bitmap font names by generic font families --><br />
<match target="pattern" name="family"><br />
<test name="family" qual="any"><br />
<string>Helvetica</string><br />
</test><br />
<edit mode="assign" name="family"><br />
<string>Arial</string><br />
<string>Liberation Sans</string><br />
<string>sans-serif</string><br />
</edit><br />
</match><br />
<match target="pattern" name="family"><br />
<test name="family" qual="any"><br />
<string>Courier</string><br />
</test><br />
<edit mode="assign" name="family"><br />
<string>Courier New</string><br />
<string>Liberation Mono</string><br />
<string>monospace</string><br />
</edit><br />
</match><br />
<match target="pattern" name="family"><br />
<test name="family" qual="any"><br />
<string>Times</string><br />
</test><br />
<edit mode="assign" name="family"><br />
<string>Times New Roman</string><br />
<string>Liberation Serif</string><br />
<string>serif</string><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
<div id="EmbeddedBitmap">To disable embedded bitmap for all fonts:<div><br />
<br />
{{hc|~/.config/fontconfig/conf.d/20-no-embedded.conf|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<match target="font"><br />
<edit name="embeddedbitmap" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
To disable embedded bitmap fonts for a specific font:<br />
<br />
<match target="font"><br />
<test qual="any" name="family"><br />
<string>Monaco</string><br />
</test><br />
<edit name="embeddedbitmap"><bool>false</bool></edit><br />
</match><br />
<br />
=== Disable scaling of bitmap fonts ===<br />
<br />
To disable scaling of bitmap fonts (which often makes them blurry), remove {{ic|/etc/fonts/conf.d/10-scale-bitmap-fonts.conf}}.<br />
<br />
=== Create bold and italic styles for incomplete fonts ===<br />
<br />
Freetype has the ability to automatically create ''italic'' and '''bold''' styles for fonts that do not have them, but only if explicitly required by the application. Given programs rarely send these requests, this section covers manually forcing generation of missing styles.<br />
<br />
Start by editing {{ic|/usr/share/fonts/fonts.cache-1}} as explained below. Store a copy of the modifications on another file, because a font update with {{ic|fc-cache}} will overwrite {{ic|/usr/share/fonts/fonts.cache-1}}.<br />
<br />
Assuming the Dupree font is installed:<br />
"dupree.ttf" 0 "Dupree:style=Regular:slant=0:weight=80:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Duplicate the line, change {{ic|<nowiki>style=Regular</nowiki>}} to {{ic|<nowiki>style=Bold</nowiki>}} or any other style. Also change {{ic|<nowiki>slant=0</nowiki>}} to {{ic|<nowiki>slant=100</nowiki>}} for italic, {{ic|<nowiki>weight=80</nowiki>}} to {{ic|<nowiki>weight=200</nowiki>}} for bold, or combine them for '''''bold italic''''':<br />
"dupree.ttf" 0 "Dupree:style=Bold Italic:slant=100:weight=200:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Now add necessary modifications to {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}:<br />
{{bc|<nowiki><br />
...<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="weight" compare="more_eq"><int>140</int></test><br />
<edit name="embolden" mode="assign"><bool>true</bool></edit><br />
</match><br />
<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="slant" compare="more_eq"><int>80</int></test><br />
<edit name="matrix" mode="assign"><br />
<times><br />
<name>matrix</name><br />
<matrix><br />
<double>1</double><double>0.2</double><br />
<double>0</double><double>1</double><br />
</matrix><br />
</times><br />
</edit><br />
</match><br />
...<br />
</nowiki>}}<br />
{{Tip| Use the value 'embolden' for existing bold fonts in order to make them even bolder.}}<br />
<br />
=== Change rule overriding ===<br />
<br />
Fontconfig processes files in {{ic|/etc/fonts/conf.d}} in numerical order. This enables rules or files to override one another, but often confuses users about what file gets parsed last.<br />
<br />
To guarantee that personal settings take precedence over any other rules, change their ordering:<br />
# cd /etc/fonts/conf.d<br />
# mv 50-user.conf 99-user.conf<br />
<br />
This change seems however to be unnecessary for the most of the cases, because a user is given enough control by default to set up own font preferences, hinting and antialiasing properties, alias new fonts to generic font families, etc.<br />
<br />
=== Example fontconfig configurations ===<br />
<br />
Example fontconfig configurations can be found on this [[Font_Configuration/fontconfig_Examples|page]].<br />
<br />
A simple starting point:<br />
<br />
{{hc|$XDG_CONFIG_HOME/fontconfig/fonts.conf|<nowiki><br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'><br />
<fontconfig><br />
<match target="font"><br />
<edit mode="assign" name="antialias"><br />
<bool>true</bool><br />
</edit><br />
<edit mode="assign" name="embeddedbitmap"><br />
<bool>false</bool><br />
</edit><br />
<edit mode="assign" name="hinting"><br />
<bool>true</bool><br />
</edit><br />
<edit mode="assign" name="hintstyle"><br />
<const>hintslight</const><br />
</edit><br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
<edit mode="assign" name="rgba"><br />
<const>rgb</const><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
== Patched packages ==<br />
<br />
These patched packages are available in the [[Arch User Repository|AUR]]. A few considerations:<br />
<br />
* Configuration is usually necessary.<br />
* The new font rendering will not kick in until applications restart.<br />
* Applications which [[Wikipedia:Static library|statically link]] to a library will not be affected by patches applied to the system library.<br />
<br />
=== Infinality ===<br />
<br />
The infinality patchset aims to greatly improve freetype2 font rendering. It adds multiple new capabilities.<br />
<br />
* [http://www.infinality.net/blog/infinality-freetype-patches/ Home page]<br />
* [http://www.infinality.net/forum/ Forum]<br />
* [http://www.webupd8.org/2013/06/better-font-rendering-in-linux-with.html Short article about infinality (contains screenshots)]<br />
<br />
Infinality's settings are all configurable at runtime via environment variables in {{ic|/etc/profile.d/infinality-settings.sh}}, and include the following:<br />
<br />
*'''Emboldening Enhancement''': Disables Y emboldening, producing a much nicer result on fonts without bold versions. Works on native TT hinter and autohinter.<br />
*'''Auto-Autohint''': Automatically forces autohint on fonts that contain no TT instructions.<br />
*'''Autohint Enhancement''': Makes autohint snap horizontal stems to pixels. Gives a result that appears like a well-hinted truetype font, but is 100% patent-free (as far as I know).<br />
*'''Customized FIR Filter''': Select your own [http://www.infinality.net/forum/viewtopic.php?f=2&t=19 filter values] at run-time. Works on native TT hinter and autohinter.<br />
*'''Stem Alignment''': Aligns bitmap glyphs to optimized pixel boundaries. Works on native TT hinter and autohinter.<br />
*'''Pseudo Gamma Correction''': Lighten and darken glyphs at a given value, below a given size. Works on native TT hinter and autohinter.<br />
*'''Embolden Thin Fonts''': Embolden thin or light fonts so that they are more visible. Works on autohinter.<br />
*'''Force Slight Hinting''': Force slight hinting even when programs want full hinting. If you use the local.conf I provide (included in infinality-settings fedora package) you will notice nice improvements on @font-face fonts.<br />
*'''ChromeOS Style Sharpening''': ChromeOS uses a patch to sharpen the look of fonts. This is now included in the infinality patchset.<br />
<br />
A number of presets are included and can be used by setting the USE_STYLE variable in {{ic|/etc/profile.d/infinality-settings.sh}}.<br />
<br />
==== Installation and configuration ====<br />
{{Tip|All AUR packages in this section can also be downloaded from bohoomil's custom repository. See the [[#Install from custom repository|section below]] for how to enable this repository.}}<br />
{{Note|If you have been using fontconfig-infinality-ultimate < 2.11.0-2, you need to re-install (not upgrade!) fontconfig-infinality-ultimate package:<br />
pacman -Rdd fontconfig-infinality-ultimate<br />
pacman -S fontconfig-infinality-ultimate<br />
}}<br />
{{AUR|freetype2-infinality}} can be installed from the [[Arch User Repository|AUR]]. If you are a multilib user, also install {{AUR|lib32-freetype2-infinality}} from the AUR. The AUR also contains the latest development snapshot of freetype2 with the Infinality patchset: {{AUR|freetype2-infinality-git}} and {{AUR|lib32-freetype2-infinality-git}}.<br />
<br />
It is recommended to also install {{AUR|fontconfig-infinality}} to enable selection of predefined font substitution styles and antialiasing settings, apart from the rendering settings of the engine itself. After doing so, you can select the font style (win7, winxp, osx, linux, ...) with:<br />
# infctl setstyle<br />
<br />
If you set e.g. win7 or osx you need the corresponding fonts installed.<br />
<br />
{{Note|<br />
* The user bohoomil maintains a very good configuration in his [https://github.com/bohoomil/fontconf github repo] which is available as {{AUR|fontconfig-infinality-ultimate-git}} in the AUR.<br />
* Install {{AUR|grip-git}} from the AUR to have a realtime font preview.<br />
* Default infinality settings can cause some programs to display fonts at 72 DPI instead of 96. If you notice a problem open {{ic|/etc/fonts/infinality/infinality.conf}} search for the section on DPI and change 72 to 96. This problem can specifically affect conky causing the fonts to appear smaller than they should. Thus not aligning properly with images.<br />
* ''The README for {{AUR|fontconfig-infinality}} says that /etc/fonts/local.conf should either not exist, or have no infinality-related configurations in it. The local.conf is now obsolete and completely replaced by this configuration.''<br />
}}<br />
<br />
for more information see this article: http://www.infinality.net/forum/viewtopic.php?f=2&t=77<br />
<br />
==== Install from custom repository ====<br />
<br />
bohoomil also maintains '''infinality-bundle''' repository, offering three basic libraries (freetype2-infinality-ultimate, fontconfig-infinality-ultimate & cairo-infinality-ultimate) as pre-patched, pre-configured and pre-built binaries for all architectures (i686, x86_64, multilib). There is also an additional repository avaiable, '''infinality-bundle-fonts''', offering a collection of entirely free, high quality typefaces, replacing common proprietary font families. Using '''infinality-bundle''' and '''infinality-bundle-fonts''' makes the whole installation and configuration process dramatically simplified (i.e., it lets you skip most steps necessary to install and configure fonts in your system).<br />
<br />
Please, see [[Infinality-bundle+fonts]] for more information and installation instructions.<br />
<br />
=== Ubuntu ===<br />
<br />
Ubuntu adds extra configurations, and occasionally patches to the font rendering libraries.<br />
<br />
Install the patched packages from the [[Arch User Repository|AUR]], the package names are: {{AUR|freetype2-ubuntu}} {{AUR|fontconfig-ubuntu}} {{AUR|cairo-ubuntu}}.<br />
<br />
The global configuration will need to be added. See [[#Example fontconfig configurations]] for a starting point.<br />
Ubuntu rendering works the best with ''hintslight'' option.<br />
<br />
Note that the *-ubuntu AUR packages need to be kept up-to-date by the user, and will not be updated by pacman along with other packages. The whole graphical system can become inoperable if the user-installed core graphical libraries become incompatible with the official repository applications.<br />
<br />
=== Reverting to unpatched packages ===<br />
<br />
To restore the unpatched packages, reinstall the originals:<br />
<br />
# pacman -S --asdeps freetype2 cairo fontconfig<br />
<br />
Append 'lib32-cairo lib32-fontconfig lib32-freetype2' if you also installed 32 bit versions.<br />
<br />
== Applications without fontconfig support ==<br />
<br />
Some applications like [[URxvt]] will ignore fontconfig settings. This is very apparent when using the infinality patches which are heavily reliant on proper configuration. You can work around this by using {{ic|~/.Xresources}}, but it is not nearly as flexible as fontconfig. Example (see [[#Fontconfig configuration]] for explanations of the options):<br />
<br />
{{hc|~/.Xresources|<nowiki><br />
Xft.autohint: 0<br />
Xft.lcdfilter: lcddefault<br />
Xft.hintstyle: hintfull<br />
Xft.hinting: 1<br />
Xft.antialias: 1<br />
Xft.rgba: rgb<br />
</nowiki>}}<br />
<br />
Make sure the settings are loaded properly when X starts with {{ic|xrdb -q}} (see [[Xresources]] for more information).<br />
<br />
== Troubleshooting ==<br />
<br />
=== Distorted fonts ===<br />
<br />
{{Note|96 DPI is not a standard. You should use your monitor's actual DPI to get proper font rendering, especially when using subpixel rendering.}}<br />
<br />
If fonts are still unexpectedly large or small, poorly proportioned or simply rendering poorly, fontconfig may be using the incorrect DPI.<br />
<br />
Fontconfig should be able to detect DPI parameters as discovered by the Xorg server. You can check the automatically discovered DPI with {{ic|xdpyinfo}} (provided by the {{pkg|xorg-xdpyinfo}} package):<br />
<br />
{{hc|<nowiki>$ xdpyinfo | grep dots</nowiki>|<br />
resolution: 102x102 dots per inch<br />
}}<br />
<br />
If the DPI is detected incorrectly (usually due to an incorrect monitor EDID), you can specify it manually in the Xorg configuration, see [[Xorg#Display size and DPI]]. This is the recommended solution, but it may not work with buggy drivers.<br />
<br />
Fontconfig will default to the Xft.dpi variable if it is set. Xft.dpi is usually set by desktop environments (usually to Xorg's DPI setting) or manually in {{ic|~/.Xdefaults}} or {{ic|~/.Xresources}}. Use xrdb to query for the value:<br />
<br />
{{hc|<nowiki>$ xrdb -query | grep dpi</nowiki>|<br />
Xft.dpi: 102<br />
}}<br />
<br />
Those still having problems can fall back to manually setting the DPI used by fontconfig:<br />
<br />
...<br />
<!-- Setup for DPI=96 --><br />
<match target="pattern"><br />
<edit name="dpi" mode="assign"><double>102</double></edit><br />
</match><br />
...<br />
<br />
=== Calibri, Cambria, Monaco, etc. not rendering properly ===<br />
<br />
Some scalable fonts have embedded bitmap versions which are rendered instead, mainly at smaller sizes. Force using scalable fonts at all sizes by [[#EmbeddedBitmap|#Disabling embedded bitmap]].<br />
<br />
=== Older GTK and QT applications ===<br />
<br />
Modern GTK apps enable Xft by default but this was not the case before version 2.2. If it is not possible to update these applications, force Xft for old [[GNOME]] applications by adding to {{ic|~/.bashrc}}:<br />
<br />
export GDK_USE_XFT=1<br />
<br />
For older QT applications:<br />
<br />
export QT_XFT=true<br />
<br />
=== Applications overriding hinting ===<br />
<br />
Some applications may override default fontconfig hinting and anti-aliasing settings. This may happen with [[Gnome]] 3, for example while you are using QT applications like vlc,smplayer. Use the specific configuration program for the application in such cases. For gnome, try {{pkg|gnome-tweak-tool}} and set the anti-aliasing to rgba instead of the default grayscale while using infinality.<br />
<br />
== See also ==<br />
<br />
* [http://www.x.org/X11R6.8.2/doc/fonts.html Fonts in X11R6.8.2] - Official Xorg font information<br />
* [http://freetype.sourceforge.net/freetype2/ FreeType 2 overview]<br />
* [https://forums.gentoo.org/viewtopic-t-723341.html Gentoo font-rendering thread]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Font_configuration&diff=293432Font configuration2014-01-18T07:59:58Z<p>Sushi Dude: Improved example configuration by disabling embedded bitmaps and formatting it alphabetically.</p>
<hr />
<div>[[Category:Fonts]]<br />
[[it:Font Configuration]]<br />
[[ja:Font Configuration]]<br />
[[ru:Font Configuration]]<br />
[[sr:Font Configuration]]<br />
[[tr:Yazıtipi_yapılandırması]]<br />
[[zh-CN:Font Configuration]]<br />
{{Related articles start}}<br />
{{Related|Fonts}}<br />
{{Related|Font Configuration/fontconfig Examples}}<br />
{{Related|Infinality-bundle+fonts}}<br />
{{Related|Java Runtime Environment Fonts}}<br />
{{Related|MS Fonts}}<br />
{{Related|X Logical Font Description}}<br />
{{Related articles end}}<br />
<br />
Fontconfig is a library designed to provide a list of available [[fonts]] to applications, and also for configuration for how fonts get rendered. See package {{Pkg|fontconfig}} and [[Wikipedia:Fontconfig]]. The Free type library ({{Pkg|freetype2}} package) renders the fonts, based on this configuration.<br />
<br />
Though Fontconfig is the standard in today's Linux, some applications still rely on the original method of font selection and display, the [[X Logical Font Description]].<br />
<br />
The font rendering packages on Arch Linux includes support for ''freetype2'' with the bytecode interpreter (BCI) enabled. Patched packages exist for better font rendering, especially with an LCD monitor. See [[#Patched packages]] below. The [[#Infinality|Infinality]] package allows both auto-hinting and subpixel rendering, allows the LCD filter to be tweaked without recompiling, and allows the auto-hinter to work well with bold fonts.<br />
<br />
== Font paths ==<br />
<br />
For fonts to be known to applications, they must be cataloged for easy and quick access.<br />
<br />
The font paths initially known to Fontconfig are: {{ic|/usr/share/fonts/}} and {{ic|~/.fonts/}} (of which Fontconfig will scan recursively). For ease of organization and installation, it is recommended to use these font paths when [[Fonts#Installation|adding fonts]].<br />
<br />
To see a list of known Fontconfig fonts:<br />
$ fc-list : file<br />
<br />
See {{ic|man fc-list}} for more output formats.<br />
<br />
Check for Xorg's known font paths by reviewing its log:<br />
$ grep /fonts /var/log/Xorg.0.log<br />
<br />
{{Tip|You can also check the list of [[Xorg]]'s known font paths using the command {{ic|xset q}}.}}<br />
<br />
Keep in mind that Xorg does not search recursively through the {{ic|/usr/share/fonts/}} directory like Fontconfig does. To add a path, the full path must be used:<br />
Section "Files"<br />
FontPath "/usr/share/fonts/local/"<br />
EndSection<br />
<br />
If you want font paths to be set on a per-user basis, you can add and remove font paths from the default by adding the following line(s) to {{ic|~/.xinitrc}}:<br />
xset +fp /usr/share/fonts/local/ # Prepend a custom font path to Xorg's list of known font paths<br />
xset -fp /usr/share/fonts/sucky_fonts/ # Remove the specified font path from Xorg's list of known font paths<br />
<br />
To see a list of known Xorg fonts use {{ic|xlsfonts}}, from the {{Pkg|xorg-xlsfonts}} package.<br />
<br />
== Fontconfig configuration ==<br />
<br />
Fontconfig is documented in the [http://fontconfig.org/fontconfig-user.html fonts-conf] man page.<br />
<br />
Configuration can be done per-user through {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}, and globally with {{ic|/etc/fonts/local.conf}}. The settings in the per-user configuration have precedence over the global configuration. Both these files use the same syntax.<br />
{{Note|Configuration files and directories: {{ic|~/.fonts.conf/}}, {{ic|~/.fonts.conf.d/}} and {{ic|~/.fontconfig/*.cache-*}} are deprecated since {{Pkg|fontconfig}} 2.10.1 ([http://cgit.freedesktop.org/fontconfig/commit/?id&#61;8c255fb185d5651b57380b0a9443001e8051b29d upstream commit]) and will not be read by default in the future versions of the package. New paths are {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}, {{ic|$XDG_CONFIG_HOME/fontconfig/conf.d/NN-name.conf}} and {{ic|$XDG_CACHE_HOME/fontconfig/*.cache-*}} respectively. If using the second location, make sure the naming is valid (where {{ic|NN}} is a two digit number like {{ic|00}}, {{ic|10}}, or {{ic|99}}).}}<br />
<br />
Fontconfig gathers all its configurations in a central file ({{ic|/etc/fonts/fonts.conf}}). This file is replaced during fontconfig updates and shouldn't be edited. Fontconfig-aware applications source this file to know available fonts and how they get rendered. This file is a conglomeration of rules from the global configuration ({{ic|/etc/fonts/local.conf}}), the configured presets in {{ic|/etc/fonts/conf.d/}}, and the user configuration file ({{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}). {{ic|fc-cache}} can be used to rebuild fontconfig's configuration, although changes will only be visible in newly launched applications.<br />
<br />
{{Note|For some desktop environments (such as [[GNOME]] and [[KDE]]) using the ''Font Control Panel'' will automatically create or overwrite the user font configuration file. For these desktop environments, it is best to match your already defined font configurations to get the expected behavior.}}<br />
<br />
Fontconfig configuration files use [[Wikipedia:XML|XML]] format and need these headers:<br />
<br />
{{bc|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<br />
<!-- settings go here --><br />
<br />
</fontconfig><br />
</nowiki>}}<br />
<br />
The configuration examples in this article omit these tags.<br />
<br />
=== Presets ===<br />
<br />
There are presets installed in the directory {{ic|/etc/fonts/conf.avail}}. They can be enabled by creating [[Wikipedia:Symbolic link|symbolic link]]s to them, both per-user and globally, as described in {{ic|/etc/fonts/conf.d/README}}. These presets will override matching settings in their respective configuration files.<br />
<br />
For example, to enable sub-pixel RGB rendering globally:<br />
<br />
# cd /etc/fonts/conf.d<br />
# ln -s ../conf.avail/10-sub-pixel-rgb.conf<br />
<br />
To do the same but instead for a per-user configuration:<br />
<br />
$ mkdir $XDG_CONFIG_HOME/fontconfig/conf.d<br />
$ ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf $XDG_CONFIG_HOME/fontconfig/conf.d<br />
<br />
=== Anti-aliasing ===<br />
<br />
[[Wikipedia:Font rasterization|Font rasterization]] converts vector font data to bitmap data so that it can be displayed. The result can appear jagged due to [[Wikipedia:Aliasing|aliasing]]. [[Wikipedia:Anti-aliasing|anti-aliasing]] is enabled by default and increases the apparent resolution of font edges.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Some applications, like [[Gnome|Gnome 3]] may [[#Troubleshooting|override default anti-alias settings]].}}<br />
<br />
=== Hinting ===<br />
<br />
[[Wikipedia:Font hinting|Font hinting]] (also known as instructing) is the use of mathematical instructions to adjust the display of an outline font so that it lines up with a rasterized grid, (i.e. the pixel grid of the display). It's intended effect is to make fonts appear more crisp so that they are more readable. Fonts will line up correctly without hinting when displays have around 300 [[Wikipedia:Dots per inch|DPI]]. Two types of hinting are available.<br />
<br />
==== Byte-Code Interpreter (BCI) ====<br />
<br />
Using BCI hinting, instructions in TrueType fonts fonts are rendered according to FreeTypes's interpreter. BCI hinting works well with fonts with good hinting instructions. To enable hinting:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="hinting" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Autohinter ====<br />
<br />
The Autohinter attempts to do automatic hinting and disregards any existing hinting information. Originally it was the default because TrueType2 fonts were patent-protected but now that these patents have expired there's very little reason to use it. It does work better with fonts that have broken or no hinting information but it will be strongly sub-optimal for fonts with good hinting information. Generally common fonts are of the later kind so autohinter will not be useful. To enable auto-hinting:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="autohint" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Hintstyle ====<br />
<br />
Hintstyle is the amount of font reshaping done to line up to the grid. Hinting values are: {{ic|hintnone}}, {{ic|hintslight}}, {{ic|hintmedium}}, and {{ic|hintfull}}. {{ic|hintslight}} will make the font more fuzzy to line up to the grid but will be better in retaining font shape, while {{ic|hintfull}} will be a crisp font that aligns well to the pixel grid but will lose a greater amount of font shape. Preferences vary.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="hintstyle" mode="assign"><br />
<const>hintfull</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Some applications, like [[Gnome|Gnome 3]] may [[#Troubleshooting|override default hinting settings.]]}}<br />
<br />
=== Subpixel rendering ===<br />
<br />
Most monitors manufactured today use the Red, Green, Blue (RGB) specification. Fontconfig will need to know your monitor type to be able to display your fonts correctly. Monitors are either: '''RGB''' (most common), '''BGR''', '''V-RGB''' (vertical), or '''V-BGR'''. A monitor test can be found [http://www.lagom.nl/lcd-test/subpixel.php here]).<br />
<br />
To enable subpixel rendering:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="rgba" mode="assign"><br />
<const>rgb</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Subpixel rendering effectively triples the horizontal (or vertical) resolution for fonts by making use of subpixels. The autohinter and subpixel rendering are not designed to work together and should not be used in combination without the [[#Infinality: the generic way|Infinality]] patch set.}}<br />
<br />
==== LCD filter ====<br />
<br />
When using subpixel rendering, you should enable the LCD filter, which is designed to reduce colour fringing. This is described under [http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html LCD filtering] in the FreeType 2 API reference. Different options are described under [http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html#FT_LcdFilter FT_LcdFilter], and are illustrated by this [http://www.spasche.net/files/lcdfiltering/ LCD filter test] page.<br />
<br />
The {{ic|lcddefault}} filter will work for most users. Other filters are available that can be used in special situations: {{ic|lcdlight}}; a lighter filter ideal for fonts that look too bold or fuzzy, {{ic|lcdlegacy}}, the original Cairo filter; and {{ic|lcdnone}} to disable it entirely.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Advanced LCD filter specification ====<br />
<br />
If the available, built-in LCD filters are not satisfactory, it is possible to tweak the font rendering very specifically by building a custom freetype2 package and modifying the hardcoded filters. The [[Arch Build System]] can be used to build and install packages from source.<br />
<br />
First, refresh the freetype2 PKGBUILD as root:<br />
<br />
# abs extra/freetype2<br />
<br />
This example uses {{ic|/var/abs/build}} as the build directory, substitute it according to your personal ABS setup. Download and extract the freetype2 package as a regular user:<br />
<br />
$ cd /var/abs/build<br />
$ cp -r ../extra/freetype2 .<br />
$ cd freetype2<br />
$ makepkg -o<br />
<br />
Edit the file {{ic|src/freetype-VERSION/src/base/ftlcdfil.c}} and look up the definition of the constant {{ic|default_filter[5]}}:<br />
<br />
static const FT_Byte default_filter[5] =<br />
{ 0x10, 0x40, 0x70, 0x40, 0x10 };<br />
<br />
This constant defines a low-pass filter applied to the rendered glyph. Modify it as needed. Save the file, build and install the custom package:<br />
<br />
$ makepkg -e<br />
# pacman -Rd freetype2<br />
# pacman -U freetype2-VERSION-ARCH.pkg.tar.xz<br />
<br />
Reboot or restart X. The lcddefault filter should now render fonts differently.<br />
<br />
=== Disable auto-hinter for bold fonts ===<br />
<br />
The auto-hinter uses sophisticated methods for font rendering, but often makes bold fonts too wide. Fortunately, a solution can be turning off the autohinter for bold fonts while leaving it on for the rest:<br />
...<br />
<match target="font"><br />
<test name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<edit name="autohint" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
...<br />
<br />
=== Enable anti-aliasing only for bigger fonts ===<br />
<br />
Some users prefer the sharper rendering that anti-aliasing does not offer:<br />
<br />
{{bc|<nowiki><br />
...<br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="size" qual="any" compare="more"><br />
<double>12</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="pixelsize" qual="any" compare="more"><br />
<double>16</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
...<br />
</nowiki>}}<br />
<br />
=== Replace fonts ===<br />
<br />
The most reliable way to do this is to add an XML fragment similar to the one below. ''Using the "binding" attribute will give you better results'', for example, in Firefox where you may not want to change properties of font being replaced. This will cause Ubuntu to be used in place of Georgia:<br />
...<br />
<match target="pattern"><br />
<test qual="any" name="family"><string>georgia</string></test><br />
<edit name="family" mode="assign" binding="same"><string>Ubuntu</string></edit><br />
</match><br />
...<br />
An alternate approach is to set the "preferred" font, but ''this only works if the original font is not on the system'', in which case the one specified will be substituted:<br />
...<br />
< !-- Replace Helvetica with Bitstream Vera Sans Mono --><br />
< !-- Note, an alias for Helvetica should already exist in default conf files --><br />
<alias><br />
<family>Helvetica</family><br />
<prefer><family>Bitstream Vera Sans Mono</family></prefer><br />
<default><family>fixed</family></default><br />
</alias><br />
...<br />
<br />
=== Disable bitmap fonts ===<br />
<br />
To disable bitmap fonts in fontconfig, use {{ic|70-no-bitmaps.conf}} (which is not placed by fontconfig by default):<br />
<br />
# cd /etc/fonts/conf.d<br />
# rm 70-yes-bitmaps.conf<br />
# ln -s ../conf.avail/70-no-bitmaps.conf<br />
<br />
This oneliner should also work:<br />
<br />
# ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d/<br />
<br />
You may not need to remove {{ic|70-yes-bitmaps.conf}} if it does not exist. You can choose which fonts to replace bitmaps fonts with (Helvetica, Courier and Times bitmap mapts to TTF fonts) by:<br />
<br />
# cd /etc/fonts/conf.d<br />
# ln -s ../conf.avail/29-replace-bitmap-fonts.conf<br />
<br />
<div id="EmbeddedBitmap">To disable embedded bitmap for all fonts:<div><br />
<br />
{{hc|~/.config/fontconfig/conf.d/20-no-embedded.conf|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<match target="font"><br />
<edit name="embeddedbitmap" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
To disable embedded bitmap fonts for a specific font:<br />
<br />
<match target="font"><br />
<test qual="any" name="family"><br />
<string>Monaco</string><br />
</test><br />
<edit name="embeddedbitmap"><bool>false</bool></edit><br />
</match><br />
<br />
=== Disable scaling of bitmap fonts ===<br />
<br />
To disable scaling of bitmap fonts (which often makes them blurry), remove {{ic|/etc/fonts/conf.d/10-scale-bitmap-fonts.conf}}.<br />
<br />
=== Create bold and italic styles for incomplete fonts ===<br />
<br />
Freetype has the ability to automatically create ''italic'' and '''bold''' styles for fonts that do not have them, but only if explicitly required by the application. Given programs rarely send these requests, this section covers manually forcing generation of missing styles.<br />
<br />
Start by editing {{ic|/usr/share/fonts/fonts.cache-1}} as explained below. Store a copy of the modifications on another file, because a font update with {{ic|fc-cache}} will overwrite {{ic|/usr/share/fonts/fonts.cache-1}}.<br />
<br />
Assuming the Dupree font is installed:<br />
"dupree.ttf" 0 "Dupree:style=Regular:slant=0:weight=80:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Duplicate the line, change {{ic|<nowiki>style=Regular</nowiki>}} to {{ic|<nowiki>style=Bold</nowiki>}} or any other style. Also change {{ic|<nowiki>slant=0</nowiki>}} to {{ic|<nowiki>slant=100</nowiki>}} for italic, {{ic|<nowiki>weight=80</nowiki>}} to {{ic|<nowiki>weight=200</nowiki>}} for bold, or combine them for '''''bold italic''''':<br />
"dupree.ttf" 0 "Dupree:style=Bold Italic:slant=100:weight=200:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Now add necessary modifications to {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}:<br />
{{bc|<nowiki><br />
...<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="weight" compare="more_eq"><int>140</int></test><br />
<edit name="embolden" mode="assign"><bool>true</bool></edit><br />
</match><br />
<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="slant" compare="more_eq"><int>80</int></test><br />
<edit name="matrix" mode="assign"><br />
<times><br />
<name>matrix</name><br />
<matrix><br />
<double>1</double><double>0.2</double><br />
<double>0</double><double>1</double><br />
</matrix><br />
</times><br />
</edit><br />
</match><br />
...<br />
</nowiki>}}<br />
{{Tip| Use the value 'embolden' for existing bold fonts in order to make them even bolder.}}<br />
<br />
=== Change rule overriding ===<br />
<br />
Fontconfig processes files in {{ic|/etc/fonts/conf.d}} in numerical order. This enables rules or files to override one another, but often confuses users about what file gets parsed last.<br />
<br />
To guarantee that personal settings take precedence over any other rules, change their ordering:<br />
# cd /etc/fonts/conf.d<br />
# mv 50-user.conf 99-user.conf<br />
<br />
This change seems however to be unnecessary for the most of the cases, because a user is given enough control by default to set up own font preferences, hinting and antialiasing properties, alias new fonts to generic font families, etc.<br />
<br />
=== Example fontconfig configurations ===<br />
<br />
Example fontconfig configurations can be found on this [[Font_Configuration/fontconfig_Examples|page]].<br />
<br />
A simple starting point:<br />
<br />
{{hc|/etc/fonts/local.conf|<nowiki><br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'><br />
<fontconfig><br />
<match target="font"><br />
<edit mode="assign" name="antialias"><br />
<bool>true</bool><br />
</edit><br />
<edit mode="assign" name="embeddedbitmap"><br />
<bool>false</bool><br />
</edit><br />
<edit mode="assign" name="hinting"><br />
<bool>true</bool><br />
</edit><br />
<edit mode="assign" name="hintstyle"><br />
<const>hintslight</const><br />
</edit><br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
<edit mode="assign" name="rgba"><br />
<const>rgb</const><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
== Patched packages ==<br />
<br />
These patched packages are available in the [[Arch User Repository|AUR]]. A few considerations:<br />
<br />
* Configuration is usually necessary.<br />
* The new font rendering will not kick in until applications restart.<br />
* Applications which [[Wikipedia:Static library|statically link]] to a library will not be affected by patches applied to the system library.<br />
<br />
=== Infinality ===<br />
<br />
The infinality patchset aims to greatly improve freetype2 font rendering. It adds multiple new capabilities.<br />
<br />
* [http://www.infinality.net/blog/infinality-freetype-patches/ Home page]<br />
* [http://www.infinality.net/forum/ Forum]<br />
* [http://www.webupd8.org/2013/06/better-font-rendering-in-linux-with.html Short article about infinality (contains screenshots)]<br />
<br />
Infinality's settings are all configurable at runtime via environment variables in {{ic|/etc/profile.d/infinality-settings.sh}}, and include the following:<br />
<br />
*'''Emboldening Enhancement''': Disables Y emboldening, producing a much nicer result on fonts without bold versions. Works on native TT hinter and autohinter.<br />
*'''Auto-Autohint''': Automatically forces autohint on fonts that contain no TT instructions.<br />
*'''Autohint Enhancement''': Makes autohint snap horizontal stems to pixels. Gives a result that appears like a well-hinted truetype font, but is 100% patent-free (as far as I know).<br />
*'''Customized FIR Filter''': Select your own [http://www.infinality.net/forum/viewtopic.php?f=2&t=19 filter values] at run-time. Works on native TT hinter and autohinter.<br />
*'''Stem Alignment''': Aligns bitmap glyphs to optimized pixel boundaries. Works on native TT hinter and autohinter.<br />
*'''Pseudo Gamma Correction''': Lighten and darken glyphs at a given value, below a given size. Works on native TT hinter and autohinter.<br />
*'''Embolden Thin Fonts''': Embolden thin or light fonts so that they are more visible. Works on autohinter.<br />
*'''Force Slight Hinting''': Force slight hinting even when programs want full hinting. If you use the local.conf I provide (included in infinality-settings fedora package) you will notice nice improvements on @font-face fonts.<br />
*'''ChromeOS Style Sharpening''': ChromeOS uses a patch to sharpen the look of fonts. This is now included in the infinality patchset.<br />
<br />
A number of presets are included and can be used by setting the USE_STYLE variable in {{ic|/etc/profile.d/infinality-settings.sh}}.<br />
<br />
==== Installation and configuration ====<br />
{{Tip|All AUR packages in this section can also be downloaded from bohoomil's custom repository. See the [[#Install from custom repository|section below]] for how to enable this repository.}}<br />
{{Note|If you have been using fontconfig-infinality-ultimate < 2.11.0-2, you need to re-install (not upgrade!) fontconfig-infinality-ultimate package:<br />
pacman -Rdd fontconfig-infinality-ultimate<br />
pacman -S fontconfig-infinality-ultimate<br />
}}<br />
{{AUR|freetype2-infinality}} can be installed from the [[Arch User Repository|AUR]]. If you are a multilib user, also install {{AUR|lib32-freetype2-infinality}} from the AUR. The AUR also contains the latest development snapshot of freetype2 with the Infinality patchset: {{AUR|freetype2-infinality-git}} and {{AUR|lib32-freetype2-infinality-git}}.<br />
<br />
It is recommended to also install {{AUR|fontconfig-infinality}} to enable selection of predefined font substitution styles and antialiasing settings, apart from the rendering settings of the engine itself. After doing so, you can select the font style (win7, winxp, osx, linux, ...) with:<br />
# infctl setstyle<br />
<br />
If you set e.g. win7 or osx you need the corresponding fonts installed.<br />
<br />
{{Note|<br />
* The user bohoomil maintains a very good configuration in his [https://github.com/bohoomil/fontconf github repo] which is available as {{AUR|fontconfig-infinality-ultimate-git}} in the AUR.<br />
* Install {{AUR|grip-git}} from the AUR to have a realtime font preview.<br />
* Default infinality settings can cause some programs to display fonts at 72 DPI instead of 96. If you notice a problem open {{ic|/etc/fonts/infinality/infinality.conf}} search for the section on DPI and change 72 to 96. This problem can specifically affect conky causing the fonts to appear smaller than they should. Thus not aligning properly with images.<br />
* ''The README for {{AUR|fontconfig-infinality}} says that /etc/fonts/local.conf should either not exist, or have no infinality-related configurations in it. The local.conf is now obsolete and completely replaced by this configuration.''<br />
}}<br />
<br />
for more information see this article: http://www.infinality.net/forum/viewtopic.php?f=2&t=77<br />
<br />
==== Install from custom repository ====<br />
<br />
bohoomil also maintains '''infinality-bundle''' repository, offering three basic libraries (freetype2-infinality-ultimate, fontconfig-infinality-ultimate & cairo-infinality-ultimate) as pre-patched, pre-configured and pre-built binaries for all architectures (i686, x86_64, multilib). There is also an additional repository avaiable, '''infinality-bundle-fonts''', offering a collection of entirely free, high quality typefaces, replacing common proprietary font families. Using '''infinality-bundle''' and '''infinality-bundle-fonts''' makes the whole installation and configuration process dramatically simplified (i.e., it lets you skip most steps necessary to install and configure fonts in your system).<br />
<br />
Please, see [[Infinality-bundle+fonts]] for more information and installation instructions.<br />
<br />
=== Ubuntu ===<br />
<br />
Ubuntu adds extra configurations, and occasionally patches to the font rendering libraries.<br />
<br />
Install the patched packages from the [[Arch User Repository|AUR]], the package names are: {{AUR|freetype2-ubuntu}} {{AUR|fontconfig-ubuntu}} {{AUR|cairo-ubuntu}}.<br />
<br />
The global configuration will need to be added. See [[#Example fontconfig configurations]] for a starting point.<br />
Ubuntu rendering works the best with ''hintslight'' option.<br />
<br />
Note that the *-ubuntu AUR packages need to be kept up-to-date by the user, and will not be updated by pacman along with other packages. The whole graphical system can become inoperable if the user-installed core graphical libraries become incompatible with the official repository applications.<br />
<br />
=== Reverting to unpatched packages ===<br />
<br />
To restore the unpatched packages, reinstall the originals:<br />
<br />
# pacman -S --asdeps freetype2 cairo fontconfig<br />
<br />
== Applications without fontconfig support ==<br />
<br />
Some applications like [[URxvt]] will ignore fontconfig settings. This is very apparent when using the infinality patches which are heavily reliant on proper configuration. You can work around this by using {{ic|~/.Xresources}}, but it is not nearly as flexible as fontconfig. Example (see [[#Fontconfig configuration]] for explanations of the options):<br />
<br />
{{hc|~/.Xresources|<nowiki><br />
Xft.autohint: 0<br />
Xft.lcdfilter: lcddefault<br />
Xft.hintstyle: hintfull<br />
Xft.hinting: 1<br />
Xft.antialias: 1<br />
Xft.rgba: rgb<br />
</nowiki>}}<br />
<br />
Make sure the settings are loaded properly when X starts with {{ic|xrdb -q}} (see [[Xresources]] for more information).<br />
<br />
== Troubleshooting ==<br />
<br />
=== Distorted fonts ===<br />
<br />
{{Note|96 DPI is not a standard. You should use your monitor's actual DPI to get proper font rendering, especially when using subpixel rendering.}}<br />
<br />
If fonts are still unexpectedly large or small, poorly proportioned or simply rendering poorly, fontconfig may be using the incorrect DPI.<br />
<br />
Fontconfig should be able to detect DPI parameters as discovered by the Xorg server. You can check the automatically discovered DPI with {{ic|xdpyinfo}} (provided by the {{pkg|xorg-xdpyinfo}} package):<br />
<br />
{{hc|<nowiki>$ xdpyinfo | grep dots</nowiki>|<br />
resolution: 102x102 dots per inch<br />
}}<br />
<br />
If the DPI is detected incorrectly (usually due to an incorrect monitor EDID), you can specify it manually in the Xorg configuration, see [[Xorg#Display size and DPI]]. This is the recommended solution, but it may not work with buggy drivers.<br />
<br />
Fontconfig will default to the Xft.dpi variable if it is set. Xft.dpi is usually set by desktop environments (usually to Xorg's DPI setting) or manually in {{ic|~/.Xdefaults}} or {{ic|~/.Xresources}}. Use xrdb to query for the value:<br />
<br />
{{hc|<nowiki>$ xrdb -query | grep dpi</nowiki>|<br />
Xft.dpi: 102<br />
}}<br />
<br />
Those still having problems can fall back to manually setting the DPI used by fontconfig:<br />
<br />
...<br />
<!-- Setup for DPI=96 --><br />
<match target="pattern"><br />
<edit name="dpi" mode="assign"><double>102</double></edit><br />
</match><br />
...<br />
<br />
=== Calibri, Cambria, Monaco, etc. not rendering properly ===<br />
<br />
Some scalable fonts have embedded bitmap versions which are rendered instead, mainly at smaller sizes. Force using scalable fonts at all sizes by [[#EmbeddedBitmap|#Disabling embedded bitmap]].<br />
<br />
=== Older GTK and QT applications ===<br />
<br />
Modern GTK apps enable Xft by default but this was not the case before version 2.2. If it is not possible to update these applications, force Xft for old [[GNOME]] applications by adding to {{ic|~/.bashrc}}:<br />
<br />
export GDK_USE_XFT=1<br />
<br />
For older QT applications:<br />
<br />
export QT_XFT=true<br />
<br />
=== Applications overriding hinting ===<br />
<br />
Some applications may override default fontconfig hinting and anti-aliasing settings. This may happen with [[Gnome]] 3, for example. Use the specific configuration program for the application in such cases. For gnome, try {{pkg|gnome-tweak-tool}}.<br />
<br />
== See also ==<br />
<br />
* [http://www.x.org/X11R6.8.2/doc/fonts.html Fonts in X11R6.8.2] - Official Xorg font information<br />
* [http://freetype.sourceforge.net/freetype2/ FreeType 2 overview]<br />
* [https://forums.gentoo.org/viewtopic-t-723341.html Gentoo font-rendering thread]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Arduino&diff=291895Arduino2014-01-07T16:40:29Z<p>Sushi Dude: Fixed spelling error.</p>
<hr />
<div>[[Category:Development]]<br />
[[Category:Mathematics and science]]<br />
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It is intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. More information is available on the [http://www.arduino.cc/ Arduino HomePage].<br />
<br />
== Installation ==<br />
<br />
{{Warning|Arduino 1.0.5 has an [https://github.com/arduino/Arduino/issues/1609 issue] that prevents uploading to Arduino boards, it is recommend that you download the JSCC nightly build [http://downloads.arduino.cc/arduino-jssc-nightly-linux32.tgz 32-bit] or [http://downloads.arduino.cc/arduino-nightly-linux64.tgz 64-bit version] until 1.5.6 BETA is released. You will also need to have {{pkg|libusb-compat}} installed.}}<br />
<br />
* Install {{AUR|arduino}} from the [[AUR]].<br />
* Add yourself to the {{ic|uucp}} [[Users and Groups|group]]. (More information in the next section: "Accessing serial")<br />
<br />
=== Intel Galileo ===<br />
<br />
The version of the Arduino IDE that supports the Intel Galileo board can be downloaded [https://communities.intel.com/community/makers/software/drivers here].<br />
<br />
== Configuration ==<br />
<br />
=== Accessing serial ===<br />
<br />
The arduino board communicates with the computer via a serial connection or a serial over USB connection. So the user needs read/write access to the serial device file. [[Udev]] creates files in /dev/tts/ owned by group uucp so adding the user to the uucp group gives the required read/write access.<br />
<br />
gpasswd -a $USER uucp<br />
<br />
{{Note|You will have to logout and login again for this to take effect.}}<br />
<br />
Before uploading to the Arduino, be sure to set the correct serial port, board, and processor from the Tools menu.<br />
<br />
== stty ==<br />
<br />
Preparing:<br />
# stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts<br />
<br />
Sending commands through Terminal without new line after command<br />
# echo -n "Hello World" > /dev/ttyACM0<br />
{{Note| As autoreset on serial connection is activated by default on most boards, you need to disable this feature if you want to communicate directly with your board with the last command instead of a terminal emulator (arduino IDE, screen, picocom...). If you have a Leonardo board, you are not concerned by this, because it does not autoreset. If you have a Uno board, connect a 10 µF capacitor between the RESET and GND pins. If you have another board, connect a 120 ohms resistor between the RESET and 5V pins. See http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection for more details.}}<br />
<br />
Reading what your Arduino has to tell you<br />
$ cat /dev/ttyACM0<br />
<br />
== Alternatives for IDE ==<br />
<br />
=== ArduIDE ===<br />
<br />
ArduIDE is a Qt-based IDE for Arduino. {{AUR|arduide-git}} is available in the [[AUR]].<br />
<br />
If you prefer working from terminal, below there are some other options to choose from.<br />
<br />
=== Arduino-CMake ===<br />
<br />
Using [https://github.com/queezythegreat/arduino-cmake arduino-cmake] and [http://www.cmake.org/cmake/resources/software.html CMake] you can build Arduino firmware from the command line using multiple build systems. CMake lets you generate the build system that fits your needs, using the tools you like. It can generate any type of build system, from simple Makefiles, to complete projects for Eclipse, Visual Studio, XCode, etc.<br />
<br />
Requirements:<br />
* [https://www.archlinux.org/packages/?sort=&q=cmake CMake]<br />
* [https://aur.archlinux.org/packages.php?ID=8388 Arduino SDK]<br />
* [https://www.archlinux.org/packages/?sort=&q=gcc-avr gcc-avr]<br />
* [https://www.archlinux.org/packages/?sort=&q=binutils-avr binutils-avr]<br />
* [https://www.archlinux.org/packages/?sort=&q=avr-libc avr-libc]<br />
* [https://www.archlinux.org/packages/?sort=&q=avrdude avrdude]<br />
<br />
=== gnoduino ===<br />
<br />
{{aur|gnoduino}} is an implementation of original Arduino IDE for GNOME available in the [[AUR]]. The original Arduino IDE software is written in Java. This is a Python implementation and it is targeted at GNOME but will work on xfce4 and other WM. Its purpose is to be light, while maintaining compatibility with the original Arduino IDE. The source editor is based on gtksourceview.<br />
<br />
=== Ino ===<br />
<br />
[https://github.com/amperka/ino Ino] is a command line toolkit for working with arduino hardware. {{AUR|ino}} is available in the [[AUR]].<br />
<br />
=== Makefile ===<br />
<br />
{{Note|Update 2011-03-12. Arduino Is not shipping a Makefile with version (22). The Makefile from the [http://code.google.com/p/dogm128/source/browse/libraries/Dogm/examples/SpaceTrash/Makefile.uno_dogs102 dogm128] project works for me though.}}<br />
<br />
Instead of using the Arduino IDE it is possible to use another editor and a Makefile.<br />
<br />
Set up a directory to program your Arduino and copy the Makefile into this directory. A copy of the Makefile can be obtained from /usr/share/arduino/hardware/cores/arduino/Makefile<br />
<br />
You will have to modify this a little bit to reflect your settings. The makefile should be pretty self explainatory. Here are some lines you may have to edit.<br />
<br />
PORT = usually /dev/ttyUSBx, where x is the usb serial port your arduino is plugged into<br />
TARGET = your sketch's name<br />
ARDUINO = /usr/share/arduino/lib/targets/arduino<br />
<br />
Depending on which library functions you call in your sketch, you may need to compile parts of the library. To do that you need to edit your SRC and CXXSRC to include the required libraries.<br />
<br />
Now you should be able to make && make upload to your board to execute your sketch.<br />
<br />
=== Scons ===<br />
<br />
Using [http://www.scons.org/ scons] together with [https://github.com/suapapa/arscons arscons] it is very easy to use to compile and upload Arduino projects from the command line. Scons is based on python and you will need python-pyserial to use the serial interface. Install {{Pkg|python-pyserial}} and {{Pkg|scons}}.<br />
<br />
That will get the dependencies you need too. You will also need Arduino itself so install it as described above. Create project directory (eg. test), then create a arduino project file in your new directory. Use the same name as the directory and add .ino (eg. test.ino). Get the [https://github.com/suapapa/arscons/blob/master/SConstruct SConstruct] script from arscons and put it in your directory. Have a peek in it and, if necessary, edit it. It is a python script. Edit your project as you please, then run<br />
<br />
$ scons # This will build the project<br />
$ scons upload # This will upload the project to your Arduino<br />
<br />
== Troubleshooting ==<br />
<br />
=== Consistent naming of Arduino devices ===<br />
<br />
If you have more than one arduino you may have noticed that they names /dev/ttyUSB[0-9] are assigned in the order of connection. In the IDE this is not so much of a problem, but when you have programmed your own software to communicate with an arduino project in the background this can be annoying. Use the following udev rules to assign static symlinks to your arduino's:<br />
{{hc|/etc/udev/rules.d/52-arduino.rules|<nowiki><br />
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="sensors/ftdi_%s{serial}"<br />
</nowiki>}}<br />
Your arduino's will be available under names like "/dev/sensors/ftdi_A700dzaF". If you want you can also assign more meaningfull names to several devices like this:<br />
{{hc|/etc/udev/rules.d/52-arduino.rules|<nowiki><br />
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A700dzaF", SYMLINK+="arduino/nano"<br />
</nowiki>}}<br />
which will create a symlink in /dev/arduino/nano to the device with the specified serialnumber.<br />
You do need to unplug and replug your arduino for this to take effect or run<br />
udevadm trigger<br />
<br />
=== Error opening serial port ===<br />
<br />
You may see the serial port initially when the IDE starts, but the TX/RX leds do nothing when uploading. You may have previously changed the baudrate in the serial monitor to something it does not like. Edit ~/.arduino/preferences.txt so that serial.debug_rate is a different speed, like 115200.<br />
<br />
=== Permissions to open serial port and create lockfile ===<br />
<br />
Arduino uses java-rxtx to do the serial communications. It expects to create lock files in /var/lock/lockdev, so you need to be in the <tt>lock</tt> group. USB serial devices such as /dev/ttyUSB0 or /dev/ttyACM0 will often be assigned to the <tt>uucp</tt> group, so as long as you are adding yourself to groups, you should add that one too.<br />
<br />
=== Missing twi.o ===<br />
<br />
If the file /usr/share/arduino/lib/targets/libraries/Wire/utility/twi.o does not exist arduino may try to create it. Normal users do not have permission to write there so this will fail. Run arduino as root so it can create the file, after the file has been created arduino can be run under a normal user.<br />
<br />
=== Working with Uno/Mega2560 ===<br />
<br />
The Arduino Uno and Mega2560 have an onboard USB interface (an Atmel 8U2) that accepts serial data, so they are accessed through /dev/ttyACM0 created by the cdc-acm kernel module when it is plugged in.<br />
<br />
The 8U2 firmware may need an update to ease serial communications. See [http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286350399] for more details and reply #11 for a fix. The original arduino bbs, where you can find an image explaining how to get your Uno into DFU, is now in a read-only state. If you do not have an account to view the image, see [http://www.scribd.com/doc/45913857/Arduino-UNO].<br />
<br />
You can perform a general function test of the Uno by putting it in loopback mode and typing characters into the arduino serial monitor at 115200 baud. It should echo the characters back to you. To put it in loopback, short pins 0 -> 1 on the digital side and either hold the reset button or short the GND -> RESET pins while you type.<br />
<br />
== See also ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?pid=295312<br />
* https://bbs.archlinux.org/viewtopic.php?pid=981348<br />
* http://answers.ros.org/question/9097/how-can-i-get-a-unique-device-path-for-my-arduinoftdi-device/</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Arduino&diff=285100Arduino2013-11-28T15:47:54Z<p>Sushi Dude: Undo revision 285028 by Gmzamz (talk) This should be submitted to the arduino AUR package maintainer.</p>
<hr />
<div>[[Category:Development]]<br />
[[Category:Mathematics and science]]<br />
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It is intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. More information is available on the [http://www.arduino.cc/ Arduino HomePage].<br />
<br />
== Installation ==<br />
<br />
{{Warning|Arduino 1.0.5 has an [https://github.com/arduino/Arduino/issues/1609 issue] that prevents uploading to Arduino boards, it is recommend that you download the [http://downloads.arduino.cc/arduino-jssc-nightly-linux32.tgz JSSC nightly build] until 1.5.6 BETA is released. You will also need to have {{pkg|libusb-compat}} installed.}}<br />
<br />
* Install {{AUR|arduino}} from the [[AUR]].<br />
* Add yourself to the {{ic|uucp}} [[Users and Groups|group]]. (More information in the next section: "Accessing serial")<br />
<br />
=== Intel Galileo ===<br />
<br />
The version of the Arduino IDE that support the Intel Galileo board can be downloaded [https://communities.intel.com/community/makers/software/drivers here].<br />
<br />
== Configuration ==<br />
<br />
=== Accessing serial ===<br />
<br />
The arduino board communicates with the computer via a serial connection or a serial over USB connection. So the user needs read/write access to the serial device file. [[Udev]] creates files in /dev/tts/ owned by group uucp so adding the user to the uucp group gives the required read/write access.<br />
<br />
gpasswd -a $USER uucp<br />
<br />
{{Note|You will have to logout and login again for this to take effect.}}<br />
<br />
Before uploading to the Arduino, be sure to set the correct serial port, board, and processor from the Tools menu.<br />
<br />
== stty ==<br />
<br />
Preparing:<br />
# stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts<br />
<br />
Sending commands through Terminal without new line after command<br />
# echo -n "Hello World" > /dev/ttyACM0<br />
{{Note| As autoreset on serial connection is activated by default on most boards, you need to disable this feature if you want to communicate directly with your board with the last command instead of a terminal emulator (arduino IDE, screen, picocom...). If you have a Leonardo board, you are not concerned by this, because it does not autoreset. If you have a Uno board, connect a 10 µF capacitor between the RESET and GND pins. If you have another board, connect a 120 ohms resistor between the RESET and 5V pins. See http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection for more details.}}<br />
<br />
Reading what your Arduino has to tell you<br />
$ cat /dev/ttyACM0<br />
<br />
== Alternatives for IDE ==<br />
<br />
=== ArduIDE ===<br />
<br />
ArduIDE is a Qt-based IDE for Arduino. {{AUR|arduide-git}} is available in the [[AUR]].<br />
<br />
If you prefer working from terminal, below there are some other options to choose from.<br />
<br />
=== Arduino-CMake ===<br />
<br />
Using [https://github.com/queezythegreat/arduino-cmake arduino-cmake] and [http://www.cmake.org/cmake/resources/software.html CMake] you can build Arduino firmware from the command line using multiple build systems. CMake lets you generate the build system that fits your needs, using the tools you like. It can generate any type of build system, from simple Makefiles, to complete projects for Eclipse, Visual Studio, XCode, etc.<br />
<br />
Requirements:<br />
* [https://www.archlinux.org/packages/?sort=&q=cmake CMake]<br />
* [https://aur.archlinux.org/packages.php?ID=8388 Arduino SDK]<br />
* [https://www.archlinux.org/packages/?sort=&q=gcc-avr gcc-avr]<br />
* [https://www.archlinux.org/packages/?sort=&q=binutils-avr binutils-avr]<br />
* [https://www.archlinux.org/packages/?sort=&q=avr-libc avr-libc]<br />
* [https://www.archlinux.org/packages/?sort=&q=avrdude avrdude]<br />
<br />
=== gnoduino ===<br />
<br />
{{aur|gnoduino}} is an implementation of original Arduino IDE for GNOME available in the [[AUR]]. The original Arduino IDE software is written in Java. This is a Python implementation and it is targeted at GNOME but will work on xfce4 and other WM. Its purpose is to be light, while maintaining compatibility with the original Arduino IDE. The source editor is based on gtksourceview.<br />
<br />
=== Ino ===<br />
<br />
[https://github.com/amperka/ino Ino] is a command line toolkit for working with arduino hardware. {{AUR|ino}} is available in the [[AUR]].<br />
<br />
=== Makefile ===<br />
<br />
{{Note|Update 2011-03-12. Arduino Is not shipping a Makefile with version (22). The Makefile from the [http://code.google.com/p/dogm128/source/browse/libraries/Dogm/examples/SpaceTrash/Makefile.uno_dogs102 dogm128] project works for me though.}}<br />
<br />
Instead of using the Arduino IDE it is possible to use another editor and a Makefile.<br />
<br />
Set up a directory to program your Arduino and copy the Makefile into this directory. A copy of the Makefile can be obtained from /usr/share/arduino/hardware/cores/arduino/Makefile<br />
<br />
You will have to modify this a little bit to reflect your settings. The makefile should be pretty self explainatory. Here are some lines you may have to edit.<br />
<br />
PORT = usually /dev/ttyUSBx, where x is the usb serial port your arduino is plugged into<br />
TARGET = your sketch's name<br />
ARDUINO = /usr/share/arduino/lib/targets/arduino<br />
<br />
Depending on which library functions you call in your sketch, you may need to compile parts of the library. To do that you need to edit your SRC and CXXSRC to include the required libraries.<br />
<br />
Now you should be able to make && make upload to your board to execute your sketch.<br />
<br />
=== Scons ===<br />
<br />
Using [http://www.scons.org/ scons] together with [https://github.com/suapapa/arscons arscons] it is very easy to use to compile and upload Arduino projects from the command line. Scons is based on python and you will need python-pyserial to use the serial interface. Install {{Pkg|python-pyserial}} and {{Pkg|scons}}.<br />
<br />
That will get the dependencies you need too. You will also need Arduino itself so install it as described above. Create project directory (eg. test), then create a arduino project file in your new directory. Use the same name as the directory and add .ino (eg. test.ino). Get the [https://github.com/suapapa/arscons/blob/master/SConstruct SConstruct] script from arscons and put it in your directory. Have a peek in it and, if necessary, edit it. It is a python script. Edit your project as you please, then run<br />
<br />
$ scons # This will build the project<br />
$ scons upload # This will upload the project to your Arduino<br />
<br />
== Troubleshooting ==<br />
<br />
=== Consistent naming of Arduino devices ===<br />
<br />
If you have more than one arduino you may have noticed that they names /dev/ttyUSB[0-9] are assigned in the order of connection. In the IDE this is not so much of a problem, but when you have programmed your own software to communicate with an arduino project in the background this can be annoying. Use the following udev rules to assign static symlinks to your arduino's:<br />
{{hc|/etc/udev/rules.d/52-arduino.rules|<nowiki><br />
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="sensors/ftdi_%s{serial}"<br />
</nowiki>}}<br />
Your arduino's will be available under names like "/dev/sensors/ftdi_A700dzaF". If you want you can also assign more meaningfull names to several devices like this:<br />
{{hc|/etc/udev/rules.d/52-arduino.rules|<nowiki><br />
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A700dzaF", SYMLINK+="arduino/nano"<br />
</nowiki>}}<br />
which will create a symlink in /dev/arduino/nano to the device with the specified serialnumber.<br />
You do need to unplug and replug your arduino for this to take effect or run<br />
udevadm trigger<br />
<br />
=== Error opening serial port ===<br />
<br />
You may see the serial port initially when the IDE starts, but the TX/RX leds do nothing when uploading. You may have previously changed the baudrate in the serial monitor to something it does not like. Edit ~/.arduino/preferences.txt so that serial.debug_rate is a different speed, like 115200.<br />
<br />
=== Missing twi.o ===<br />
<br />
If the file /usr/share/arduino/lib/targets/libraries/Wire/utility/twi.o does not exist arduino may try to create it. Normal users do not have permission to write there so this will fail. Run arduino as root so it can create the file, after the file has been created arduino can be run under a normal user.<br />
<br />
=== Working with Uno/Mega2560 ===<br />
<br />
The Arduino Uno and Mega2560 have an onboard USB interface (an Atmel 8U2) that accepts serial data, so they are accessed through /dev/ttyACM0 created by the cdc-acm kernel module when it is plugged in.<br />
<br />
The 8U2 firmware may need an update to ease serial communications. See [http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286350399] for more details and reply #11 for a fix. The original arduino bbs, where you can find an image explaining how to get your Uno into DFU, is now in a read-only state. If you do not have an account to view the image, see [http://www.scribd.com/doc/45913857/Arduino-UNO].<br />
<br />
You can perform a general function test of the Uno by putting it in loopback mode and typing characters into the arduino serial monitor at 115200 baud. It should echo the characters back to you. To put it in loopback, short pins 0 -> 1 on the digital side and either hold the reset button or short the GND -> RESET pins while you type.<br />
<br />
== See also ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?pid=295312<br />
* https://bbs.archlinux.org/viewtopic.php?pid=981348<br />
* http://answers.ros.org/question/9097/how-can-i-get-a-unique-device-path-for-my-arduinoftdi-device/</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Font_configuration&diff=283999Font configuration2013-11-21T23:16:04Z<p>Sushi Dude: Fixed formating in example fontconfig configuration.</p>
<hr />
<div>[[Category:Fonts]]<br />
[[it:Font Configuration]]<br />
[[ja:Font Configuration]]<br />
[[ru:Font Configuration]]<br />
[[sr:Font Configuration]]<br />
[[tr:Yazıtipi_yapılandırması]]<br />
[[zh-CN:Font Configuration]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of font configuration options and various techniques for improving the readability of fonts}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Fonts}}: Information on adding fonts and font recommendations<br />
{{Article summary wiki|Font Configuration/fontconfig Examples}}<br />
{{Article summary wiki|Java Runtime Environment Fonts}}: Fonts specific to Sun's Java machine<br />
{{Article summary wiki|MS Fonts}}: Adding Microsoft fonts and mimicking Windows' font settings<br />
{{Article summary wiki|X Logical Font Description}}: The older core font system for X<br />
{{Article summary end}}<br />
<br />
Fontconfig is a library designed to provide a list of available [[fonts]] to applications, and also for configuration for how fonts get rendered. See package {{Pkg|fontconfig}} and [[Wikipedia:Fontconfig]]. The Free type library ({{Pkg|freetype2}} package) renders the fonts, based on this configuration.<br />
<br />
Though Fontconfig is the standard in today's Linux, some applications still rely on the original method of font selection and display, the [[X Logical Font Description]].<br />
<br />
The font rendering packages on Arch Linux includes support for ''freetype2'' with the bytecode interpreter (BCI) enabled. Patched packages exist for better font rendering, especially with an LCD monitor. See [[#Patched packages]] below. The [[#Infinality|Infinality]] package allows both auto-hinting and subpixel rendering, allows the LCD filter to be tweaked without recompiling, and allows the auto-hinter to work well with bold fonts.<br />
<br />
== Font paths ==<br />
<br />
For fonts to be known to applications, they must be cataloged for easy and quick access.<br />
<br />
The font paths initially known to Fontconfig are: {{ic|/usr/share/fonts/}} and {{ic|~/.fonts/}} (of which Fontconfig will scan recursively). For ease of organization and installation, it is recommended to use these font paths when [[Fonts#Installation|adding fonts]].<br />
<br />
To see a list of known Fontconfig fonts:<br />
$ fc-list : file<br />
<br />
See {{ic|man fc-list}} for more out put format.<br />
<br />
Check for Xorg's known font paths by reviewing its log:<br />
$ grep /fonts /var/log/Xorg.0.log<br />
<br />
{{Tip|You can also check the list of [[Xorg]]'s known font paths using the command {{ic|xset q}}.}}<br />
<br />
Keep in mind that Xorg does not search recursively through the {{ic|/usr/share/fonts/}} directory like Fontconfig does. To add a path, the full path must be used:<br />
Section "Files"<br />
FontPath "/usr/share/fonts/local/"<br />
EndSection<br />
<br />
If you want font paths to be set on a per-user basis, you can add and remove font paths from the default by adding the following line(s) to {{ic|~/.xinitrc}}:<br />
xset +fp /usr/share/fonts/local/ # Prepend a custom font path to Xorg's list of known font paths<br />
xset -fp /usr/share/fonts/sucky_fonts/ # Remove the specified font path from Xorg's list of known font paths<br />
<br />
To see a list of known Xorg fonts use {{ic|xlsfonts}}, from the {{Pkg|xorg-xlsfonts}} package.<br />
<br />
== Fontconfig configuration ==<br />
<br />
Fontconfig is documented in the [http://fontconfig.org/fontconfig-user.html fonts-conf] man page.<br />
<br />
Configuration can be done per-user through {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}, and globally with {{ic|/etc/fonts/local.conf}}. The settings in the per-user configuration have precedence over the global configuration. Both these files use the same syntax.<br />
{{Note|Configuration files and directories: {{ic|~/.fonts.conf}}, {{ic|~/.fonts.conf.d}} and {{ic|~/.fontconfig/*.cache-*}} are deprecated since fontconfig 2.10.1 ([http://cgit.freedesktop.org/fontconfig/commit/?id&#61;8c255fb185d5651b57380b0a9443001e8051b29d upstream commit]) and will not be read by default in the future versions of package. Use instead {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}, {{ic|$XDG_CONFIG_HOME/fontconfig/conf.d}} and {{ic|$XDG_CACHE_HOME/fontconfig/*.cache-*}} respectively. If you use the second directory, the file '''must''' follow the naming convention {{ic|NN-name.conf}} (where NN it's a two digit number like 00, 10, or 99).}}<br />
<br />
Fontconfig gathers all its configurations in a central file ({{ic|/etc/fonts/fonts.conf}}). This file is replaced during fontconfig updates and shouldn't be edited. Fontconfig-aware applications source this file to know available fonts and how they get rendered. This file is a conglomeration of rules from the global configuration ({{ic|/etc/fonts/local.conf}}), the configured presets in {{ic|/etc/fonts/conf.d/}}, and the user configuration file ({{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}). {{ic|fc-cache}} can be used to rebuild fontconfig's configuration, although changes will only be visible in newly launched applications.<br />
<br />
{{Note|For some desktop environments (such as [[GNOME]] and [[KDE]]) using the ''Font Control Panel'' will automatically create or overwrite the user font configuration file. For these desktop environments, it is best to match your already defined font configurations to get the expected behavior.}}<br />
<br />
Fontconfig configuration files use [[Wikipedia:XML|XML]] format and need these headers:<br />
<br />
{{bc|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<br />
<!-- settings go here --><br />
<br />
</fontconfig><br />
</nowiki>}}<br />
<br />
The configuration examples in this article omit these tags.<br />
<br />
=== Presets ===<br />
<br />
There are presets installed in the directory {{ic|/etc/fonts/conf.avail}}. They can be enabled by creating [[Wikipedia:Symbolic link|symbolic link]]s to them, both per-user and globally, as described in {{ic|/etc/fonts/conf.d/README}}. These presets will override matching settings in their respective configuration files.<br />
<br />
For example, to enable sub-pixel RGB rendering globally:<br />
<br />
# cd /etc/fonts/conf.d<br />
# ln -s ../conf.avail/10-sub-pixel-rgb.conf<br />
<br />
To do the same but instead for a per-user configuration:<br />
<br />
$ mkdir $XDG_CONFIG_HOME/fontconfig/conf.d<br />
$ ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf $XDG_CONFIG_HOME/fontconfig/conf.d<br />
<br />
=== Anti-aliasing ===<br />
<br />
[[Wikipedia:Font rasterization|Font rasterization]] converts vector font data to bitmap data so that it can be displayed. The result can appear jagged due to [[Wikipedia:Aliasing|aliasing]]. [[Wikipedia:Anti-aliasing|anti-aliasing]] is enabled by default and increases the apparent resolution of font edges.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Some applications, like [[Gnome|Gnome 3]] may [[#Troubleshooting|override default anti-alias settings]].}}<br />
<br />
=== Hinting ===<br />
<br />
[[Wikipedia:Font hinting|Font hinting]] (also known as instructing) is the use of mathematical instructions to adjust the display of an outline font so that it lines up with a rasterized grid, (i.e. the pixel grid of the display). This has the effect of making fonts appear more crisp. Fonts will line up correctly without hinting when displays have around 300 [[Wikipedia:Dots per inch|DPI]] or greater. Two types of hinting are available.<br />
<br />
==== Byte-Code Interpreter (BCI) ====<br />
<br />
Using BCI hinting instructions in TrueType fonts fonts are rendered according to FreeTypes's interpreter. BCI hinting works good with fonts with good hinting instructions.<br />
<br />
To enable hinting:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="hinting" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Autohinter ====<br />
<br />
The Autohinter attempts to do automatic hinting and disregards any existing hinting information. Originally it was the default because TrueType2 fonts were patent-protected but now that they have expired there's very little reason to use it. It does work better with fonts that have broken or no hinting information but it will be strongly sub-optimal for fonts with good hinting information. Generally system fonts are of the second kind so autohinter should not be used.<br />
<br />
To enable auto-hinting:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="autohint" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Hintstyle ====<br />
<br />
{{ic|hintstyle}} is the amount of influence the hinting mode has. Hinting can be set to: {{ic|hintfull}}, {{ic|hintmedium}}, {{ic|hintslight}} and {{ic|hintnone}}. {{ic|hintfull}} will give a nice crisp look and will work best for most fonts but preferences vary.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="hintstyle" mode="assign"><br />
<const>hintfull</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Some applications, like [[Gnome|Gnome 3]] may [[#Troubleshooting|override default hinting settings.]]}}<br />
<br />
=== Subpixel rendering ===<br />
<br />
Most monitors manufactured today use the Red, Green, Blue (RGB) specification. Fontconfig will need to know your monitor type to be able to display your fonts correctly. Monitors are either: '''RGB''' (most common), '''BGR''', '''V-RGB''' (vertical), or '''V-BGR'''. A monitor test can be found [http://www.lagom.nl/lcd-test/subpixel.php here]).<br />
<br />
To enable subpixel rendering:<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit name="rgba" mode="assign"><br />
<const>rgb</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
{{Note|Subpixel rendering effectively triples the horizontal (or vertical) resolution for fonts by making use of subpixels. The autohinter and subpixel rendering are not designed to work together and should not be used in combination without the [[#Infinality: the generic way|Infinality]] patch set.}}<br />
<br />
==== LCD filter ====<br />
<br />
When using subpixel rendering, you should enable the LCD filter, which is designed to reduce colour fringing. This is described under [http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html LCD filtering] in the FreeType 2 API reference. Different options are described under [http://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html#FT_LcdFilter FT_LcdFilter], and are illustrated by this [http://www.spasche.net/files/lcdfiltering/ LCD filter test] page.<br />
<br />
The {{ic|lcddefault}} filter will work for most users. Other filters are available that can be used in special situations: {{ic|lcdlight}}; a lighter filter ideal for fonts that look too bold or fuzzy, {{ic|lcdlegacy}}, the original Cairo filter; and {{ic|lcdnone}} to disable it entirely.<br />
<br />
{{bc|<nowiki><br />
<match target="font"><br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
</match><br />
</nowiki>}}<br />
<br />
==== Advanced LCD filter specification ====<br />
<br />
If the available, built-in LCD filters are not satisfactory, it is possible to tweak the font rendering very specifically by building a custom freetype2 package and modifying the hardcoded filters. The [[Arch Build System]] can be used to build and install packages from source.<br />
<br />
First, refresh the freetype2 PKGBUILD as root:<br />
<br />
# abs extra/freetype2<br />
<br />
This example uses {{ic|/var/abs/build}} as the build directory, substitute it according to your personal ABS setup. Download and extract the freetype2 package as a regular user:<br />
<br />
$ cd /var/abs/build<br />
$ cp -r ../extra/freetype2 .<br />
$ cd freetype2<br />
$ makepkg -o<br />
<br />
Edit the file {{ic|src/freetype-VERSION/src/base/ftlcdfil.c}} and look up the definition of the constant {{ic|default_filter[5]}}:<br />
<br />
static const FT_Byte default_filter[5] =<br />
{ 0x10, 0x40, 0x70, 0x40, 0x10 };<br />
<br />
This constant defines a low-pass filter applied to the rendered glyph. Modify it as needed. Save the file, build and install the custom package:<br />
<br />
$ makepkg -e<br />
# pacman -Rd freetype2<br />
# pacman -U freetype2-VERSION-ARCH.pkg.tar.xz<br />
<br />
Reboot or restart X. The lcddefault filter should now render fonts differently.<br />
<br />
=== Disable auto-hinter for bold fonts ===<br />
<br />
The auto-hinter uses sophisticated methods for font rendering, but often makes bold fonts too wide. Fortunately, a solution can be turning off the autohinter for bold fonts while leaving it on for the rest:<br />
...<br />
<match target="font"><br />
<test name="weight" compare="more"><br />
<const>medium</const><br />
</test><br />
<edit name="autohint" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
...<br />
<br />
=== Enable anti-aliasing only for bigger fonts ===<br />
<br />
''See also [http://sharpfonts.co.cc/ sharpfonts.co.cc] for related information.''<br />
<br />
Some users prefer the sharper rendering that anti-aliasing does not offer:<br />
<br />
{{bc|<nowiki><br />
...<br />
<match target="font"><br />
<edit name="antialias" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="size" qual="any" compare="more"><br />
<double>12</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
<br />
<match target="font" ><br />
<test name="pixelsize" qual="any" compare="more"><br />
<double>16</double><br />
</test><br />
<edit name="antialias" mode="assign"><br />
<bool>true</bool><br />
</edit><br />
</match><br />
...<br />
</nowiki>}}<br />
<br />
=== Replace fonts ===<br />
<br />
The most reliable way to do this is to add an XML fragment similar to the one below. ''Using the "binding" attribute will give you better results'', for example, in Firefox where you may not want to change properties of font being replaced. This will cause Ubuntu to be used in place of Georgia:<br />
...<br />
<match target="pattern"><br />
<test qual="any" name="family"><string>georgia</string></test><br />
<edit name="family" mode="assign" binding="same"><string>Ubuntu</string></edit><br />
</match><br />
...<br />
An alternate approach is to set the "preferred" font, but ''this only works if the original font is not on the system'', in which case the one specified will be substituted:<br />
...<br />
< !-- Replace Helvetica with Bitstream Vera Sans Mono --><br />
< !-- Note, an alias for Helvetica should already exist in default conf files --><br />
<alias><br />
<family>Helvetica</family><br />
<prefer><family>Bitstream Vera Sans Mono</family></prefer><br />
<default><family>fixed</family></default><br />
</alias><br />
...<br />
<br />
=== Disable bitmap fonts ===<br />
<br />
To disable bitmap fonts in fontconfig, use {{ic|70-no-bitmaps.conf}} (which is not placed by fontconfig by default):<br />
<br />
# cd /etc/fonts/conf.d<br />
# rm 70-yes-bitmaps.conf<br />
# ln -s ../conf.avail/70-no-bitmaps.conf<br />
<br />
This oneliner should also work:<br />
<br />
# ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d/<br />
<br />
You may not need to remove {{ic|70-yes-bitmaps.conf}} if it does not exist. You can choose which fonts to replace bitmaps fonts with (Helvetica, Courier and Times bitmap mapts to TTF fonts) by:<br />
<br />
# cd /etc/fonts/conf.d<br />
# ln -s ../conf.avail/29-replace-bitmap-fonts.conf<br />
<br />
<div id="EmbeddedBitmap">To disable embedded bitmap for all fonts:<div><br />
<br />
{{hc|~/.config/fontconfig/conf.d/20-no-embeded.conf|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<match target="font"><br />
<edit name="embeddedbitmap" mode="assign"><br />
<bool>false</bool><br />
</edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
To disable embedded bitmap fonts for a specific font:<br />
<br />
<match target="font"><br />
<test qual="any" name="family"><br />
<string>Monaco</string><br />
</test><br />
<edit name="embeddedbitmap"><bool>false</bool></edit><br />
</match><br />
<br />
=== Disable scaling of bitmap fonts ===<br />
<br />
To disable scaling of bitmap fonts (which often makes them blurry), remove {{ic|/etc/fonts/conf.d/10-scale-bitmap-fonts.conf}}.<br />
<br />
=== Create bold and italic styles for incomplete fonts ===<br />
<br />
Freetype has the ability to automatically create ''italic'' and '''bold''' styles for fonts that do not have them, but only if explicitly required by the application. Given programs rarely send these requests, this section covers manually forcing generation of missing styles.<br />
<br />
Start by editing {{ic|/usr/share/fonts/fonts.cache-1}} as explained below. Store a copy of the modifications on another file, because a font update with {{ic|fc-cache}} will overwrite {{ic|/usr/share/fonts/fonts.cache-1}}.<br />
<br />
Assuming the Dupree font is installed:<br />
"dupree.ttf" 0 "Dupree:style=Regular:slant=0:weight=80:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Duplicate the line, change {{ic|<nowiki>style=Regular</nowiki>}} to {{ic|<nowiki>style=Bold</nowiki>}} or any other style. Also change {{ic|<nowiki>slant=0</nowiki>}} to {{ic|<nowiki>slant=100</nowiki>}} for italic, {{ic|<nowiki>weight=80</nowiki>}} to {{ic|<nowiki>weight=200</nowiki>}} for bold, or combine them for '''''bold italic''''':<br />
"dupree.ttf" 0 "Dupree:style=Bold Italic:slant=100:weight=200:width=100:foundry=unknown:index=0:outline=True:''etc...''<br />
<br />
Now add necessary modifications to {{ic|$XDG_CONFIG_HOME/fontconfig/fonts.conf}}:<br />
{{bc|<nowiki><br />
...<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="weight" compare="more_eq"><int>140</int></test><br />
<edit name="embolden" mode="assign"><bool>true</bool></edit><br />
</match><br />
<br />
<match target="font"><br />
<test name="family" qual="any"><br />
<string>Dupree</string><br />
&lt;!-- other fonts here .... --&gt;<br />
</test><br />
<test name="slant" compare="more_eq"><int>80</int></test><br />
<edit name="matrix" mode="assign"><br />
<times><br />
<name>matrix</name><br />
<matrix><br />
<double>1</double><double>0.2</double><br />
<double>0</double><double>1</double><br />
</matrix><br />
</times><br />
</edit><br />
</match><br />
...<br />
</nowiki>}}<br />
{{Tip| Use the value 'embolden' for existing bold fonts in order to make them even bolder.}}<br />
<br />
=== Change rule overriding ===<br />
<br />
Fontconfig processes files in {{ic|/etc/fonts/conf.d}} in numerical order. This enables rules or files to override one another, but often confuses users about what file gets parsed last.<br />
<br />
To guarantee that personal settings take precedence over any other rules, change their ordering:<br />
# cd /etc/fonts/conf.d<br />
# mv 50-user.conf 99-user.conf<br />
<br />
This change seems however to be unnecessary for the most of the cases, because a user is given enough control by default to set up own font preferences, hinting and antialiasing properties, alias new fonts to generic font families, etc.<br />
<br />
=== Example fontconfig configurations ===<br />
<br />
Example fontconfig configurations can be found on this [[Font_Configuration/fontconfig_Examples|page]].<br />
<br />
A simple starting point:<br />
<br />
{{hc|/etc/fonts/local.conf|<nowiki><br />
<?xml version='1.0'?><br />
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'><br />
<fontconfig><br />
<match target="font"><br />
<br />
<edit mode="assign" name="rgba"><br />
<const>rgb</const><br />
</edit><br />
<br />
<edit mode="assign" name="hinting"><br />
<bool>true</bool><br />
</edit><br />
<br />
<edit mode="assign" name="hintstyle"><br />
<const>hintslight</const><br />
</edit><br />
<br />
<edit mode="assign" name="antialias"><br />
<bool>true</bool><br />
</edit><br />
<br />
<edit mode="assign" name="lcdfilter"><br />
<const>lcddefault</const><br />
</edit><br />
<br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
== Patched packages ==<br />
<br />
These patched packages are available in the [[Arch User Repository|AUR]]. A few considerations:<br />
<br />
* Configuration is usually necessary.<br />
* The new font rendering will not kick in until applications restart.<br />
* Applications which [[Wikipedia:Static library|statically link]] to a library will not be affected by patches applied to the system library.<br />
<br />
=== Infinality ===<br />
<br />
The infinality patchset aims to greatly improve freetype2 font rendering. It adds multiple new capabilities.<br />
<br />
* [http://www.infinality.net/blog/infinality-freetype-patches/ Home page]<br />
* [http://www.infinality.net/forum/ Forum]<br />
* [http://www.webupd8.org/2013/06/better-font-rendering-in-linux-with.html Short article about infinality (contains screenshots)]<br />
<br />
Infinality's settings are all configurable at runtime via environment variables in {{ic|/etc/profile.d/infinality-settings.sh}}, and include the following:<br />
<br />
*'''Emboldening Enhancement''': Disables Y emboldening, producing a much nicer result on fonts without bold versions. Works on native TT hinter and autohinter.<br />
*'''Auto-Autohint''': Automatically forces autohint on fonts that contain no TT instructions.<br />
*'''Autohint Enhancement''': Makes autohint snap horizontal stems to pixels. Gives a result that appears like a well-hinted truetype font, but is 100% patent-free (as far as I know).<br />
*'''Customized FIR Filter''': Select your own [http://www.infinality.net/forum/viewtopic.php?f=2&t=19 filter values] at run-time. Works on native TT hinter and autohinter.<br />
*'''Stem Alignment''': Aligns bitmap glyphs to optimized pixel boundaries. Works on native TT hinter and autohinter.<br />
*'''Pseudo Gamma Correction''': Lighten and darken glyphs at a given value, below a given size. Works on native TT hinter and autohinter.<br />
*'''Embolden Thin Fonts''': Embolden thin or light fonts so that they are more visible. Works on autohinter.<br />
*'''Force Slight Hinting''': Force slight hinting even when programs want full hinting. If you use the local.conf I provide (included in infinality-settings fedora package) you will notice nice improvements on @font-face fonts.<br />
*'''ChromeOS Style Sharpening''': ChromeOS uses a patch to sharpen the look of fonts. This is now included in the infinality patchset.<br />
<br />
A number of presets are included and can be used by setting the USE_STYLE variable in {{ic|/etc/profile.d/infinality-settings.sh}}.<br />
<br />
==== Installation and configuration ====<br />
{{Tip|All AUR packages in this section can also be downloaded from bohoomil's custom repository. See the [[#Install from custom repository|section below]] for how to enable this repository.}}<br />
{{Note|If you have been using fontconfig-infinality-ultimate < 2.11.0-2, you need to re-install (not upgrade!) fontconfig-infinality-ultimate package:<br />
pacman -Rdd fontconfig-infinality-ultimate<br />
pacman -S fontconfig-infinality-ultimate<br />
}}<br />
{{AUR|freetype2-infinality}} can be installed from the [[Arch User Repository|AUR]]. If you are a multilib user, also install {{AUR|lib32-freetype2-infinality}} from the AUR. The AUR also contains the latest development snapshot of freetype2 with the Infinality patchset: {{AUR|freetype2-infinality-git}} and {{AUR|lib32-freetype2-infinality-git}}.<br />
<br />
It is recommended to also install {{AUR|fontconfig-infinality}} to enable selection of predefined font substitution styles and antialiasing settings, apart from the rendering settings of the engine itself. After doing so, you can select the font style (win7, winxp, osx, linux, ...) with:<br />
# infctl setstyle<br />
<br />
If you set e.g. win7 or osx you need the corresponding fonts installed.<br />
<br />
{{Note|<br />
* The user bohoomil maintains a very good configuration in his [https://github.com/bohoomil/fontconf github repo] which is available as {{AUR|fontconfig-infinality-ultimate-git}} in the AUR.<br />
* Install {{AUR|grip-git}} from the AUR to have a realtime font preview.<br />
* Default infinality settings can cause some programs to display fonts at 72 DPI instead of 96. If you notice a problem open {{ic|/etc/fonts/infinality/infinality.conf}} search for the section on DPI and change 72 to 96. This problem can specifically affect conky causing the fonts to appear smaller than they should. Thus not aligning properly with images.<br />
* ''The README for {{AUR|fontconfig-infinality}} says that /etc/fonts/local.conf should either not exist, or have no infinality-related configurations in it. The local.conf is now obsolete and completely replaced by this configuration.''<br />
}}<br />
<br />
for more information see this article: http://www.infinality.net/forum/viewtopic.php?f=2&t=77<br />
<br />
==== Install from custom repository ====<br />
<br />
bohoomil also maintains '''infinality-bundle''' repository, offering three basic libraries (freetype2-infinality-ultimate, fontconfig-infinality-ultimate & cairo-infinality-ultimate) as pre-patched, pre-configured and pre-built binaries for all architectures (i686, x86_64, multilib). There is also an additional repository avaiable, '''infinality-bundle-fonts''', offering a collection of entirely free, high quality typefaces, replacing common proprietary font families. Using '''infinality-bundle''' and '''infinality-bundle-fonts''' makes the whole installation and configuration process dramatically simplified (i.e., it lets you skip most steps necessary to install and configure fonts in your system).<br />
<br />
Please, see [[Infinality-bundle+fonts]] for more information and installation instructions.<br />
<br />
=== Ubuntu ===<br />
<br />
Ubuntu adds extra configurations, and occasionally patches to the font rendering libraries.<br />
<br />
Install the patched packages from the [[Arch User Repository|AUR]], the package names are: {{AUR|freetype2-ubuntu}} {{AUR|fontconfig-ubuntu}} {{AUR|cairo-ubuntu}}.<br />
<br />
The global configuration will need to be added. See [[#Example fontconfig configurations]] for a starting point.<br />
Ubuntu rendering works the best with ''hintslight'' option.<br />
<br />
Note that the *-ubuntu AUR packages need to be kept up-to-date by the user, and will not be updated by pacman along with other packages. The whole graphical system can become inoperable if the user-installed core graphical libraries become incompatible with the official repository applications.<br />
<br />
=== Reverting to unpatched packages ===<br />
<br />
To restore the unpatched packages, reinstall the originals:<br />
<br />
# pacman -S --asdeps freetype2 cairo fontconfig<br />
<br />
== Applications without fontconfig support ==<br />
<br />
Some applications like [[URxvt]] will ignore fontconfig settings. This is very apparent when using the infinality patches which are heavily reliant on proper configuration. You can work around this by using {{ic|~/.Xresources}}, but it is not nearly as flexible as fontconfig. Example (see [[#Fontconfig configuration]] for explanations of the options):<br />
<br />
{{hc|~/.Xresources|<nowiki><br />
Xft.autohint: 0<br />
Xft.lcdfilter: lcddefault<br />
Xft.hintstyle: hintfull<br />
Xft.hinting: 1<br />
Xft.antialias: 1<br />
Xft.rgba: rgb<br />
</nowiki>}}<br />
<br />
Make sure the settings are loaded properly when X starts with {{ic|xrdb -q}} (see [[Xresources]] for more information).<br />
<br />
== Troubleshooting ==<br />
<br />
=== Distorted fonts ===<br />
<br />
{{Note|96 DPI is not a standard. You should use your monitor's actual DPI to get proper font rendering, especially when using subpixel rendering.}}<br />
<br />
If fonts are still unexpectedly large or small, poorly proportioned or simply rendering poorly, fontconfig may be using the incorrect DPI.<br />
<br />
Fontconfig should be able to detect DPI parameters as discovered by the Xorg server. You can check the automatically discovered DPI with {{ic|xdpyinfo}} (provided by the {{pkg|xorg-xdpyinfo}} package):<br />
<br />
{{hc|<nowiki>$ xdpyinfo | grep dots</nowiki>|<br />
resolution: 102x102 dots per inch<br />
}}<br />
<br />
If the DPI is detected incorrectly (usually due to an incorrect monitor EDID), you can specify it manually in the Xorg configuration, see [[Xorg#Display size and DPI]]. This is the recommended solution, but it may not work with buggy drivers.<br />
<br />
Fontconfig will default to the Xft.dpi variable if it is set. Xft.dpi is usually set by desktop environments (usually to Xorg's DPI setting) or manually in {{ic|~/.Xdefaults}} or {{ic|~/.Xresources}}. Use xrdb to query for the value:<br />
<br />
{{hc|<nowiki>$ xrdb -query | grep dpi</nowiki>|<br />
Xft.dpi: 102<br />
}}<br />
<br />
Those still having problems can fall back to manually setting the DPI used by fontconfig:<br />
<br />
...<br />
<!-- Setup for DPI=96 --><br />
<match target="pattern"><br />
<edit name="dpi" mode="assign"><double>102</double></edit><br />
</match><br />
...<br />
<br />
=== Calibri, Cambria, Monaco, etc. not rendering properly ===<br />
<br />
Some scalable fonts have embedded bitmap versions which are rendered instead, mainly at smaller sizes. Force using scalable fonts at all sizes by [[#EmbeddedBitmap|#Disabling embedded bitmap]].<br />
<br />
=== Older GTK and QT applications ===<br />
<br />
Modern GTK apps enable Xft by default but this was not the case before version 2.2. If it is not possible to update these applications, force Xft for old [[GNOME]] applications by adding to {{ic|~/.bashrc}}:<br />
<br />
export GDK_USE_XFT=1<br />
<br />
For older QT applications:<br />
<br />
export QT_XFT=true<br />
<br />
=== Applications overriding hinting ===<br />
<br />
Some applications may override default fontconfig hinting and anti-aliasing settings. This may happen with [[Gnome]] 3, for example. Use the specific configuration program for the application in such cases. For gnome, try {{pkg|gnome-tweak-tool}}.<br />
<br />
== See also ==<br />
<br />
* [http://www.x.org/X11R6.8.2/doc/fonts.html Fonts in X11R6.8.2] - Official Xorg font information<br />
* [http://freetype.sourceforge.net/freetype2/ FreeType 2 overview]<br />
* [https://forums.gentoo.org/viewtopic-t-723341.html Gentoo font-rendering thread]</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Arduino&diff=279530Arduino2013-10-24T00:05:51Z<p>Sushi Dude: Updated arscons links to point at GitHub and changed references of .pde files to .ino.</p>
<hr />
<div>[[Category:Development]]<br />
[[Category:Mathematics and science]]<br />
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It is intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. More information is available on the [http://www.arduino.cc/ Arduino HomePage].<br />
<br />
== Installation ==<br />
<br />
{{Warning|Arduino 1.0.5 has an [https://github.com/arduino/Arduino/issues/1609 issue] that prevents uploading to Arduino boards, it is recommend that you download the [http://downloads.arduino.cc/arduino-jssc-nightly-linux32.tgz JSSC nightly build] until 1.5.6 BETA is released. You will also need to have {{pkg|libusb-compat}} installed.}}<br />
<br />
* Install {{AUR|arduino}} from the [[AUR]].<br />
* Add yourself to the {{ic|uucp}} [[Users and Groups|group]]. (More information in the next section: "Accessing serial")<br />
<br />
=== Intel Galileo ===<br />
<br />
The version of the Arduino IDE that support the Intel Galileo board can be downloaded [https://communities.intel.com/community/makers/software/drivers here].<br />
<br />
== Configuration ==<br />
<br />
=== Accessing serial ===<br />
<br />
The arduino board communicates with the computer via a serial connection or a serial over USB connection. So the user needs read/write access to the serial device file. [[Udev]] creates files in /dev/tts/ owned by group uucp so adding the user to the uucp group gives the required read/write access.<br />
<br />
gpasswd -a $USER uucp<br />
<br />
{{Note|You will have to logout and login again for this to take effect.}}<br />
<br />
Before uploading to the Arduino, be sure to set the correct serial port, board, and processor from the Tools menu.<br />
<br />
== stty ==<br />
<br />
Preparing:<br />
# stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts<br />
<br />
Sending commands through Terminal without new line after command<br />
# echo -n "Hello World" > /dev/ttyACM0<br />
{{Note| As autoreset on serial connection is activated by default on most boards, you need to disable this feature if you want to communicate directly with your board with the last command instead of a terminal emulator (arduino IDE, screen, picocom...). If you have a Leonardo board, you are not concerned by this, because it does not autoreset. If you have a Uno board, connect a 10 µF capacitor between the RESET and GND pins. If you have another board, connect a 120 ohms resistor between the RESET and 5V pins. See http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection for more details.}}<br />
<br />
Reading what your Arduino has to tell you<br />
$ cat /dev/ttyACM0<br />
<br />
== Alternatives for IDE ==<br />
<br />
=== ArduIDE ===<br />
<br />
ArduIDE is a Qt-based IDE for Arduino. {{AUR|arduide-git}} is available in the [[AUR]].<br />
<br />
If you prefer working from terminal, below there are some other options to choose from.<br />
<br />
=== Arduino-CMake ===<br />
<br />
Using [https://github.com/queezythegreat/arduino-cmake arduino-cmake] and [http://www.cmake.org/cmake/resources/software.html CMake] you can build Arduino firmware from the command line using multiple build systems. CMake lets you generate the build system that fits your needs, using the tools you like. It can generate any type of build system, from simple Makefiles, to complete projects for Eclipse, Visual Studio, XCode, etc.<br />
<br />
Requirements:<br />
* [https://www.archlinux.org/packages/?sort=&q=cmake CMake]<br />
* [https://aur.archlinux.org/packages.php?ID=8388 Arduino SDK]<br />
* [https://www.archlinux.org/packages/?sort=&q=gcc-avr gcc-avr]<br />
* [https://www.archlinux.org/packages/?sort=&q=binutils-avr binutils-avr]<br />
* [https://www.archlinux.org/packages/?sort=&q=avr-libc avr-libc]<br />
* [https://www.archlinux.org/packages/?sort=&q=avrdude avrdude]<br />
<br />
=== gnoduino ===<br />
<br />
{{aur|gnoduino}} is an implementation of original Arduino IDE for GNOME available in the [[AUR]]. The original Arduino IDE software is written in Java. This is a Python implementation and it is targeted at GNOME but will work on xfce4 and other WM. Its purpose is to be light, while maintaining compatibility with the original Arduino IDE. The source editor is based on gtksourceview.<br />
<br />
=== Ino ===<br />
<br />
[https://github.com/amperka/ino Ino] is a command line toolkit for working with arduino hardware. {{AUR|ino}} is available in the [[AUR]].<br />
<br />
=== Makefile ===<br />
<br />
{{Note|Update 2011-03-12. Arduino Is not shipping a Makefile with version (22). The Makefile from the [http://code.google.com/p/dogm128/source/browse/libraries/Dogm/examples/SpaceTrash/Makefile.uno_dogs102 dogm128] project works for me though.}}<br />
<br />
Instead of using the Arduino IDE it is possible to use another editor and a Makefile.<br />
<br />
Set up a directory to program your Arduino and copy the Makefile into this directory. A copy of the Makefile can be obtained from /usr/share/arduino/hardware/cores/arduino/Makefile<br />
<br />
You will have to modify this a little bit to reflect your settings. The makefile should be pretty self explainatory. Here are some lines you may have to edit.<br />
<br />
PORT = usually /dev/ttyUSBx, where x is the usb serial port your arduino is plugged into<br />
TARGET = your sketch's name<br />
ARDUINO = /usr/share/arduino/lib/targets/arduino<br />
<br />
Depending on which library functions you call in your sketch, you may need to compile parts of the library. To do that you need to edit your SRC and CXXSRC to include the required libraries.<br />
<br />
Now you should be able to make && make upload to your board to execute your sketch.<br />
<br />
=== Scons ===<br />
<br />
Using [http://www.scons.org/ scons] together with [https://github.com/suapapa/arscons arscons] it is very easy to use to compile and upload Arduino projects from the command line. Scons is based on python and you will need python-pyserial to use the serial interface. Install {{Pkg|python-pyserial}} and {{Pkg|scons}}.<br />
<br />
That will get the dependencies you need too. You will also need Arduino itself so install it as described above. Create project directory (eg. test), then create a arduino project file in your new directory. Use the same name as the directory and add .ino (eg. test.ino). Get the [https://github.com/suapapa/arscons/blob/master/SConstruct SConstruct] script from arscons and put it in your directory. Have a peek in it and, if necessary, edit it. It is a python script. Edit your project as you please, then run<br />
<br />
$ scons # This will build the project<br />
$ scons upload # This will upload the project to your Arduino<br />
<br />
== Troubleshooting ==<br />
<br />
=== Consistent naming of Arduino devices ===<br />
<br />
If you have more than one arduino you may have noticed that they names /dev/ttyUSB[0-9] are assigned in the order of connection. In the IDE this is not so much of a problem, but when you have programmed your own software to communicate with an arduino project in the background this can be annoying. Use the following udev rules to assign static symlinks to your arduino's:<br />
{{hc|/etc/udev/rules.d/52-arduino.rules|<nowiki><br />
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="sensors/ftdi_%s{serial}"<br />
</nowiki>}}<br />
Your arduino's will be available under names like "/dev/sensors/ftdi_A700dzaF". If you want you can also assign more meaningfull names to several devices like this:<br />
{{hc|/etc/udev/rules.d/52-arduino.rules|<nowiki><br />
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A700dzaF", SYMLINK+="arduino/nano"<br />
</nowiki>}}<br />
which will create a symlink in /dev/arduino/nano to the device with the specified serialnumber.<br />
You do need to unplug and replug your arduino for this to take effect or run<br />
udevadm trigger<br />
<br />
=== Error opening serial port ===<br />
<br />
You may see the serial port initially when the IDE starts, but the TX/RX leds do nothing when uploading. You may have previously changed the baudrate in the serial monitor to something it does not like. Edit ~/.arduino/preferences.txt so that serial.debug_rate is a different speed, like 115200.<br />
<br />
=== Missing twi.o ===<br />
<br />
If the file /usr/share/arduino/lib/targets/libraries/Wire/utility/twi.o does not exist arduino may try to create it. Normal users do not have permission to write there so this will fail. Run arduino as root so it can create the file, after the file has been created arduino can be run under a normal user.<br />
<br />
=== Working with Uno/Mega2560 ===<br />
<br />
The Arduino Uno and Mega2560 have an onboard USB interface (an Atmel 8U2) that accepts serial data, so they are accessed through /dev/ttyACM0 created by the cdc-acm kernel module when it is plugged in.<br />
<br />
The 8U2 firmware may need an update to ease serial communications. See [http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286350399] for more details and reply #11 for a fix. The original arduino bbs, where you can find an image explaining how to get your Uno into DFU, is now in a read-only state. If you do not have an account to view the image, see [http://www.scribd.com/doc/45913857/Arduino-UNO].<br />
<br />
You can perform a general function test of the Uno by putting it in loopback mode and typing characters into the arduino serial monitor at 115200 baud. It should echo the characters back to you. To put it in loopback, short pins 0 -> 1 on the digital side and either hold the reset button or short the GND -> RESET pins while you type.<br />
<br />
== See also ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?pid=295312<br />
* https://bbs.archlinux.org/viewtopic.php?pid=981348<br />
* http://answers.ros.org/question/9097/how-can-i-get-a-unique-device-path-for-my-arduinoftdi-device/</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Arduino&diff=279505Arduino2013-10-23T19:29:17Z<p>Sushi Dude: Major rewrite: Added information and workarounds for current issues. Added information regarding the Intel Galileo. Removed broken hyperlinks. Removed many of the issues that no longer exist. Reorganized most everything. Various minor changes.</p>
<hr />
<div>[[Category:Development]]<br />
[[Category:Mathematics and science]]<br />
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It is intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. More information is available on the [http://www.arduino.cc/ Arduino HomePage].<br />
<br />
== Installation ==<br />
<br />
{{Warning|Arduino 1.0.5 has an [https://github.com/arduino/Arduino/issues/1609 issue] that prevents uploading to Arduino boards, it is recommend that you download the [http://downloads.arduino.cc/arduino-jssc-nightly-linux32.tgz JSSC nightly build] until 1.5.6 BETA is released. You will also need to have {{pkg|libusb-compat}} installed.}}<br />
<br />
* Install {{AUR|arduino}} from the [[AUR]].<br />
* Add yourself to the {{ic|uucp}} [[Users and Groups|group]]. (More information in the next section: "Accessing serial")<br />
<br />
=== Intel Galileo ===<br />
<br />
The version of the Arduino IDE that support the Intel Galileo board can be downloaded [https://communities.intel.com/community/makers/software/drivers here].<br />
<br />
== Configuration ==<br />
<br />
=== Accessing serial ===<br />
<br />
The arduino board communicates with the computer via a serial connection or a serial over USB connection. So the user needs read/write access to the serial device file. [[Udev]] creates files in /dev/tts/ owned by group uucp so adding the user to the uucp group gives the required read/write access.<br />
<br />
gpasswd -a $USER uucp<br />
<br />
{{Note|You will have to logout and login again for this to take effect.}}<br />
<br />
Before uploading to the Arduino, be sure to set the correct serial port, board, and processor from the Tools menu.<br />
<br />
== stty ==<br />
<br />
Preparing:<br />
# stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts<br />
<br />
Sending commands through Terminal without new line after command<br />
# echo -n "Hello World" > /dev/ttyACM0<br />
{{Note| As autoreset on serial connection is activated by default on most boards, you need to disable this feature if you want to communicate directly with your board with the last command instead of a terminal emulator (arduino IDE, screen, picocom...). If you have a Leonardo board, you are not concerned by this, because it does not autoreset. If you have a Uno board, connect a 10 µF capacitor between the RESET and GND pins. If you have another board, connect a 120 ohms resistor between the RESET and 5V pins. See http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection for more details.}}<br />
<br />
Reading what your Arduino has to tell you<br />
$ cat /dev/ttyACM0<br />
<br />
== Alternatives for IDE ==<br />
<br />
=== ArduIDE ===<br />
<br />
ArduIDE is a Qt-based IDE for Arduino. {{AUR|arduide-git}} is available in the [[AUR]].<br />
<br />
If you prefer working from terminal, below there are some other options to choose from.<br />
<br />
=== Arduino-CMake ===<br />
<br />
Using [https://github.com/queezythegreat/arduino-cmake arduino-cmake] and [http://www.cmake.org/cmake/resources/software.html CMake] you can build Arduino firmware from the command line using multiple build systems. CMake lets you generate the build system that fits your needs, using the tools you like. It can generate any type of build system, from simple Makefiles, to complete projects for Eclipse, Visual Studio, XCode, etc.<br />
<br />
Requirements:<br />
* [https://www.archlinux.org/packages/?sort=&q=cmake CMake]<br />
* [https://aur.archlinux.org/packages.php?ID=8388 Arduino SDK]<br />
* [https://www.archlinux.org/packages/?sort=&q=gcc-avr gcc-avr]<br />
* [https://www.archlinux.org/packages/?sort=&q=binutils-avr binutils-avr]<br />
* [https://www.archlinux.org/packages/?sort=&q=avr-libc avr-libc]<br />
* [https://www.archlinux.org/packages/?sort=&q=avrdude avrdude]<br />
<br />
=== gnoduino ===<br />
<br />
{{aur|gnoduino}} is an implementation of original Arduino IDE for GNOME available in the [[AUR]]. The original Arduino IDE software is written in Java. This is a Python implementation and it is targeted at GNOME but will work on xfce4 and other WM. Its purpose is to be light, while maintaining compatibility with the original Arduino IDE. The source editor is based on gtksourceview.<br />
<br />
=== Ino ===<br />
<br />
[https://github.com/amperka/ino Ino] is a command line toolkit for working with arduino hardware. {{AUR|ino}} is available in the [[AUR]].<br />
<br />
=== Makefile ===<br />
<br />
{{Note|Update 2011-03-12. Arduino Is not shipping a Makefile with version (22). The Makefile from the [http://code.google.com/p/dogm128/source/browse/libraries/Dogm/examples/SpaceTrash/Makefile.uno_dogs102 dogm128] project works for me though.}}<br />
<br />
Instead of using the Arduino IDE it is possible to use another editor and a Makefile.<br />
<br />
Set up a directory to program your Arduino and copy the Makefile into this directory. A copy of the Makefile can be obtained from /usr/share/arduino/hardware/cores/arduino/Makefile<br />
<br />
You will have to modify this a little bit to reflect your settings. The makefile should be pretty self explainatory. Here are some lines you may have to edit.<br />
<br />
PORT = usually /dev/ttyUSBx, where x is the usb serial port your arduino is plugged into<br />
TARGET = your sketch's name<br />
ARDUINO = /usr/share/arduino/lib/targets/arduino<br />
<br />
Depending on which library functions you call in your sketch, you may need to compile parts of the library. To do that you need to edit your SRC and CXXSRC to include the required libraries.<br />
<br />
Now you should be able to make && make upload to your board to execute your sketch.<br />
<br />
=== Scons ===<br />
<br />
Using [http://www.scons.org/ scons] together with [http://code.google.com/p/arscons/ arscons] it is very easy to use to compile and upload Arduino projects from the command line. Scons is based on python and you will need python-pyserial to use the serial interface. Install {{Pkg|python-pyserial}} and {{Pkg|scons}}.<br />
<br />
That will get the dependencies you need too. You will also need Arduino itself so install it as described above. Create project directory (eg. test), then create a arduino project file in your new directory. Use the same name as the directory and add .pde (eg. test.pde). Get the [http://arscons.googlecode.com/git/SConstruct SConstruct] script from arscons and put it in your directory. Have a peek in it and, if necessary, edit it. It is a python script. Edit your project as you please, then run<br />
<br />
$ scons # This will build the project<br />
$ scons upload # This will upload the project to your Arduino<br />
<br />
== Troubleshooting ==<br />
<br />
=== Consistent naming of Arduino devices ===<br />
<br />
If you have more than one arduino you may have noticed that they names /dev/ttyUSB[0-9] are assigned in the order of connection. In the IDE this is not so much of a problem, but when you have programmed your own software to communicate with an arduino project in the background this can be annoying. Use the following udev rules to assign static symlinks to your arduino's:<br />
{{hc|/etc/udev/rules.d/52-arduino.rules|<nowiki><br />
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="sensors/ftdi_%s{serial}"<br />
</nowiki>}}<br />
Your arduino's will be available under names like "/dev/sensors/ftdi_A700dzaF". If you want you can also assign more meaningfull names to several devices like this:<br />
{{hc|/etc/udev/rules.d/52-arduino.rules|<nowiki><br />
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A700dzaF", SYMLINK+="arduino/nano"<br />
</nowiki>}}<br />
which will create a symlink in /dev/arduino/nano to the device with the specified serialnumber.<br />
You do need to unplug and replug your arduino for this to take effect or run<br />
udevadm trigger<br />
<br />
=== Error opening serial port ===<br />
<br />
You may see the serial port initially when the IDE starts, but the TX/RX leds do nothing when uploading. You may have previously changed the baudrate in the serial monitor to something it does not like. Edit ~/.arduino/preferences.txt so that serial.debug_rate is a different speed, like 115200.<br />
<br />
=== Missing twi.o ===<br />
<br />
If the file /usr/share/arduino/lib/targets/libraries/Wire/utility/twi.o does not exist arduino may try to create it. Normal users do not have permission to write there so this will fail. Run arduino as root so it can create the file, after the file has been created arduino can be run under a normal user.<br />
<br />
=== Working with Uno/Mega2560 ===<br />
<br />
The Arduino Uno and Mega2560 have an onboard USB interface (an Atmel 8U2) that accepts serial data, so they are accessed through /dev/ttyACM0 created by the cdc-acm kernel module when it is plugged in.<br />
<br />
The 8U2 firmware may need an update to ease serial communications. See [http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286350399] for more details and reply #11 for a fix. The original arduino bbs, where you can find an image explaining how to get your Uno into DFU, is now in a read-only state. If you do not have an account to view the image, see [http://www.scribd.com/doc/45913857/Arduino-UNO].<br />
<br />
You can perform a general function test of the Uno by putting it in loopback mode and typing characters into the arduino serial monitor at 115200 baud. It should echo the characters back to you. To put it in loopback, short pins 0 -> 1 on the digital side and either hold the reset button or short the GND -> RESET pins while you type.<br />
<br />
== See also ==<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?pid=295312<br />
* https://bbs.archlinux.org/viewtopic.php?pid=981348<br />
* http://answers.ros.org/question/9097/how-can-i-get-a-unique-device-path-for-my-arduinoftdi-device/</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Sudo&diff=276234Sudo2013-09-21T13:56:43Z<p>Sushi Dude: ~/.bashrc does not affect settings system-wide but /etc/sudoers does.</p>
<hr />
<div>[[Category:Security]]<br />
[[cs:Sudo]]<br />
[[es:Sudo]]<br />
[[fr:Sudo]]<br />
[[it:Sudo]]<br />
[[ja:Sudo]]<br />
[[ru:Sudo]]<br />
[[sr:Sudo]]<br />
[[tr:Sudo]]<br />
[[uk:Sudo]]<br />
[[zh-CN:Sudo]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of the popular privilege escalation utility.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Access control overview}}}}<br />
{{Article summary end}}<br />
<br />
[http://www.gratisoft.us/sudo/ sudo] ("substitute user do") allows a system administrator to delegate authority to give certain users (or groups of users) the ability to run some (or all) commands as root or another user while providing an audit trail of the commands and their arguments.<br />
<br />
== Rationale ==<br />
<br />
Sudo is an alternative to [[su]] for running commands as root. Unlike [[su]], which launches a root shell that allows all further commands root access, sudo instead grants temporary privilege escalation to a single command. By enabling root privileges only when needed, sudo usage reduces the likelyhood that a typo or a bug in an invoked command will ruin the system.<br />
Sudo can also be used to run commands as other users; additionally, sudo logs all commands and failed access attempts for security auditing.<br />
<br />
== Installation ==<br />
<br />
Install the {{Pkg|sudo}} package, available in the [[Official Repositories|official repositories]]:<br />
<br />
# pacman -S sudo<br />
<br />
To begin using {{ic|sudo}} as a non-privileged user, it must be properly configured. So make sure you read the configuration section.<br />
<br />
== Usage ==<br />
<br />
With sudo, users can prefix commands with {{ic|sudo}} to run them with superuser (or other) privileges.<br />
<br />
For example, to use pacman:<br />
<br />
$ sudo pacman -Syu<br />
<br />
See the [http://www.gratisoft.us/sudo/man/sudo.html sudo manual] for more information.<br />
<br />
== Configuration ==<br />
<br />
=== View current settings ===<br />
<br />
Run {{ic|sudo -ll}} to print out the current sudo configuration.<br />
<br />
=== Using visudo ===<br />
<br />
The configuration file for sudo is {{ic|/etc/sudoers}}. It should '''always''' be edited with the {{ic|visudo}} command. {{ic|visudo}} locks the {{ic|sudoers}} file, saves edits to a temporary file, and checks that file's grammar before copying it to {{ic|/etc/sudoers}}.<br />
<br />
{{Warning|It is imperative that {{ic|sudoers}} be free of syntax errors! Any error makes sudo unusable. '''Always''' edit it with {{ic|visudo}} to prevent errors.}}<br />
<br />
The default editor for visudo is {{ic|vi}}. It will be used if you do not specify another editor, by setting either VISUAL or EDITOR environment variables (used in that order) to the desired editor, e.g. {{ic|vim}}. The command is run as root:<br />
<br />
# VISUAL="/usr/bin/vim -p -X" visudo<br />
<br />
You can permanently change the setting for your user to e.g. {{ic|vim}} by appending:<br />
<br />
export VISUAL="/usr/bin/vim -p -X"<br />
<br />
to your {{ic|~/.bashrc}} file. Note that this won't take effect for already-running shells.<br />
<br />
To change the editor of choice permanently system-wide only for {{ic|visudo}}, add the following line to {{ic|/etc/sudoers}} where {{ic|vim}} is your prefered editor:<br />
<br />
# Reset environment by default<br />
Defaults env_reset<br />
# Set default EDITOR to vim, and do not allow visudo to use EDITOR/VISUAL.<br />
Defaults editor="/usr/bin/vim -p -X", !env_editor<br />
<br />
=== Example Entries ===<br />
<br />
To allow a user to gain full root privileges when he/she precedes a command with {{ic|sudo}}, add the following line:<br />
<br />
USER_NAME ALL=(ALL) ALL<br />
<br />
To allow a user to run all commands as any user but only the machine with hostname HOST_NAME:<br />
<br />
USER_NAME HOST_NAME=(ALL) ALL<br />
<br />
To allow members of group {{ic|wheel}} sudo access:<br />
<br />
%wheel ALL=(ALL) ALL<br />
<br />
To disable asking for a password for user USER_NAME:<br />
<br />
Defaults:USER_NAME !authenticate<br />
<br />
Enable explicitly defined commands only for user USER_NAME on host HOST_NAME:<br />
<br />
USER_NAME HOST_NAME=/usr/bin/halt,/usr/bin/poweroff,/usr/bin/reboot,/usr/bin/pacman -Syu<br />
{{note| the most customized option should go at the end of the file, as the later lines overrides the previous ones. In particular such a line should be after the {{ic|%wheel}} line if your user is in this group.}}<br />
Enable explicitly defined commands only for user USER_NAME on host HOST_NAME without password:<br />
USER_NAME HOST_NAME= NOPASSWD: /usr/bin/halt,/usr/bin/poweroff,/usr/bin/reboot,/usr/bin/pacman -Syu<br />
<br />
A detailed sudoers example can be found [http://www.gratisoft.us/sudo/sample.sudoers here]. Otherwise, see the [http://www.gratisoft.us/sudo/man/sudoers.html sudoers manual] for detailed information.<br />
<br />
=== Sudoers default file permissions ===<br />
<br />
The owner and group for the sudoers file must both be 0. The file permissions must be set to 0440. These permissions are set by default, but if you accidentally change them, they should be changed back immediately or sudo will fail.<br />
<br />
# chown -c root:root /etc/sudoers<br />
# chmod -c 0440 /etc/sudoers<br />
<br />
=== Password cache timeout ===<br />
<br />
Users may wish to change the default timeout before the cached password expires. This is accomplished with the timestamp_timeout option in {{ic|/etc/sudoers}} which is in minutes.<br />
Set timeout to 20 minutes.<br />
<br />
Defaults:USER_NAME timestamp_timeout=20<br />
<br />
{{Tip|To ensure sudo always asks for a password, set the timeout to 0. To ensure the password never times out, set to less than 0.}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== File example ===<br />
<br />
This example is especially helpful for those using terminal multiplexers like screen, tmux, or ratpoison, and those using sudo from scripts/cronjobs:<br />
<br />
{{hc|/etc/sudoers|<nowiki><br />
Cmnd_Alias WHEELER = /usr/bin/lsof, /bin/nice, /bin/ps, /usr/bin/top, /usr/local/bin/nano, /usr/bin/ss, /usr/bin/locate, /usr/bin/find, /usr/bin/rsync<br />
Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/nice, /usr/bin/ionice, /usr/bin/top, /usr/bin/kill, /usr/bin/killall, /usr/bin/ps, /usr/bin/pkill<br />
Cmnd_Alias EDITS = /usr/bin/vim, /usr/bin/nano, /usr/bin/cat, /usr/bin/vi<br />
Cmnd_Alias ARCHLINUX = /usr/bin/gparted, /usr/bin/pacman<br />
<br />
root ALL = (ALL) ALL<br />
USER_NAME ALL = (ALL) ALL, NOPASSWD: WHEELER, NOPASSWD: PROCESSES, NOPASSWD: ARCHLINUX, NOPASSWD: EDITS<br />
<br />
Defaults !requiretty, !tty_tickets, !umask<br />
Defaults visiblepw, path_info, insults, lecture=always<br />
Defaults loglinelen = 0, logfile =/var/log/sudo.log, log_year, log_host, syslog=auth<br />
Defaults mailto=webmaster@foobar.com, mail_badpass, mail_no_user, mail_no_perms<br />
Defaults passwd_tries = 8, passwd_timeout = 1<br />
Defaults env_reset, always_set_home, set_home, set_logname<br />
Defaults !env_editor, editor="/usr/bin/vim:/usr/bin/vi:/usr/bin/nano"<br />
Defaults timestamp_timeout=360<br />
Defaults passprompt="Sudo invoked by [%u] on [%H] - Cmd run as %U - Password for user %p:"<br />
</nowiki>}}<br />
<br />
=== Enabling Tab-completion in Bash ===<br />
<br />
{{ic|Tab}}-completion, by default, will not work when a user is initially added to the sudoers file. For example, normally john only needs to type:<br />
<br />
$ fire<{{ic|Tab}}><br />
<br />
and the shell will complete the command for him as:<br />
<br />
$ firefox<br />
<br />
If, however, john is added to the sudoers file and he types:<br />
<br />
$ sudo fire<{{ic|Tab}}><br />
<br />
the shell will do nothing.<br />
<br />
To enable {{ic|Tab}}-completion with sudo, [[pacman|install]] the {{pkg|bash-completion}} package from the [[Official Repositories|official repositories]]. see [[bash#Tab_completion]] for more information.<br />
<br />
Alternatively, add the following to your {{ic|~/.bashrc}}:<br />
<br />
complete -cf sudo<br />
<br />
=== Run X11 apps using sudo ===<br />
<br />
To allow sudo to start graphical application in X11, you need to add:<br />
<br />
Defaults env_keep += "HOME"<br />
<br />
to visudo.<br />
<br />
=== Disable per-terminal sudo ===<br />
<br />
{{Warning|This will let any process use your sudo session.}}<br />
<br />
If you are annoyed by sudo's defaults that require you to enter your password every time you open a new terminal, disable '''tty_tickets''':<br />
<br />
Defaults !tty_tickets<br />
<br />
=== Environment variables ===<br />
<br />
If you have a lot of environment variables, or you export your proxy settings via {{ic|1=export http_proxy="..."}}, when using sudo these variables do not get passed to the root account unless you run sudo with the {{ic|-E}} option.<br />
<br />
$ sudo -E pacman -Syu<br />
<br />
The recommended way of preserving environment variables is to append them to {{ic|env_keep}}:<br />
{{hc|/etc/sudoers|<nowiki><br />
Defaults env_keep += "ftp_proxy http_proxy https_proxy no_proxy"<br />
</nowiki>}}<br />
<br />
=== Passing aliases ===<br />
<br />
If you use a lot of aliases, you might have noticed that they do not carry over to the root account when using sudo. However, there is an easy way to make them work. Simply add the following to your {{ic|~/.bashrc}} or {{ic|/etc/bash.bashrc}}:<br />
<br />
alias sudo='sudo '<br />
<br />
=== Insults ===<br />
<br />
Users can configure sudo to display clever insults when an incorrect password is entered instead of printing the default "wrong password" message. Find the Defaults line in {{ic|/etc/sudoers}} and append "insults" after a comma to existing options. The final result might look like this:<br />
<br />
#Defaults specification<br />
Defaults insults<br />
<br />
To test, type {{ic|sudo -K}} to end the current session and let sudo ask for the password again.<br />
<br />
=== Root password ===<br />
<br />
Users can configure sudo to ask for the root password instead of the user password by adding "rootpw" to the Defaults line in {{ic|/etc/sudoers}}:<br />
<br />
Defaults timestamp_timeout=0,rootpw<br />
<br />
=== Disable root login ===<br />
<br />
{{Warning|Arch Linux is not fine-tuned to run with a disabled root account. Users may encounter problems with this method.}}<br />
<br />
With sudo installed and configured, users may wish to disable the root login. Without root, attackers must first guess a user name configured as a sudoer as well as the user password.<br />
<br />
{{Warning|Ensure a user is properly configured as a sudoer ''before'' disabling the root account!}}<br />
<br />
The account can be locked via {{ic|passwd}}:<br />
<br />
# passwd -l root<br />
<br />
A similar command unlocks root.<br />
<br />
$ sudo passwd -u root<br />
<br />
Alternatively, edit {{ic|/etc/shadow}} and replace the root's encrypted password with "!":<br />
<br />
root:!:12345::::::<br />
<br />
To enable root login again:<br />
<br />
$ sudo passwd root<br />
<br />
==== kdesu ====<br />
<br />
kdesu may be used under KDE to launch GUI applications with root privileges. It is possible that by default kdesu will try to use su even if the root account is disabled. Fortunately one can tell kdesu to use sudo instead of su. Create/edit the file {{ic|~/.kde4/share/config/kdesurc}}:<br />
<br />
[super-user-command]<br />
super-user-command=sudo<br />
<br />
==== PolicyKit ====<br />
<br />
When disabling the root account, it is necessary to change the [[PolicyKit]] configuration for local authorization to reflect that. The default is to ask for the root password, so that must be changed. With polkit-1, this can be achieved by editing {{ic|/etc/polkit-1/localauthority.conf.d/50-localauthority.conf}} so that {{ic|1=AdminIdentities=unix-user:0}} is replaced with something else, depending on the system configuration. It can be a list of users and groups, for example:<br />
<br />
AdminIdentities=unix-group:wheel<br />
<br />
or<br />
<br />
AdminIdentities=unix-user:me;unixuser:mom;unix-group:wheel<br />
<br />
For more information, see {{ic|man pklocalauthority}}.<br />
<br />
==== NetworkManager ====<br />
<br />
Even with the above PolicyKit configuration you still need to configure a policy for NetworkManager. This is documented on the [[NetworkManager#Can.27t_edit_connections_as_normal_user|NetworkManager]] page of this wiki.<br />
<br />
== Troubleshooting ==<br />
<br />
=== SSH TTY Issues ===<br />
<br />
SSH does not allocate a tty by default when running a remote command. Without a tty, sudo cannot disable echo when prompting for a password. You can use ssh's {{ic|-tt}} option to force it to allocate a tty (or {{ic|-t}} twice).<br />
<br />
The {{ic|Defaults}} option {{ic|requiretty}} only allows the user to run sudo if they have a tty.<br />
<br />
# Disable "ssh hostname sudo <cmd>", because it will show the password in clear text. You have to run "ssh -t hostname sudo <cmd>".<br />
#<br />
#Defaults requiretty<br />
<br />
=== Display User Privileges ===<br />
<br />
You can find out what privileges a particular user has with the following command:<br />
<br />
$ sudo -lU yourusename<br />
<br />
Or view your own with:<br />
<br />
{{hc|$ sudo -l|<nowiki><br />
Matching Defaults entries for yourusename on this host:<br />
loglinelen=0, logfile=/var/log/sudo.log, log_year, syslog=auth, mailto=sqpt.webmaster@gmail.com, mail_badpass, mail_no_user, mail_no_perms, env_reset, always_set_home, tty_tickets, lecture=always, pwfeedback, rootpw, set_home<br />
<br />
User yourusename may run the following commands on this host:<br />
<br />
(ALL) ALL<br />
(ALL) NOPASSWD: /usr/bin/lsof, /bin/nice, /usr/bin/ss, /usr/bin/su, /usr/bin/locate, /usr/bin/find, /usr/bin/rsync, /usr/bin/strace,<br />
(ALL) /bin/nice, /bin/kill, /usr/bin/nice, /usr/bin/ionice, /usr/bin/top, /usr/bin/kill, /usr/bin/killall, /usr/bin/ps, /usr/bin/pkill<br />
(ALL) /usr/bin/gparted, /usr/bin/pacman<br />
(ALL) /usr/local/bin/synergyc, /usr/local/bin/synergys<br />
(ALL) /usr/bin/vim, /usr/bin/nano, /usr/bin/cat<br />
(root) NOPASSWD: /usr/local/bin/synergyc</nowiki>}}<br />
<br />
=== Permissive Umask ===<br />
<br />
Sudo will union the user's [[umask]] value with its own umask (which defaults to 0022). This prevents sudo from creating files with more open permissions than the user's umask allows. While this is a sane default if no custom umask is in use, this can lead to situations where a utility run by sudo may create files with different permissions than if run by root directly. If errors arise from this, sudo provides a means to fix the umask, even if the desired umask is more permissive than the umask that the user has specified. Adding this (using {{ic|visudo}}) will override sudo's default behavior:<br />
<br />
Defaults umask = 0022<br />
Defaults umask_override<br />
<br />
This sets sudo's umask to root's default umask (0022) and overrides the default behavior, always using the indicated umask regardless of what umask the user as set.<br />
<br />
<br />
=== Defaults Skeleton ===<br />
<br />
At [http://www.gratisoft.us/sudo/sudoers.man.html#sudoers_options this link] you can find a list of all the options available to use with the {{ic|Defaults}} command in {{ic|/etc/sudoers}}.<br />
<br />
{{Poor writing|the comments in the following block of code are truncated.}}<br />
The same list is reproduced right below in a format optimized for copying and pasting it in your sudoers files and then make changes.<br />
<br />
{{bc|<nowiki><br />
#Defaults always_set_home<br />
# always_set_home: If enabled, sudo will set the HOME environment variable to the home directory of the target user (which is root unless the -u option is used). This effectively means that the -H op<br />
# always_set_home is only effective for configurations where either env_reset is disabled or HOME is present in the env_keep list. This flag is off by default.<br />
<br />
#Defaults authenticate<br />
# authenticate: If set, users must authenticate themselves via a password (or other means of authentication) before they may run commands. This default may be overridden via the PASSWD and NOPASSWD t<br />
<br />
#Defaults closefrom_override<br />
# closefrom_override: If set, the user may use sudo's -C option which overrides the default starting point at which sudo begins closing open file descriptors. This flag is off by default.<br />
<br />
#Defaults compress_io<br />
# compress_io: If set, and sudo is configured to log a command's input or output, the I/O logs will be compressed using zlib. This flag is on by default when sudo is compiled with zlib support.<br />
<br />
#Defaults env_editor<br />
# env_editor: If set, visudo will use the value of the EDITOR or VISUAL environment variables before falling back on the default editor list. Note that this may create a security hole as it allows th<br />
# separated list of editors in the editor variable. visudo will then only use the EDITOR or VISUAL if they match a value specified in editor. This flag is on by default.<br />
<br />
#Defaults env_reset<br />
# env_reset: If set, sudo will run the command in a minimal environment containing the TERM, PATH, HOME, MAIL, SHELL, LOGNAME, USER, USERNAME and SUDO_* variables. Any variables in the caller's envir<br />
# in the file specified by the env_file option (if any). The default contents of the env_keep and env_check lists are displayed when sudo is run by root with the -V option. If the secure_path opti<br />
# default.<br />
<br />
#Defaults fast_glob<br />
# fast_glob: Normally, sudo uses the glob(3) function to do shell-style globbing when matching path names. However, since it accesses the file system, glob(3) can take a long time to complete for som<br />
# (automounted). The fast_glob option causes sudo to use the fnmatch(3) function, which does not access the file system to do its matching. The disadvantage of fast_glob is that it is unable to ma<br />
# names that include globbing characters are used with the negation operator, '!', as such rules can be trivially bypassed. As such, this option should not be used when sudoers contains rules that<br />
<br />
#Defaults fqdn<br />
# fqdn: Set this flag if you want to put fully qualified host names in the sudoers file. I.e., instead of myhost you would use myhost.mydomain.edu. You may still use the short form if you wish (and<br />
# sudo unusable if DNS stops working (for example if the machine is not plugged into the network). Also note that you must use the host's official name as DNS knows it. That is, you may not use a<br />
# all aliases from DNS. If your machine's host name (as returned by the hostname command) is already fully qualified you shouldn't need to set fqdn. This flag is off by default.<br />
<br />
#Defaults ignore_dot<br />
# ignore_dot: If set, sudo will ignore '.' or '' (current dir) in the PATH environment variable; the PATH itself is not modified. This flag is off by default.<br />
<br />
#Defaults ignore_local_sudoers<br />
# ignore_local_sudoers: If set via LDAP, parsing of /etc/sudoers will be skipped. This is intended for Enterprises that wish to prevent the usage of local sudoers files so that only LDAP is used. Th<br />
# present, /etc/sudoers does not even need to exist. Since this option tells sudo how to behave when no specific LDAP entries have been matched, this sudoOption is only meaningful for the cn=default<br />
<br />
#Defaults insults<br />
# insults: If set, sudo will insult users when they enter an incorrect password. This flag is off by default.<br />
<br />
#Defaults log_host<br />
# log_host: If set, the host name will be logged in the (non-syslog) sudo log file. This flag is off by default.<br />
<br />
#Defaults log_input<br />
# log_input: If set, sudo will run the command in a pseudo tty and log all user input. If the standard input is not connected to the user's tty, due to I/O redirection or because the command is part<br />
# Input is logged to the directory specified by the iolog_dir option (/var/log/sudo-io by default) using a unique session ID that is included in the normal sudo log line, prefixed with TSID=. The i<br />
# Note that user input may contain sensitive information such as passwords (even if they are not echoed to the screen), which will be stored in the log file unencrypted. In most cases, logging the<br />
<br />
#Defaults log_output<br />
# log_output: If set, sudo will run the command in a pseudo tty and log all output that is sent to the screen, similar to the script(1) command. If the standard output or standard error is not connec<br />
# is also captured and stored in separate log files.<br />
# Output is logged to the directory specified by the iolog_dir option (/var/log/sudo-io by default) using a unique session ID that is included in the normal sudo log line, prefixed with TSID=. The<br />
# Output logs may be viewed with the sudoreplay(8) utility, which can also be used to list or search the available logs.<br />
<br />
#Defaults log_year<br />
# log_year: If set, the four-digit year will be logged in the (non-syslog) sudo log file. This flag is off by default.<br />
<br />
#Defaults long_otp_prompt<br />
# long_otp_prompt: When validating with a One Time Password (OTP) scheme such as S/Key or OPIE, a two-line prompt is used to make it easier to cut and paste the challenge to a local window. It's not<br />
<br />
#Defaults mail_always<br />
# mail_always: Send mail to the mailto user every time a users runs sudo. This flag is off by default.<br />
<br />
#Defaults mail_badpass<br />
# mail_badpass: Send mail to the mailto user if the user running sudo does not enter the correct password. This flag is off by default.<br />
<br />
#Defaults mail_no_host<br />
# mail_no_host: If set, mail will be sent to the mailto user if the invoking user exists in the sudoers file, but is not allowed to run commands on the current host. This flag is off by default.<br />
<br />
#Defaults mail_no_perms<br />
# mail_no_perms: If set, mail will be sent to the mailto user if the invoking user is allowed to use sudo but the command they are trying is not listed in their sudoers file entry or is explicitly den<br />
<br />
#Defaults mail_no_user<br />
# mail_no_user: If set, mail will be sent to the mailto user if the invoking user is not in the sudoers file. This flag is on by default.<br />
<br />
#Defaults noexec<br />
# noexec: If set, all commands run via sudo will behave as if the NOEXEC tag has been set, unless overridden by a EXEC tag. See the description of NOEXEC and EXEC below as well as the "PREVENTING SHE<br />
<br />
#Defaults path_info<br />
# path_info: Normally, sudo will tell the user when a command could not be found in their PATH environment variable. Some sites may wish to disable this as it could be used to gather information on t<br />
# the executable is simply not in the user's PATH, sudo will tell the user that they are not allowed to run it, which can be confusing. This flag is on by default.<br />
<br />
#Defaults passprompt_override<br />
# passprompt_override: The password prompt specified by passprompt will normally only be used if the password prompt provided by systems such as PAM matches the string "Password:". If passprompt_over<br />
<br />
#Defaults preserve_groups<br />
# preserve_groups: By default, sudo will initialize the group vector to the list of groups the target user is in. When preserve_groups is set, the user's existing group vector is left unaltered. The<br />
# default.<br />
<br />
#Defaults pwfeedback<br />
# pwfeedback: By default, sudo reads the password like most other Unix programs, by turning off echo until the user hits the return (or enter) key. Some users become confused by this as it appears to<br />
# the user presses a key. Note that this does have a security impact as an onlooker may be able to determine the length of the password being entered. This flag is off by default.<br />
<br />
#Defaults requiretty<br />
# requiretty: If set, sudo will only run when the user is logged in to a real tty. When this flag is set, sudo can only be run from a login session and not via other means such as cron(8) or cgi-bin<br />
<br />
#Defaults root_sudo<br />
# root_sudo: If set, root is allowed to run sudo too. Disabling this prevents users from "chaining" sudo commands to get a root shell by doing something like "sudo sudo /bin/sh". Note, however, that<br />
# real additional security; it exists purely for historical reasons. This flag is on by default.<br />
<br />
#Defaults rootpw<br />
# rootpw: If set, sudo will prompt for the root password instead of the password of the invoking user. This flag is off by default.<br />
<br />
#Defaults runaspw<br />
# runaspw: If set, sudo will prompt for the password of the user defined by the runas_default option (defaults to root) instead of the password of the invoking user. This flag is off by default.<br />
<br />
#Defaults set_home<br />
# set_home: If enabled and sudo is invoked with the -s option the HOME environment variable will be set to the home directory of the target user (which is root unless the -u option is used). This eff<br />
# is enabled, so set_home is only effective for configurations where either env_reset is disabled or HOME is present in the env_keep list. This flag is off by default.<br />
<br />
#Defaults set_logname<br />
# set_logname: Normally, sudo will set the LOGNAME, USER and USERNAME environment variables to the name of the target user (usually root unless the -u option is given). However, since some programs (<br />
# may be desirable to change this behavior. This can be done by negating the set_logname option. Note that if the env_reset option has not been disabled, entries in the env_keep list will override<br />
<br />
#Defaults set_utmp<br />
# set_utmp: When enabled, sudo will create an entry in the utmp (or utmpx) file when a pseudo-tty is allocated. A pseudo-tty is allocated by sudo when the log_input, log_output or use_pty flags are e<br />
# the tty, time, type and pid fields updated. This flag is on by default.<br />
<br />
#Defaults setenv<br />
# setenv: Allow the user to disable the env_reset option from the command line via the -E option. Additionally, environment variables set via the command line are not subject to the restrictions impo<br />
# variables in this manner. This flag is off by default.<br />
<br />
#Defaults shell_noargs<br />
# shell_noargs: If set and sudo is invoked with no arguments it acts as if the -s option had been given. That is, it runs a shell as root (the shell is determined by the SHELL environment variable if<br />
# is off by default.<br />
<br />
#Defaults stay_setuid<br />
# stay_setuid: Normally, when sudo executes a command the real and effective UIDs are set to the target user (root by default). This option changes that behavior such that the real UID is left as the<br />
# systems that disable some potentially dangerous functionality when a program is run setuid. This option is only effective on systems with either the setreuid() or setresuid() function. This flag<br />
<br />
#Defaults targetpw<br />
# targetpw: If set, sudo will prompt for the password of the user specified by the -u option (defaults to root) instead of the password of the invoking user. In addition, the timestamp file name will<br />
# passwd database as an argument to the -u option. This flag is off by default.<br />
<br />
#Defaults tty_tickets<br />
# tty_tickets: If set, users must authenticate on a per-tty basis. With this flag enabled, sudo will use a file named for the tty the user is logged in on in the user's time stamp directory. If disa<br />
<br />
#Defaults umask_override<br />
# umask_override: If set, sudo will set the umask as specified by sudoers without modification. This makes it possible to specify a more permissive umask in sudoers than the user's own umask and matc<br />
# user's umask and what is specified in sudoers. This flag is off by default.<br />
<br />
#Defaults use_pty<br />
# use_pty: If set, sudo will run the command in a pseudo-pty even if no I/O logging is being gone. A malicious program run under sudo could conceivably fork a background process that retains to the u<br />
# that impossible. This flag is off by default.<br />
<br />
#Defaults utmp_runas<br />
# utmp_runas: If set, sudo will store the name of the runas user when updating the utmp (or utmpx) file. By default, sudo stores the name of the invoking user. This flag is off by default.<br />
<br />
#Defaults visiblepw<br />
# visiblepw: By default, sudo will refuse to run if the user must enter a password but it is not possible to disable echo on the terminal. If the visiblepw flag is set, sudo will prompt for a passwor<br />
# somehost sudo ls" since rsh(1) does not allocate a tty. This flag is off by default.<br />
<br />
#Defaults closefrom<br />
# closefrom: Before it executes a command, sudo will close all open file descriptors other than standard input, standard output and standard error (ie: file descriptors 0-2). The closefrom option can<br />
<br />
#Defaults passwd_tries<br />
# passwd_tries: The number of tries a user gets to enter his/her password before sudo logs the failure and exits. The default is 3.<br />
<br />
#Defaults loglinelen<br />
# loglinelen: Number of characters per line for the file log. This value is used to decide when to wrap lines for nicer log files. This has no effect on the syslog log file, only the file log. The<br />
<br />
#Defaults passwd_timeout<br />
# passwd_timeout: Number of minutes before the sudo password prompt times out, or 0 for no timeout. The timeout may include a fractional component if minute granularity is insufficient, for example 2<br />
<br />
#Defaults timestamp_timeout<br />
# timestamp_timeout: Number of minutes that can elapse before sudo will ask for a passwd again. The timeout may include a fractional component if minute granularity is insufficient, for example 2.5.<br />
# timestamp will never expire. This can be used to allow users to create or delete their own timestamps via sudo -v and sudo -k respectively.<br />
<br />
#Defaults umask<br />
# umask: Umask to use when running the command. Negate this option or set it to 0777 to preserve the user's umask. The actual umask that is used will be the union of the user's umask and the value o<br />
# running a command. Note on systems that use PAM, the default PAM configuration may specify its own umask which will override the value set in sudoers.<br />
<br />
#Defaults badpass_message<br />
# badpass_message: Message that is displayed if a user enters an incorrect password. The default is Sorry, try again. unless insults are enabled.<br />
<br />
#Defaults editor<br />
# editor: A colon (':') separated list of editors allowed to be used with visudo. visudo will choose the editor that matches the user's EDITOR environment variable if possible, or the first editor in<br />
<br />
#Defaults iolog_dir<br />
# iolog_dir: The top-level directory to use when constructing the path name for the input/output log directory. Only used if the log_input or log_output options are enabled or when the LOG_INPUT or L<br />
# directory. The default is "/var/log/sudo-io".<br />
# The following percent (`%') escape sequences are supported:<br />
# %{seq} - expanded to a monotonically increasing base-36 sequence number, such as 0100A5, where every two digits are used to form a new directory, e.g. 01/00/A5<br />
# %{user} - expanded to the invoking user's login name<br />
# %{group} - expanded to the name of the invoking user's real group ID<br />
# %{runas_user} - expanded to the login name of the user the command will be run as (e.g. root)<br />
# %{runas_group} - expanded to the group name of the user the command will be run as (e.g. wheel)<br />
# %{hostname} - expanded to the local host name without the domain name<br />
# %{command} - expanded to the base name of the command being run<br />
# In addition, any escape sequences supported by the system's strftime() function will be expanded.<br />
# To include a literal `%' character, the string `%%' should be used.<br />
<br />
#Defaults iolog_file<br />
# iolog_file: The path name, relative to iolog_dir, in which to store input/output logs when the log_input or log_output options are enabled or when the LOG_INPUT or LOG_OUTPUT tags are present for a<br />
# See the iolog_dir option above for a list of supported percent (`%') escape sequences.<br />
# In addition to the escape sequences, path names that end in six or more Xs will have the Xs replaced with a unique combination of digits and letters, similar to the mktemp() function.<br />
<br />
#Defaults mailsub<br />
# mailsub: Subject of the mail sent to the mailto user. The escape %h will expand to the host name of the machine. Default is *** SECURITY information for %h ***.<br />
<br />
#Defaults noexec_file<br />
# noexec_file: This option is no longer supported. The path to the noexec file should now be set in the /etc/sudo.conf file.<br />
<br />
#Defaults passprompt<br />
# passprompt: The default prompt to use when asking for a password; can be overridden via the -p option or the SUDO_PROMPT environment variable. The following percent (`%') escape sequences are suppo<br />
# %H expanded to the local host name including the domain name (only if the machine's host name is fully qualified or the fqdn option is set)<br />
# %h expanded to the local host name without the domain name<br />
# %p expanded to the user whose password is being asked for (respects the rootpw, targetpw and runaspw flags in sudoers)<br />
# %U expanded to the login name of the user the command will be run as (defaults to root)<br />
# %u expanded to the invoking user's login name<br />
# %% two consecutive % characters are collapsed into a single % character<br />
# The default value is Password:.<br />
<br />
#Defaults runas_default<br />
# runas_default: The default user to run commands as if the -u option is not specified on the command line. This defaults to root.<br />
<br />
#Defaults syslog_badpri<br />
# syslog_badpri: Syslog priority to use when user authenticates unsuccessfully. Defaults to alert.<br />
# The following syslog priorities are supported: alert, crit, debug, emerg, err, info, notice, and warning.<br />
<br />
#Defaults syslog_goodpri<br />
# syslog_goodpri: Syslog priority to use when user authenticates successfully. Defaults to notice.<br />
# See syslog_badpri for the list of supported syslog priorities.<br />
<br />
#Defaults sudoers_locale<br />
# sudoers_locale: Locale to use when parsing the sudoers file, logging commands, and sending email. Note that changing the locale may affect how sudoers is interpreted. Defaults to "C".<br />
<br />
#Defaults timestampdir<br />
# timestampdir: The directory in which sudo stores its timestamp files. The default is /var/db/sudo.<br />
<br />
#Defaults timestampowner<br />
# timestampowner: The owner of the timestamp directory and the timestamps stored therein. The default is root.<br />
<br />
#Defaults env_file<br />
# env_file: The env_file option specifies the fully qualified path to a file containing variables to be set in the environment of the program being run. Entries in this file should either be of the f<br />
# quotes. Variables in this file are subject to other sudo environment settings such as env_keep and env_check.<br />
<br />
#Defaults exempt_group<br />
# exempt_group: Users in this group are exempt from password and PATH requirements. The group name specified should not include a % prefix. This is not set by default.<br />
<br />
#Defaults group_plugin<br />
# group_plugin: A string containing a sudoers group plugin with optional arguments. This can be used to implement support for the nonunix_group syntax described earlier. The string should consist of<br />
# configuration arguments the plugin requires. These arguments (if any) will be passed to the plugin's initialization function. If arguments are present, the string must be enclosed in double quot<br />
# For example, given /etc/sudo-group, a group file in Unix group format, the sample group plugin can be used:<br />
# Defaults group_plugin="sample_group.so /etc/sudo-group"<br />
# For more information see sudo_plugin(5).<br />
<br />
#Defaults lecture<br />
# lecture: This option controls when a short lecture will be printed along with the password prompt. It has the following possible values:<br />
# always Always lecture the user.<br />
# never Never lecture the user.<br />
# once Only lecture the user the first time they run sudo.<br />
# If no value is specified, a value of once is implied. Negating the option results in a value of never being used. The default value is once.<br />
<br />
#Defaults lecture_file<br />
# lecture_file: Path to a file containing an alternate sudo lecture that will be used in place of the standard lecture if the named file exists. By default, sudo uses a built-in lecture.<br />
<br />
#Defaults listpw<br />
# listpw: This option controls when a password will be required when a user runs sudo with the -l option. It has the following possible values:<br />
# all All the user's sudoers entries for the current host must have the NOPASSWD flag set to avoid entering a password.<br />
# always The user must always enter a password to use the -l option.<br />
# any At least one of the user's sudoers entries for the current host must have the NOPASSWD flag set to avoid entering a password.<br />
# never The user need never enter a password to use the -l option.<br />
# If no value is specified, a value of any is implied. Negating the option results in a value of never being used. The default value is any.<br />
<br />
#Defaults logfile<br />
# logfile: Path to the sudo log file (not the syslog log file). Setting a path turns on logging to a file; negating this option turns it off. By default, sudo logs via syslog.<br />
<br />
#Defaults mailerflags<br />
# mailerflags: Flags to use when invoking mailer. Defaults to -t.<br />
<br />
#Defaults mailerpath<br />
# mailerpath: Path to mail program used to send warning mail. Defaults to the path to sendmail found at configure time.<br />
<br />
#Defaults mailfrom<br />
# mailfrom: Address to use for the "from" address when sending warning and error mail. The address should be enclosed in double quotes (") to protect against sudo interpreting the @ sign. Defaults t<br />
<br />
#Defaults mailto<br />
# mailto: Address to send warning and error mail to. The address should be enclosed in double quotes (") to protect against sudo interpreting the @ sign. Defaults to root.<br />
<br />
#Defaults secure_path<br />
# secure_path: Path used for every command run from sudo. If you don't trust the people running sudo to have a sane PATH environment variable you may want to use this. Another use is if you want to<br />
# option are not affected by secure_path. This option is not set by default.<br />
<br />
#Defaults syslog<br />
# syslog: Syslog facility if syslog is being used for logging (negate to disable syslog logging). Defaults to auth.<br />
# The following syslog facilities are supported: authpriv (if your OS supports it), auth, daemon, user, local0, local1, local2, local3, local4, local5, local6, and local7.<br />
<br />
#Defaults verifypw<br />
# verifypw: This option controls when a password will be required when a user runs sudo with the -v option. It has the following possible values:<br />
# all All the user's sudoers entries for the current host must have the NOPASSWD flag set to avoid entering a password.<br />
# always The user must always enter a password to use the -v option.<br />
# any At least one of the user's sudoers entries for the current host must have the NOPASSWD flag set to avoid entering a password.<br />
# never The user need never enter a password to use the -v option.<br />
# If no value is specified, a value of all is implied. Negating the option results in a value of never being used. The default value is all.<br />
<br />
#Defaults env_check<br />
# env_check: Environment variables to be removed from the user's environment if the variable's value contains % or / characters. This can be used to guard against printf-style format vulnerabilities<br />
# value without double-quotes. The list can be replaced, added to, deleted from, or disabled by using the =, +=, -=, and ! operators respectively. Regardless of whether the env_reset option is ena<br />
# they pass the aforementioned check. The default list of environment variables to check is displayed when sudo is run by root with the -V option.<br />
<br />
#Defaults env_delete<br />
# env_delete: Environment variables to be removed from the user's environment when the env_reset option is not in effect. The argument may be a double-quoted, space-separated list or a single value w<br />
# +=, -=, and ! operators respectively. The default list of environment variables to remove is displayed when sudo is run by root with the -V option. Note that many operating systems will remove p<br />
<br />
#Defaults env_keep<br />
# env_keep: Environment variables to be preserved in the user's environment when the env_reset option is in effect. This allows fine-grained control over the environment sudo-spawned processes will r<br />
# quotes. The list can be replaced, added to, deleted from, or disabled by using the =, +=, -=, and ! operators respectively. The default list of variables to keep is displayed when sudo is run by<br />
</nowiki>}}</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Btrfs&diff=276007Btrfs2013-09-19T00:59:15Z<p>Sushi Dude: Included link and reworded sentence.</p>
<hr />
<div>[[Category:File systems]]<br />
[[ja:Btrfs]]<br />
[[zh-CN:Btrfs]]<br />
{{Article summary start}}<br />
{{Article summary text|Provides an overview and setup of Btrfs on Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Installing on Btrfs root}}<br />
{{Article summary wiki|Btrfs - Tips and tricks}}<br />
{{Article summary end}}<br />
<br />
Btrfs is an abbreviation for '''B-tree''' '''F'''ile '''S'''ystem and is also known as "Butter FS" or "Better FS". Btrfs is a copy-on-write (COW) file system written from the ground up for Linux. It is aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration. Jointly developed by Oracle, Red Hat, Fujitsu, Intel, SUSE and many others, Btrfs is licensed under the GPL and open for contribution from anyone.<br />
<br />
== Installation ==<br />
<br />
Btrfs is included in the default kernel and its tools ({{pkg|btrfs-progs}}) are available in the [core] repository. [[GRUB|GRUB 2]], [[mkinitcpio]], and [[Syslinux]] have support for Btrfs and require no additional configuration.<br />
<br />
== File system creation ==<br />
<br />
A Btrfs file system can either be newly created or have one converted.<br />
<br />
=== Creating a new file system ===<br />
<br />
To format do a partition do:<br />
<br />
# mkfs.btrfs /dev/<partition><br />
<br />
{{Note|As of Btrfs v0.20-rc1-253-g7854c8b, the default blocksize is 4k.}}<br />
<br />
To use a larger blocksize for data/meta data, specify a value for the leafsize via the -l switch as shown in this example using 16k blocks:<br />
<br />
# mkfs.btrfs -l 16k /dev/<partition><br />
<br />
Multiple devices can be entered to create a RAID. Supported RAID levels include RAID 0, RAID 1 and RAID 10. By default the metadata is mirrored and data is striped.<br />
<br />
# mkfs.btrfs [options] /dev/<part1> /dev/<part2><br />
<br />
=== Convert from Ext3/4 ===<br />
<br />
Boot from an install CD, then convert by doing:<br />
<br />
# btrfs-convert /dev/<partition><br />
<br />
Mount the partion and test the conversion by checking the files. Be sure to change the {{ic|/etc/fstab}} to reflect the change ('''type''' to btrfs and '''fs_passno''' [the last field] to 0 as Btrfs does not do a file system check on boot). Also note that the UUID of the partition will have changed, so update your fstab accordingly if you use UUIDs. {{ic|chroot}} into the system and rebuild the GRUB menu list (see [[Install from Existing Linux]] and [[GRUB]] articles).<br />
<br />
To complete, delete the saved image, delete the sub-volume that image is on, then balance the drive to reclaim the space.<br />
<br />
# rm /ext2_saved/*<br />
# btrfs subvolume delete /ext2_saved<br />
<br />
== Limitations ==<br />
<br />
A few limitations should be known before trying.<br />
<br />
=== Encryption ===<br />
<br />
Btrfs has no built-in encryption support (this may come in future), but you can encrypt the partition before running <code>mkfs.btrfs</code>. See [[Dm-crypt with LUKS]]. <br />
<br />
(If you've already created a btrfs file system, you can also use something like [[EncFS]] or [[TrueCrypt]], though perhaps without some of btrfs' features.)<br />
<br />
=== Swap file ===<br />
<br />
Btrfs does not support swap files. This is due to swap files requiring a function that Btrfs doesn't have for possibility of corruptions.<sup>[https://btrfs.wiki.kernel.org/index.php/FAQ#Does_btrfs_support_swap_files.3F link]</sup> A swap file can be mounted on a loop device with poorer performance but will not be able to hibernate. A systemd service file is available {{AUR|systemd-loop-swapfile}}.<br />
<br />
=== GRUB2 and core.img ===<br />
<br />
[[GRUB|Grub 2]] can boot Btrfs partitions however the module is larger than e.g. ext4 and the core.img file made by grub-install may not fit between the MBR and the first partition. This can be solved by using GPT or by putting an extra 1 or 2 MB of free space before the first partition.<br />
<br />
If you get the following: {{ic|1=error no such device: root}} when booting from a RAID style setup then edit /usr/share/grub/grub-mkconfig_lib and remove both quotes from the line {{ic|1=echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"}}. Regenerate the config for grub and your system should boot without an error.<br />
<br />
== Features ==<br />
<br />
Various features are available and can be adjusted.<br />
<br />
=== Copy-On-Write (CoW) ===<br />
The resolution at which data are written to the filesystem is dictated by BTRFS itself and by system-wide settings. BTRFS defaults to a 30 sec checkpoint interval in which new data are committed to the filesystem. As of Btrfs v0.20-rc1-253-g7854c8b users cannot tweak this without recompiling a [http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg26090.html patched version of fs/btrfs/disk-io.c]. On 01-Aug-2013, David Sterba submitted [http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg26116.html this patch] to make this a formal mount time tuneable.<br />
<br />
System-wide settings also affect commit intervals. They include the files under /proc/sys/vm/* and are out-of-scope of this wiki article. The kernel documentation for them resides in Documentation/sysctl/vm.txt.<br />
<br />
CoW comes with some advantages, but can negatively affect performance with large files that have small random writes. It is recommended to disable CoW for database files and virtual machine images. <br />
You can disable CoW for the entire block device by mounting it with "nodatacow" option. However, this will disable CoW for the entire file system.<br />
<br />
To disable CoW for single files/directories do:<br />
<br />
# chattr +C </dir/file><br />
<br />
Note, from chattr man page: For btrfs, the 'C' flag should be set on new or empty files. If it is set on a file which already has data blocks, it is undefined when the blocks assigned to the file will be fully stable. If the 'C' flag is set on a directory, it will have no effect on the directory, but new files created in that directory will have the No_COW attribute.<br />
<br />
Likewise, to save space by forcing CoW when copying files use:<br />
<br />
# cp --reflink source dest <br />
<br />
As dest file is changed, only those blocks that are changed from source will be written to the disk. One might consider aliasing aliasing cp to 'cp --reflink=auto'<br />
<br />
=== Multi-device filesystem and RAID feature ===<br />
====Multi-device filesystem====<br />
<br />
When creating a ''btrfs'' filesystem, you can pass as many partitions or disk devices as you want to ''mkfs.btrfs''. The filesystem will be created across these devices. You can '''"'''pool'''"''' this way, multiple partitions or devices to get a big ''btrfs'' filesystem.<br />
<br />
You can also add or remove device from an existing btrfs filesystem (caution is mandatory).<br />
<br />
A multi-device ''btrfs'' filesystem (also called a btrfs volume) is not recognized until <br />
# btrfs device scan<br />
has been run. This is the purpose of the ''btrfs'' mkinitcpio hook or the ''USEBTRFS'' variable in /etc/rc.conf<br />
<br />
====RAID features====<br />
<br />
When creating multi-device filesystem, you can also specify to use RAID0, RAID1 or RAID10 across the devices you have added to the filesystem. RAID levels can be applied independently to data and meta data. By default, meta data is duplicated on single volumes or RAID1 on multi-disk sets.<br />
<br />
btrfs works in block-pairs for raid0, raid1, and raid10. This means:<br />
<br />
raid0 - block-pair stripped across 2 devices<br><br />
raid1 - block-pair written to 2 devices<br />
<br />
For 2 disk sets, this matches raid levels as defined in md-raid (mdadm). For 3+ disk-sets, the result is entirely different than md-raid. <br />
<br />
For example:<br><br />
3 1TB disks in an md based raid1 yields a /dev/md0 with 1TB free space and the ability to safely loose 2 disks without losing data.<br />
3 1TB disks in a btrfs volume with data=raid1 will allow the storage of approximately 1.5TB of data before reporting full. Only 1 disk can safely be lost without losing data.<br />
<br />
btrfs uses a round-robin scheme to decide how block-pairs are spread among disks. As of Linux 3.0, a quasi-round-robin scheme is used which prefers larger disks when distributing block pairs. This allows raid0 and raid1 to take advantage of most (and sometimes all) space in a disk set made of multiple disks. For example, a set consisting of a 1TB disk and 2 500GB disks with data=raid1 will place a copy of every block on the 1TB disk and alternate (round-robin) placing blocks on each of the 500GB disks. Full space utilization will be made. A set made from a 1TB disk, a 750GB disk, and a 500GB disk will work the same, but the filesystem will report full with 250GB unusable on the 750GB disk. To always take advantage of the full space (even in the last example), use data=single. (data=single is akin to JBOD defined by some raid controllers) See [https://btrfs.wiki.kernel.org/index.php/FAQ#How_much_space_do_I_get_with_unequal_devices_in_RAID-1_mode.3F the BTRFS FAQ] for more info.<br />
<br />
=== Sub-volumes ===<br />
<br />
One of the features of Btrfs is the use of sub-volumes. Sub-volumes are basically a named btree that holds files and directories. They have inodes inside the tree of tree roots and can have non-root owners and groups. Sub-volumes can optionally be given a quota of blocks. All of the blocks and file extents inside of sub-volumes are reference counted to allow snapshotting. This is similar to the dynamically expanding storage of a virtual machine that will only use as much space on a device as needed, eliminating several half-filled partitions. One can also mount the sub-volumes with different mount options, giving more flexibility in security. <br />
<br />
To create a sub-volume:<br />
<br />
# btrfs subvolume create [<dest>/]<br />
<br />
For increased flexibility, install your system into a dedicated sub-volume, and, in the kernel boot parameters, use:<br />
<br />
{{bc|1=rootflags=subvol=<whatever you called the subvol>}}<br />
<br />
This makes system rollbacks possible.<br />
<br />
If using for the root partition, it is advisable to add '''crc32c''' (or '''crc32c-intel''' for Intel machines) to the modules array in {{ic|/etc/mkinitcpio.conf}}.<br />
<br />
=== Snapshots ===<br />
<br />
To create a snapshot:<br />
<br />
# btrfs subvolume snapshot <source> [<dest>/]<name><br />
<br />
Snapshots are not recursive, this means that every subvolume inside subvolume will be an empty directory inside the snapshot.<br />
<br />
=== Defragmentation ===<br />
<br />
Btrfs supports online defragmentation. To defragment the metadata of the root folder do:<br />
<br />
# btrfs filesystem defragment /<br />
<br />
This ''will not'' defragment the entire system. For more information read [https://btrfs.wiki.kernel.org/index.php/Problem_FAQ#Defragmenting_a_directory_doesn.27t_work this page] on the btrfs wiki.<br />
<br />
To defragment the entire system verbosely do:<br />
<br />
# find / -xdev -type f -print -exec btrfs filesystem defrag '{}' \;<br />
<br />
=== Compression ===<br />
<br />
Btrfs supports transparent compression, which means every file on the partition is automatically compressed. This does not only reduce the size of those files, but also [http://www.phoronix.com/scan.php?page=article&item=btrfs_compress_2635&num=1 improves performance], in particular if using the [http://www.phoronix.com/scan.php?page=article&item=btrfs_lzo_2638&num=1 lzo algorithm]. Compression is enabled using the {{ic|1=compress=gzip}} or {{ic|1=compress=lzo}} mount options. Only files created or modified after the mount option is added will be compressed, so to fully benefit from compression it should be enabled during installation. <br />
<br />
However, it can quite easily be applied to a subvolume using the defragment -czlib (or whichever algorithm you so choose) command (the same command above could be used, by adding the -czlib and such, to recursively apply). Also keep in mind that for future files to be compressed, a simple 'chattr +c' should be applied to some directories, so as to automatically compress new files as they come.<br />
<br />
After [[Beginners%27_Guide#Prepare_the_storage_drive|preparing the storage drive]], simply switch to another terminal ({{ic|Ctrl+Alt+number}}), and run the following command:<br />
<br />
# mount -o remount,compress=lzo /dev/sdXY /mnt/target<br />
<br />
After the installation is finished, add {{ic|1=compress=lzo}} to the mount options of the root filesystem in {{ic|/etc/[[fstab]]}}.<br />
<br />
=== Partitioning ===<br />
<br />
Btrfs can occupy whole disk without the need of using classical partitioning schemes like [[MBR]] or [[GPT]]; [[Btrfs#Sub-volumes|subvolumes]] can be then used to simulate partitions. There are some limitations to the approach (all only valid if single disk is used):<br />
<br />
* You can not use different [[File_Systems|file systems]] for different [[fstab|mount points]],<br />
* You can not use [[Swap|swap area]] as Btrfs does not support [[Swap#Swap_file|swap files]] and there is no place to create [[Swap#Swap_partition|swap partition]],<br />
* You can not use [[EFI]] to boot.<br />
<br />
To set your disk this way, just go:<br />
# mkfs.btrfs /dev/sdX<br />
and NOT /dev/sdaX as there are no partitions. Then just install your [[Bootloader|boot loader]] as you would do on MBR, e.g.:<br />
# grub-install --recheck /dev/sdX<br />
for [[Grub#Install_to_440-byte_MBR_boot_code_region|GRUB]].<br />
<br />
== Resources ==<br />
<br />
* [https://btrfs.wiki.kernel.org/ Btrfs Wiki]<br />
* [https://btrfs.wiki.kernel.org/index.php/Problem_FAQ BTRFS Problem FAQ] - Official FAQ<br />
* [http://www.funtoo.org/wiki/BTRFS_Fun Funtoo Btrfs wiki entry] - Very well-written article<br />
* [http://www.phoronix.com/scan.php?page=news_item&px=MTA0ODU Avi Miller presenting BTRFS] at SCALE 10x. Jan/2012.<br />
* [http://www.phoronix.com/scan.php?page=news_item&px=MTA4Mzc Summary of Chris Mason's talk from LFCS 2012]<br />
* On 2012-03-28, {{Pkg|btrfs-progs}} includes btrfsck, a tool that can fix errors on btrfs filesystems.<br />
* Oracle has packaged this version of btrfs-progs and released it to their customers of Oracle Linux 6 and backported to 5.<br />
* {{AUR|mkinitcpio-btrfs}}: for roll-back abilities (currently unmaintained).</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Btrfs&diff=276003Btrfs2013-09-19T00:50:33Z<p>Sushi Dude: Btrfs-progs is not in the base group and therefore not in the default installation.</p>
<hr />
<div>[[Category:File systems]]<br />
[[ja:Btrfs]]<br />
[[zh-CN:Btrfs]]<br />
{{Article summary start}}<br />
{{Article summary text|Provides an overview and setup of Btrfs on Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Installing on Btrfs root}}<br />
{{Article summary wiki|Btrfs - Tips and tricks}}<br />
{{Article summary end}}<br />
<br />
Btrfs is an abbreviation for '''B-tree''' '''F'''ile '''S'''ystem and is also known as "Butter FS" or "Better FS". Btrfs is a copy-on-write (COW) file system written from the ground up for Linux. It is aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration. Jointly developed by Oracle, Red Hat, Fujitsu, Intel, SUSE and many others, Btrfs is licensed under the GPL and open for contribution from anyone.<br />
<br />
== Installation ==<br />
<br />
As of the beginning of the year 2013 Btrfs is included in the default kernel and its tools ({{pkg|btrfs-progs}}) are available in the [core] repository. [[GRUB|GRUB 2]], mkinitcpio, and [[Syslinux]] have support for Btrfs and require no additional configuration.<br />
<br />
== File system creation ==<br />
<br />
A Btrfs file system can either be newly created or have one converted.<br />
<br />
=== Creating a new file system ===<br />
<br />
To format do a partition do:<br />
<br />
# mkfs.btrfs /dev/<partition><br />
<br />
{{Note|As of Btrfs v0.20-rc1-253-g7854c8b, the default blocksize is 4k.}}<br />
<br />
To use a larger blocksize for data/meta data, specify a value for the leafsize via the -l switch as shown in this example using 16k blocks:<br />
<br />
# mkfs.btrfs -l 16k /dev/<partition><br />
<br />
Multiple devices can be entered to create a RAID. Supported RAID levels include RAID 0, RAID 1 and RAID 10. By default the metadata is mirrored and data is striped.<br />
<br />
# mkfs.btrfs [options] /dev/<part1> /dev/<part2><br />
<br />
=== Convert from Ext3/4 ===<br />
<br />
Boot from an install CD, then convert by doing:<br />
<br />
# btrfs-convert /dev/<partition><br />
<br />
Mount the partion and test the conversion by checking the files. Be sure to change the {{ic|/etc/fstab}} to reflect the change ('''type''' to btrfs and '''fs_passno''' [the last field] to 0 as Btrfs does not do a file system check on boot). Also note that the UUID of the partition will have changed, so update your fstab accordingly if you use UUIDs. {{ic|chroot}} into the system and rebuild the GRUB menu list (see [[Install from Existing Linux]] and [[GRUB]] articles).<br />
<br />
To complete, delete the saved image, delete the sub-volume that image is on, then balance the drive to reclaim the space.<br />
<br />
# rm /ext2_saved/*<br />
# btrfs subvolume delete /ext2_saved<br />
<br />
== Limitations ==<br />
<br />
A few limitations should be known before trying.<br />
<br />
=== Encryption ===<br />
<br />
Btrfs has no built-in encryption support (this may come in future), but you can encrypt the partition before running <code>mkfs.btrfs</code>. See [[Dm-crypt with LUKS]]. <br />
<br />
(If you've already created a btrfs file system, you can also use something like [[EncFS]] or [[TrueCrypt]], though perhaps without some of btrfs' features.)<br />
<br />
=== Swap file ===<br />
<br />
Btrfs does not support swap files. This is due to swap files requiring a function that Btrfs doesn't have for possibility of corruptions.<sup>[https://btrfs.wiki.kernel.org/index.php/FAQ#Does_btrfs_support_swap_files.3F link]</sup> A swap file can be mounted on a loop device with poorer performance but will not be able to hibernate. A systemd service file is available {{AUR|systemd-loop-swapfile}}.<br />
<br />
=== GRUB2 and core.img ===<br />
<br />
[[GRUB|Grub 2]] can boot Btrfs partitions however the module is larger than e.g. ext4 and the core.img file made by grub-install may not fit between the MBR and the first partition. This can be solved by using GPT or by putting an extra 1 or 2 MB of free space before the first partition.<br />
<br />
If you get the following: {{ic|1=error no such device: root}} when booting from a RAID style setup then edit /usr/share/grub/grub-mkconfig_lib and remove both quotes from the line {{ic|1=echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"}}. Regenerate the config for grub and your system should boot without an error.<br />
<br />
== Features ==<br />
<br />
Various features are available and can be adjusted.<br />
<br />
=== Copy-On-Write (CoW) ===<br />
The resolution at which data are written to the filesystem is dictated by BTRFS itself and by system-wide settings. BTRFS defaults to a 30 sec checkpoint interval in which new data are committed to the filesystem. As of Btrfs v0.20-rc1-253-g7854c8b users cannot tweak this without recompiling a [http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg26090.html patched version of fs/btrfs/disk-io.c]. On 01-Aug-2013, David Sterba submitted [http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg26116.html this patch] to make this a formal mount time tuneable.<br />
<br />
System-wide settings also affect commit intervals. They include the files under /proc/sys/vm/* and are out-of-scope of this wiki article. The kernel documentation for them resides in Documentation/sysctl/vm.txt.<br />
<br />
CoW comes with some advantages, but can negatively affect performance with large files that have small random writes. It is recommended to disable CoW for database files and virtual machine images. <br />
You can disable CoW for the entire block device by mounting it with "nodatacow" option. However, this will disable CoW for the entire file system.<br />
<br />
To disable CoW for single files/directories do:<br />
<br />
# chattr +C </dir/file><br />
<br />
Note, from chattr man page: For btrfs, the 'C' flag should be set on new or empty files. If it is set on a file which already has data blocks, it is undefined when the blocks assigned to the file will be fully stable. If the 'C' flag is set on a directory, it will have no effect on the directory, but new files created in that directory will have the No_COW attribute.<br />
<br />
Likewise, to save space by forcing CoW when copying files use:<br />
<br />
# cp --reflink source dest <br />
<br />
As dest file is changed, only those blocks that are changed from source will be written to the disk. One might consider aliasing aliasing cp to 'cp --reflink=auto'<br />
<br />
=== Multi-device filesystem and RAID feature ===<br />
====Multi-device filesystem====<br />
<br />
When creating a ''btrfs'' filesystem, you can pass as many partitions or disk devices as you want to ''mkfs.btrfs''. The filesystem will be created across these devices. You can '''"'''pool'''"''' this way, multiple partitions or devices to get a big ''btrfs'' filesystem.<br />
<br />
You can also add or remove device from an existing btrfs filesystem (caution is mandatory).<br />
<br />
A multi-device ''btrfs'' filesystem (also called a btrfs volume) is not recognized until <br />
# btrfs device scan<br />
has been run. This is the purpose of the ''btrfs'' mkinitcpio hook or the ''USEBTRFS'' variable in /etc/rc.conf<br />
<br />
====RAID features====<br />
<br />
When creating multi-device filesystem, you can also specify to use RAID0, RAID1 or RAID10 across the devices you have added to the filesystem. RAID levels can be applied independently to data and meta data. By default, meta data is duplicated on single volumes or RAID1 on multi-disk sets.<br />
<br />
btrfs works in block-pairs for raid0, raid1, and raid10. This means:<br />
<br />
raid0 - block-pair stripped across 2 devices<br><br />
raid1 - block-pair written to 2 devices<br />
<br />
For 2 disk sets, this matches raid levels as defined in md-raid (mdadm). For 3+ disk-sets, the result is entirely different than md-raid. <br />
<br />
For example:<br><br />
3 1TB disks in an md based raid1 yields a /dev/md0 with 1TB free space and the ability to safely loose 2 disks without losing data.<br />
3 1TB disks in a btrfs volume with data=raid1 will allow the storage of approximately 1.5TB of data before reporting full. Only 1 disk can safely be lost without losing data.<br />
<br />
btrfs uses a round-robin scheme to decide how block-pairs are spread among disks. As of Linux 3.0, a quasi-round-robin scheme is used which prefers larger disks when distributing block pairs. This allows raid0 and raid1 to take advantage of most (and sometimes all) space in a disk set made of multiple disks. For example, a set consisting of a 1TB disk and 2 500GB disks with data=raid1 will place a copy of every block on the 1TB disk and alternate (round-robin) placing blocks on each of the 500GB disks. Full space utilization will be made. A set made from a 1TB disk, a 750GB disk, and a 500GB disk will work the same, but the filesystem will report full with 250GB unusable on the 750GB disk. To always take advantage of the full space (even in the last example), use data=single. (data=single is akin to JBOD defined by some raid controllers) See [https://btrfs.wiki.kernel.org/index.php/FAQ#How_much_space_do_I_get_with_unequal_devices_in_RAID-1_mode.3F the BTRFS FAQ] for more info.<br />
<br />
=== Sub-volumes ===<br />
<br />
One of the features of Btrfs is the use of sub-volumes. Sub-volumes are basically a named btree that holds files and directories. They have inodes inside the tree of tree roots and can have non-root owners and groups. Sub-volumes can optionally be given a quota of blocks. All of the blocks and file extents inside of sub-volumes are reference counted to allow snapshotting. This is similar to the dynamically expanding storage of a virtual machine that will only use as much space on a device as needed, eliminating several half-filled partitions. One can also mount the sub-volumes with different mount options, giving more flexibility in security. <br />
<br />
To create a sub-volume:<br />
<br />
# btrfs subvolume create [<dest>/]<br />
<br />
For increased flexibility, install your system into a dedicated sub-volume, and, in the kernel boot parameters, use:<br />
<br />
{{bc|1=rootflags=subvol=<whatever you called the subvol>}}<br />
<br />
This makes system rollbacks possible.<br />
<br />
If using for the root partition, it is advisable to add '''crc32c''' (or '''crc32c-intel''' for Intel machines) to the modules array in {{ic|/etc/mkinitcpio.conf}}.<br />
<br />
=== Snapshots ===<br />
<br />
To create a snapshot:<br />
<br />
# btrfs subvolume snapshot <source> [<dest>/]<name><br />
<br />
Snapshots are not recursive, this means that every subvolume inside subvolume will be an empty directory inside the snapshot.<br />
<br />
=== Defragmentation ===<br />
<br />
Btrfs supports online defragmentation. To defragment the metadata of the root folder do:<br />
<br />
# btrfs filesystem defragment /<br />
<br />
This ''will not'' defragment the entire system. For more information read [https://btrfs.wiki.kernel.org/index.php/Problem_FAQ#Defragmenting_a_directory_doesn.27t_work this page] on the btrfs wiki.<br />
<br />
To defragment the entire system verbosely do:<br />
<br />
# find / -xdev -type f -print -exec btrfs filesystem defrag '{}' \;<br />
<br />
=== Compression ===<br />
<br />
Btrfs supports transparent compression, which means every file on the partition is automatically compressed. This does not only reduce the size of those files, but also [http://www.phoronix.com/scan.php?page=article&item=btrfs_compress_2635&num=1 improves performance], in particular if using the [http://www.phoronix.com/scan.php?page=article&item=btrfs_lzo_2638&num=1 lzo algorithm]. Compression is enabled using the {{ic|1=compress=gzip}} or {{ic|1=compress=lzo}} mount options. Only files created or modified after the mount option is added will be compressed, so to fully benefit from compression it should be enabled during installation. <br />
<br />
However, it can quite easily be applied to a subvolume using the defragment -czlib (or whichever algorithm you so choose) command (the same command above could be used, by adding the -czlib and such, to recursively apply). Also keep in mind that for future files to be compressed, a simple 'chattr +c' should be applied to some directories, so as to automatically compress new files as they come.<br />
<br />
After [[Beginners%27_Guide#Prepare_the_storage_drive|preparing the storage drive]], simply switch to another terminal ({{ic|Ctrl+Alt+number}}), and run the following command:<br />
<br />
# mount -o remount,compress=lzo /dev/sdXY /mnt/target<br />
<br />
After the installation is finished, add {{ic|1=compress=lzo}} to the mount options of the root filesystem in {{ic|/etc/[[fstab]]}}.<br />
<br />
=== Partitioning ===<br />
<br />
Btrfs can occupy whole disk without the need of using classical partitioning schemes like [[MBR]] or [[GPT]]; [[Btrfs#Sub-volumes|subvolumes]] can be then used to simulate partitions. There are some limitations to the approach (all only valid if single disk is used):<br />
<br />
* You can not use different [[File_Systems|file systems]] for different [[fstab|mount points]],<br />
* You can not use [[Swap|swap area]] as Btrfs does not support [[Swap#Swap_file|swap files]] and there is no place to create [[Swap#Swap_partition|swap partition]],<br />
* You can not use [[EFI]] to boot.<br />
<br />
To set your disk this way, just go:<br />
# mkfs.btrfs /dev/sdX<br />
and NOT /dev/sdaX as there are no partitions. Then just install your [[Bootloader|boot loader]] as you would do on MBR, e.g.:<br />
# grub-install --recheck /dev/sdX<br />
for [[Grub#Install_to_440-byte_MBR_boot_code_region|GRUB]].<br />
<br />
== Resources ==<br />
<br />
* [https://btrfs.wiki.kernel.org/ Btrfs Wiki]<br />
* [https://btrfs.wiki.kernel.org/index.php/Problem_FAQ BTRFS Problem FAQ] - Official FAQ<br />
* [http://www.funtoo.org/wiki/BTRFS_Fun Funtoo Btrfs wiki entry] - Very well-written article<br />
* [http://www.phoronix.com/scan.php?page=news_item&px=MTA0ODU Avi Miller presenting BTRFS] at SCALE 10x. Jan/2012.<br />
* [http://www.phoronix.com/scan.php?page=news_item&px=MTA4Mzc Summary of Chris Mason's talk from LFCS 2012]<br />
* On 2012-03-28, {{Pkg|btrfs-progs}} includes btrfsck, a tool that can fix errors on btrfs filesystems.<br />
* Oracle has packaged this version of btrfs-progs and released it to their customers of Oracle Linux 6 and backported to 5.<br />
* {{AUR|mkinitcpio-btrfs}}: for roll-back abilities (currently unmaintained).</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=Swap&diff=275824Swap2013-09-17T07:00:01Z<p>Sushi Dude: Deprecation of /etc/sysctl.conf</p>
<hr />
<div>[[Category:File systems]]<br />
[[es:Swap]]<br />
[[fr:Swap]]<br />
[[it:Swap]]<br />
[[ja:Swap]]<br />
[[pt:Swap]]<br />
[[zh-CN:Swap]]<br />
{{Article summary start}}<br />
{{Article summary text|An introduction to swap space and paging on GNU/Linux. Covers creation and activation of swap partitions and swap files.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Swap on video ram}}<br />
{{Article summary wiki|fstab}}<br />
{{Article summary end}}<br />
<br />
From [http://www.linux.com/news/software/applications/8208-all-about-linux-swap-space All about Linux swap space]:<br />
<br />
:''Linux divides its physical RAM (random access memory) into chucks of memory called pages. Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available.''<br />
<br />
== Swap space ==<br />
Swap space will usually be a disk partition but can also be a file. Users may create a swap space during installation of Arch Linux or at any later time should it become necessary. Swap space is generally recommended for users with less than 1 GB of RAM, but becomes more a matter of personal preference on systems with gratuitous amounts of physical RAM (though it is required for suspend-to-disk support).<br />
<br />
To check swap status, use:<br />
$ swapon -s<br />
<br />
Or:<br />
$ free -m<br />
<br />
{{Note|There is no performance advantage to either a contiguous swap file or a partition, both are treated the same way.}}<br />
<br />
== Swap partition ==<br />
<br />
A swap partition can be created with most GNU/Linux partitioning tools (e.g. {{Ic|fdisk}}, {{Ic|cfdisk}}). Swap partitions are designated as type '''82'''.<br />
<br />
To set up a Linux swap area, the {{Ic|mkswap}} command is used. For example:<br />
# mkswap /dev/sda2<br />
<br />
{{Warning|All data on the specified partition will be lost.}}<br />
<br />
To enable the device for paging:<br />
# swapon /dev/sda2<br />
<br />
To enable this swap partition on boot, add an entry to [[fstab]]:<br />
/dev/sda2 none swap defaults 0 0<br />
<br />
{{Note|If using a TRIM supported SSD, discard is a valid mount option for swap. If creating swap manually, using -d or --discard achieves the same. For more information and other available mount options, see the swapon man page.}}<br />
<br />
== Swap file ==<br />
<br />
As an alternative to creating an entire partition, a swap file offers the ability to vary its size on-the-fly, and is more easily removed altogether. This may be especially desirable if disk space is at a premium (e.g. a modestly-sized SSD). <br />
<br />
{{Note|The BTRFS filesystem does not currently support swapfiles. Failure to heed this warning may result in filesystem corruption. Though it should be noted that one may use a swap file on btrfs if mounted through a loop device. This method will result in severely degraded swap performance.}}<br />
<br />
=== Swap file creation ===<br />
<br />
As root use {{Ic|fallocate}} to create a swap file the size of your choosing (M = Megabytes, G = Gigabytes) ({{Ic|dd}} can also be used but will take longer). For example, creating a 512 MB swap file:<br />
<br />
# fallocate -l 512M /swapfile<br />
Or<br />
# dd if=/dev/zero of=/swapfile bs=1M count=512<br />
<br />
Set the right permissions (a world-readable swap file is a huge local vulnerability)<br />
<br />
# chmod 600 /swapfile<br />
<br />
After creating the correctly-sized file, format it to swap:<br />
<br />
# mkswap /swapfile<br />
<br />
Activate the swapfile:<br />
<br />
# swapon /swapfile<br />
<br />
Edit {{ic|/etc/fstab}} and add an entry for the swap file:<br />
<br />
/swapfile none swap defaults 0 0<br />
<br />
=== Remove swap file ===<br />
<br />
To remove a swap file, the current swap file must be turned off.<br />
<br />
As root:<br />
<br />
# swapoff -a<br />
<br />
Remove swapfile:<br />
<br />
# rm -f /swapfile<br />
<br />
== Swap with USB device ==<br />
<br />
Thanks to modularity offered by Linux, we can have multiple swap partitions spread over different devices. If you have a very full hard disk, USB device can be used as partition temporally. But this method has some severe disadvantage:<br />
* USB device is slower than hard disk.<br />
* flash memories have limited write cycles. Using it as swap partition will kill it quickly.<br />
* when another device is attached to the computer, no swap can be used.<br />
<br />
To add a a USB device to SWAP, first take a USB flash and partition it with a swap partition.You can use graphical tools such as Gparted or console tools like fdisk. Make sure to label the partition as SWAP before writing the partition table. <br />
{{Box RED||Make sure you are writing the partition to the correct disk!}}<br />
<br />
Next open {{ic|/etc/fstab}}.<br />
<br />
Now add a new entry, just under the current swap entry, which take the current swap partition over the new USB one<br />
<br />
UUID=... none swap defaults,pri=10 0 0<br />
<br />
where UUID is taken from the output of the command<br />
<br />
ls -l /dev/disk/by-uuid/ | grep /dev/sdc1<br />
<br />
Just replace sdc1 with your new USB swap partition. {{ic|sdb1}}<br />
<br />
{{Box GREEN||We use UUID because when you attach other devices to the computer it could modify the device order}}<br />
<br />
Last, add<br />
<br />
pri=0<br />
<br />
in the ''original'' swap entry for teaching fstab to use HD swap only when USB is full<br />
<br />
This guide will work for other memory such as SD cards, etc.<br />
<br />
== Performance Tuning ==<br />
<br />
Swap values can be adjusted to help performance.<br />
<br />
=== Swappiness ===<br />
<br />
The ''swappiness'' [[sysctl]] parameter represents the kernel's preference (or avoidance) of swap space. Swappiness can have a value between 0 and 100. Setting this parameter to a low value will reduce swapping from RAM, and is known to improve responsiveness on many systems.<br />
<br />
{{hc|/etc/sysctl.d/99-sysctl.conf|2=<br />
vm.swappiness=1<br />
vm.vfs_cache_pressure=50<br />
}}<br />
<br />
To test and more on why this may work, take a look at this [http://rudd-o.com/en/linux-and-free-software/tales-from-responsivenessland-why-linux-feels-slow-and-how-to-fix-that article].<br />
<br />
[http://askubuntu.com/questions/103915/how-do-i-configure-swappiness This] Q&A post explains a lot about swappiness.<br />
<br />
=== Priority ===<br />
<br />
If you have more than one swap file or swap partition you should consider assigning a priority value (0 to 32767) for each swap area. The system will use swap areas of higher priority before using swap areas of lower priority. For example, if you have a faster disk ({{ic|/dev/sda}}) and a slower disk ({{ic|/dev/sdb}}), assign a higher priority to the swap area located on the faster device. Priorities can be assigned in fstab via the {{Ic|1=pri}} parameter:<br />
<br />
/dev/sda1 none swap defaults,pri=100 0 0<br />
/dev/sdb2 none swap defaults,pri=10 0 0<br />
<br />
Or via the {{Ic|−p}} (or {{Ic|−−priority}}) parameter of swapon:<br />
<br />
# swapon -p 100 /dev/sda1<br />
<br />
If two or more areas have the same priority, and it is the highest priority available, pages are allocated on a round-robin basis between them.</div>Sushi Dudehttps://wiki.archlinux.org/index.php?title=SSH_keys&diff=247280SSH keys2013-02-14T06:16:08Z<p>Sushi Dude: ssh-keygen will generate RSA keys from 768 to 16384 bits.</p>
<hr />
<div>[[Category:Secure Shell]]<br />
[[es:SSH Keys]]<br />
[[it:SSH Keys]]<br />
[[ru:SSH Keys]]<br />
[[sr:SSH Keys]]<br />
[[tr:SSH_Anahtarları]]<br />
[[zh-CN:SSH Keys]]<br />
SSH keys serve as a means of identifying yourself to an SSH server using [[Wikipedia:Public-key cryptography|public-key cryptography]] and [[Wikipedia:Challenge-response authentication|challenge-response authentication]]. One immediate advantange this method has over traditional password authentication is that you can be authenticated by the server without ever having to send your password over the network. Anyone eavesdropping on your connection will not be able to intercept and crack your password because it is never actually transmitted. Additionally, Using SSH keys for authentication virtually eliminates the risk posed by brute-force password attacks by drastically reducing the chances of the attacker correctly guessing the proper credentials.<br />
<br />
As well as offering additional security, SSH key authentication can be more convenient than the more traditional password authentication. When used with a program known as an SSH agent, SSH keys can allow you to connect to a server, or multiple servers, without having to remember or enter your password for each system.<br />
<br />
SSH keys are not without their drawbacks and may not be appropriate for all environments, but in many circumstances they can offer some strong advantages. A general understanding of how SSH keys work will help you decide how and when to use them to meet your needs. This article assumes you already have a basic understanding of the [[Secure Shell]] protocol and have installed the {{Pkg|openssh}} package, available in the [[Official Repositories]].<br />
<br />
==Background==<br />
SSH keys always come in pairs, one private and the other public. The private key is known only to you and it should be safely guarded. By contrast, the public key can be shared freely with any SSH server to which you would like to connect.<br />
<br />
When an SSH server has your public key on file and sees you requesting a connection, it uses your public key to construct and send you a challenge. This challenge is like a coded message and it must be met with the appropriate response before the server will grant you access. What makes this coded message particularly secure is that it can only be understood by someone with the private key. While the public key can be used to encrypt the message, it cannot be used to decrypt that very same message. Only you, the holder of the private key, will be able to correctly understand the challenge and produce the correct response.<br />
<br />
This challenge-response phase happens behind the scenes and is invisible to the user. As long as you hold the private key, which is typically stored in the {{ic|~/.ssh/}} directory, your SSH client should be able to reply with the appropriate response to the server.<br />
<br />
Because private keys are considered sensitive information, they are often stored on disk in an encrypted form. In this case, when the private key is required, a passphrase must first be entered in order to decrypt it. While this might superficially appear the same as entering a login password on the SSH server, it is only used to decrypt the private key on the local system. This passphrase is not, and should not, be transmitted over the network.<br />
<br />
==Generating an SSH key pair==<br />
An SSH key pair can be generated by running the {{ic|ssh-keygen}} command:<br />
<br />
{{hc<br />
|$ ssh-keygen -t ecdsa -b 521 -C "$(whoami)@$(hostname)-$(date -I)"<br />
|<nowiki>Generating public/private ecdsa key pair.<br />
Enter file in which to save the key (/home/username/.ssh/id_ecdsa):<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /home/username/.ssh/id_ecdsa.<br />
Your public key has been saved in /home/username/.ssh/id_ecdsa.pub.<br />
The key fingerprint is:<br />
dd:15:ee:24:20:14:11:01:b8:72:a2:0f:99:4c:79:7f username@localhost-2011-12-22<br />
The key's randomart image is:<br />
+--[ECDSA 521]---+<br />
| ..oB=. . |<br />
| . . . . . |<br />
| . . . + |<br />
| oo.o . . = |<br />
|o+.+. S . . . |<br />
|=. . E |<br />
| o . |<br />
| . |<br />
| |<br />
+-----------------+</nowiki>}}<br />
<br />
In the above example, {{ic|ssh-keygen}} generates a 521 bit long ({{ic|-b 521}}) public/private ECDSA ({{ic|-t ecdsa}}) key pair with an extended comment including the data ({{ic|-C "$(whoami)@$(hostname)-$(date -I)"}}). The [http://www.cs.berkeley.edu/~dawnsong/papers/randomart.pdf randomart image] was introduced in OpenSSH 5.1 as an easier means of visually identifying the key fingerprint.<br />
<br />
===Choosing the type of encryption===<br />
The Elliptic Curve Digital Signature Algorithm (ECDSA) provides smaller key sizes and faster operations for equivalent estimated security to the previous methods. It was introduced as the preferred algorithm for authentication in OpenSSH 5.7, see [http://openssh.org/txt/release-5.7 OpenSSH 5.7 Release Notes]. '''ECDSA keys might not be compatible with systems that ship old versions of OpenSSH.''' Some vendors also disable the required implementations due to potential patent issues.<br />
<br />
If you choose to create an RSA (768-16384 bit) or DSA (1024 bit) key pair instead of ECDSA, use the {{ic|-t rsa}} or {{ic|-t dsa}} switches in your {{ic|ssh-keygen}} command and do not forget to increase the key size. Running {{ic|ssh-keygen}} without the {{ic|-b}} switch should provide reasonable defaults.<br />
<br />
{{Note|These keys are used only to authenticate you; choosing stronger keys will not increase CPU load when transferring data over SSH.}}<br />
<br />
===Choosing the key location and passphrase===<br />
Upon issuing the {{ic|ssh-keygen}} command, you will be prompted for the desired name and location of your private key. By default, keys are stored in the {{ic|~/.ssh/}} directory and named according the type of encryption used. You are advised to accept the default name and location in order for later code examples in this article to work properly.<br />
<br />
When prompted for a passphrase, choose something that will be hard to guess if you have the security of your private key in mind. A longer, more random password will generally be stronger and harder to crack should it fall into the wrong hands.<br />
<br />
It is also possible to create your private key without a passphrase. While this can be convenient, you need to be aware of the associated risks. Without a passphrase, your private key will be stored on disk in an unencrypted form. Anyone who gains access to your private key file will then be able to assume your identity on any SSH server to which you connect using key-based authentication. Furthermore, without a passphrase, you must also trust the root user, as he can bypass file permissions and will be able to access your unencrypted private key file at any time.<br />
<br />
====Changing the private key's passphrase without changing the key====<br />
If the originally chosen SSH key passphrase is undesirable or must be changed, one can use the {{ic|ssh-keygen}} command to change the passphrase without changing the actual key.<br />
<br />
To change the passphrase for the private RSA key, run the following command:<br />
$ ssh-keygen -f ~/.ssh/id_rsa -p<br />
<br />
==Copying the public key to the remote server==<br />
Once you have generated a key pair, you will need to copy the public key to the remote server so that it will use SSH key authentication. The public key file shares the same name as the private key except that it is appended with a {{ic|.pub}} extension. Note that the private key is not shared and remains on the local machine.<br />
<br />
===Simple method===<br />
If your key file is {{ic|~/.ssh/id_rsa.pub}} you can simply enter the following command.<br />
$ ssh-copy-id remote-server.org<br />
<br />
If your username differs on remote machine, be sure to prepend the username followed by {{ic|@}} to the server name.<br />
$ ssh-copy-id username@remote-server.org<br />
<br />
If your public key filename is anything other than the default of {{ic|~/.ssh/id_rsa.pub}} you will get an error stating {{ic|/usr/bin/ssh-copy-id: ERROR: No identities found}}. In this case, you must explicitly provide the location of the public key.<br />
$ ssh-copy-id -i ~/.ssh/id_ecdsa.pub username@remote-server.org<br />
<br />
If the ssh server is listening on a port other than default of 22, be sure to include it within the host argument.<br />
$ ssh-copy-id -i ~/.ssh/id_ecdsa.pub '-p 221 username@remote-server.org'<br />
<br />
===Traditional method===<br />
By default, for OpenSSH, the public key needs to be concatenated with {{ic|~/.ssh/authorized_keys}}. Begin by copying the public key to the remote server.<br />
<br />
$ scp ~/.ssh/id_ecdsa.pub username@remote-server.org:<br />
<br />
The above example copies the public key ({{ic|id_ecdsa.pub}}) to your home directory on the remote server via {{ic|scp}}. Do not forget to include the {{ic|:}} at the end of the server address. Also note that the name of your public key may differ from the example given.<br />
<br />
On the remote server, you will need to create the {{ic|~/.ssh}} directory if it does not yet exist and append your public key to the {{ic|authorized_keys}} file.<br />
<br />
$ ssh username@remote-server.org<br />
username@remote-server.org's password:<br />
$ mkdir ~/.ssh<br />
$ cat ~/id_ecdsa.pub >> ~/.ssh/authorized_keys<br />
$ rm ~/id_ecdsa.pub<br />
$ chmod 600 ~/.ssh/authorized_keys<br />
<br />
The last two commands remove the public key file from the server and set the permissions on the {{ic|authorized_keys}} file such that it is only readable and writable by you, the owner.<br />
<br />
==Security==<br />
<br />
===Securing the authorized_keys file===<br />
<br />
To add further protection level, you can prevent users adding new public keys and connecting from them. To achieve this goal, you simply need to restrict access to the user's {{ic|authorized_keys}} file in such a way that it can <b><u>only</u> be modified by root</b>.<br />
<br />
Optional: To avoid such an heavy work for all of your users, you can set up an centralized keys management. Create a directory, say, {{ic|/etc/ssh/user-keys}}, owned by root, and put users' keys in files named according to their usernames (e.g. {{ic|/etc/ssh/user-keys/john}}). Keep the files root-owned as well.<br />
<br />
Then change the {{ic|AuthorizedKeysFile}} option in {{ic|/etc/ssh/sshd_config}} to point to your new directory:<br />
<br />
{{hc|/etc/ssh/sshd_config|<br />
AuthorizedKeysFile /etc/ssh/user-keys/%u}}<br />
<br />
{{ic|%u}} will be expanded to the user's name when authenticating. The ssh daemon may need to be reloaded {{ic|systemctl reload sshd}}.<br />
<br />
{{Note|If you copy the {{ic|authorized_keys}} file from another location, make sure the permissions are set to 600. Run {{ic|chmod 600 /etc/ssh/user-keys/john}} to ensure this.}}<br />
<br />
===Disabling password logins===<br />
While copying your public key to the remote SSH server eliminates the need to transmit your password over the network, it does not give any added protection against a brute-force password attack. In the absence of a private key, the SSH server will fall back to password authentication by default, thus allowing a malicious user to attempt to gain access by guessing your password. To disable this behavior, edit the following lines in the {{ic|/etc/ssh/sshd_config}} file on the remote server.<br />
<br />
{{hc|/etc/ssh/sshd_config|<br />
PasswordAuthentication no<br />
ChallengeResponseAuthentication no}}<br />
<br />
==SSH agents==<br />
If your private key is encrypted with a passphrase, this passphrase must be entered every time you attempt to connect to an SSH server using public-key authentication. Each individual invocation of {{ic|ssh}} or {{ic|scp}} will need the passphrase in order to decrypt your private key before authentication can proceed.<br />
<br />
An SSH agent is a program which caches your decrypted private keys and provides them to SSH client programs on your behalf. In this arrangement, you must only provide your passphrase once, when adding your private key to the agent's cache. This facility can be of great convenience when making frequent SSH connections.<br />
<br />
An agent is typically configured to run automatically upon login and persist for the duration of your login session. A variety of agents, front-ends, and configurations exist to achieve this effect. This section provides an overview of a number of different solutions which can be adapted to meet your specific needs.<br />
<br />
===ssh-agent===<br />
ssh-agent is the default agent included with OpenSSH. It can be used directly or serve as the back-end to a few of the front-end solutions mentioned later in this section. When {{ic|ssh-agent}} is run, it will fork itself to the background and print out the environment variables it would use.<br />
<br />
$ ssh-agent<br />
SSH_AUTH_SOCK=/tmp/ssh-vEGjCM2147/agent.2147; export SSH_AUTH_SOCK;<br />
SSH_AGENT_PID=2148; export SSH_AGENT_PID;<br />
echo Agent pid 2148;<br />
<br />
To make use of these variables, run the command through the {{ic|eval}} command.<br />
<br />
$ eval $(ssh-agent)<br />
Agent pid 2157<br />
<br />
You can append the above command to your {{ic|~/.bash_profile}} script so that it will run automatically when starting a login shell.<br />
<br />
$ echo 'eval $(ssh-agent)' >> ~/.bash_profile<br />
<br />
If you would rather have ssh-agent run automatically for all users append the command to {{ic|/etc/profile}} instead.<br />
<br />
# echo 'eval $(ssh-agent)' >> /etc/profile<br />
<br />
Once {{ic|ssh-agent}} is running, you will need to add your private key to its cache.<br />
<br />
$ ssh-add ~/.ssh/id_ecdsa<br />
Enter passphrase for /home/user/.ssh/id_ecdsa:<br />
Identity added: /home/user/.ssh/id_ecdsa (/home/user/.ssh/id_ecdsa)<br />
<br />
If you would like your private keys to be added automatically on login. Append the following command to your {{ic|~/.bash_profile}} as well.<br />
<br />
$ echo 'ssh-add' >> ~/.bash_profile<br />
<br />
If your private key is encrypted {{ic|ssh-add}} will prompt you to enter your passphrase. Once your private key has been successfully added to the agent you will be able to make SSH connections without having to enter a passphrase.<br />
<br />
One downside to this approach is that a new instance of {{ic|ssh-agent}} is created for every login shell and each instance will persist between login sessions. Over time you can wind up with dozens of needless {{ic|ssh-agent}} processes running. There exist a number of front-ends to ssh-agent and alternative agents described later in this section which avoid this problem.<br />
<br />
===GnuPG Agent===<br />
<br />
{{Note|The stock gnupg Arch Linux package does not support ECC encryption and signing. Hence you cannot use the GnuPG agent to manage ECDSA keys.}}<br />
<br />
The [[GnuPG]] agent, distributed with the {{Pkg|gnupg}} package, available in the [[Official Repositories|official repositories]], has OpenSSH agent emulation. If you use GPG you might consider using its agent to take care of all of your keys. Otherwise you might like the PIN entry dialog it provides and its passphrase management, which is different from Keychain.<br />
<br />
To start using GPG agent for your SSH keys you should first start the gpg-agent with the {{ic|--enable-ssh-support}} option. Example (do not forget to make the file executable):<br />
{{hc|/etc/profile.d/gpg-agent.sh|<nowiki><br />
#!/bin/sh<br />
<br />
# Start the GnuPG agent and enable OpenSSH agent emulation<br />
gnupginf="${HOME}/.gpg-agent-info"<br />
<br />
if pgrep -u "${USER}" gpg-agent >/dev/null 2>&1; then<br />
eval `cat $gnupginf`<br />
eval `cut -d= -f1 $gnupginf | xargs echo export`<br />
else<br />
eval `gpg-agent -s --enable-ssh-support --daemon`<br />
fi<br />
</nowiki>}}<br />
<br />
Once gpg-agent is running you can use ssh-add to approve keys, just like you did with plain ssh-agent. The list of approved keys is stored in the {{ic|~/.gnupg/sshcontrol}} file. Once your key is approved you will get a PIN entry dialog every time your passphrase is needed. You can control passphrase caching in the {{ic|~/.gnupg/gpg-agent.conf}} file. The following example would have gpg-agent cache your keys for 3 hours: <br />
{{hc|~/.gnupg/gpg-agent.conf|<br />
# Cache settings<br />
default-cache-ttl 10800<br />
default-cache-ttl-ssh 10800<br />
}}<br />
Other useful settings for this file include the PIN entry program (GTK, QT or ncurses version), keyboard grabbing and so on...:<br />
<br />
{{Note|gpg-agent.conf must be created and the variable 'write-env-file' must be set in order to allow gpg-agent keys to be injected to SSH across logins. (Unless you restart the gpg-agent, and therefore export its settings, with every login.)}}<br />
{{hc|~/.gnupg/gpg-agent.conf|<nowiki><br />
# Environment file<br />
write-env-file /home/username/.gpg-agent-info<br />
<br />
# Keyboard control<br />
#no-grab<br />
<br />
# PIN entry program<br />
#pinentry-program /usr/bin/pinentry-curses<br />
#pinentry-program /usr/bin/pinentry-qt4<br />
#pinentry-program /usr/bin/pinentry-kwallet<br />
pinentry-program /usr/bin/pinentry-gtk-2<br />
<br />
</nowiki>}}<br />
<br />
===Keychain===<br />
[http://www.funtoo.org/wiki/Keychain Keychain] is a program designed to help you easily manage your SSH keys with minimal user interaction. It is implemented as a shell script which drives both {{ic|ssh-agent}} and {{ic|ssh-add}}. A notable feature of Keychain is that it can maintain a single {{ic|ssh-agent}} process across multiple login sessions. This means that you only need to enter your passphrase once each time your local machine is booted.<br />
<br />
[[pacman|Install]] the {{Pkg|keychain}} package, available from the [[Official Repositories]].<br />
<br />
Append the following line to {{ic|~/.bash_profile}}, or create {{ic|/etc/profile.d/keychain.sh}} as root and make it executable (e.g. {{ic|chmod 755 keychain.sh}}):<br />
{{hc|~/.bash_profile|<br />
eval $(keychain --eval --agents ssh -Q --quiet id_ecdsa)<br />
}}<br />
<br />
In the above example, the {{ic|--eval}} switch outputs lines to be evaluated by the opening {{ic|eval}} command. This sets the necessary environments variables for SSH client to be able to find your agent. The {{ic|--agents}} switch is not strictly necessary, because Keychain will build the list automatically based on the existence of ssh-agent or gpg-agent on the system. Adding the {{ic|--quiet}} switch will limit output to warnings, errors, and user prompts. If you want greater security replace {{ic|-Q}} with {{ic|--clear}} but will be less convenient.<br />
<br />
If necessary, replace {{ic|~/.ssh/id_ecdsa}} with the path to your private key. For those using a non-Bash compatible shell, see {{ic|keychain --help}} or {{ic|man keychain}} for details on other shells.<br />
<br />
To test Keychain, log out from your session and log back in. If this is your first time running Keychain, it will prompt you for the passphrase of the specified private key. Because Keychain reuses the same {{ic|ssh-agent}} process on successive logins, you shouldn't have to enter your passphrase the next time you log in. You will only ever be prompted for your passphrase once each time the machine is rebooted.<br />
<br />
====Alternate startup methods====<br />
There are numerous ways in which Keychain can be invoked and you are encouraged to experiment to find a method that works for you. The {{ic|keychain}} command itself comes with dozens of command-line options which are described in the Keychain man page.<br />
<br />
One alternative implementation of a Keychain startup script could be to create the file {{ic|/etc/profile.d/keychain.sh}} as the root user and add the following lines.<br />
<br />
{{hc|/etc/profile.d/keychain.sh|<nowiki><br />
/usr/bin/keychain -Q -q --nogui ~/.ssh/id_ecdsa<br />
[[ -f $HOME/.keychain/$HOSTNAME-sh ]] && source $HOME/.keychain/$HOSTNAME-sh<br />
</nowiki>}}<br />
<br />
Be sure to also make {{ic|/etc/profile.d/keychain.sh}} executable by changing its file permissions.<br />
# chmod 755 /etc/profile.d/keychain.sh<br />
<br />
If you do not want to get asked for your passphrase every time you login but rather the first time you actually attempt to connect, you may add the following to your {{ic|.bashrc}}:<br />
alias ssh='eval $(/usr/bin/keychain --eval --agents ssh -Q --quiet ~/.ssh/id_ecdsa) && ssh'<br />
This will ask you if you try to use ssh for the first time. Remember however that this will ONLY ask you if {{ic|.bashrc}} is applicable. So you would always have your first ssh-command to be executed in a terminal.<br />
<br />
===x11-ssh-askpass===<br />
The x11-ssh-askpass package provides a graphical dialog for entering your passhrase when running an X session. x11-ssh-askpass depends only the {{Pkg|libx11}} and {{Pkg|libxt}} libraries, and the appearance of x11-ssh-askpass is customizable. While it can be invoked by the {{ic|ssh-add}} program which will then load your decrypted keys into [[#ssh-agent|ssh-agent]], the following instructions will instead configure x11-ssh-askpass to be invoked by the aforementioned [[#Keychain|Keychain]] script.<br />
<br />
Install {{Pkg|keychain}} and {{Pkg|x11-ssh-askpass}}, both available in the [[Official Repositories]].<br />
<br />
Edit your {{ic|~/.xinitrc}} file to include the lines highlighted in bold, replacing the name and location of your private if necessary. Be sure to place these commands '''before''' the line which invokes your window mananger.<br />
<br />
{{hc|~/.xinitrc|<br />
keychain ~/.ssh/id_ecdsa<br />
[ -f ~/.keychain/$HOSTNAME-sh ] && . ~/.keychain/$HOSTNAME-sh 2>/dev/null<br />
[ -f ~/.keychain/$HOSTNAME-sh-gpg ] && . ~/.keychain/$HOSTNAME-sh-gpg 2>/dev/null<br />
...<br />
exec openbox-session}}<br />
<br />
In the above example, the first line invokes {{ic|keychain}} and passes the name and location of your private key. If this is not the first time keychain was invoked, the following two lines load the contents of {{ic|$HOSTNAME-sh}} and {{ic|$HOSTNAME-sh-gpg}} if they exist. These files store the environment variables of the previous instance of {{ic|keychain}}.<br />
<br />
====Theming====<br />
The appearance of the x11-ssh-askpass dialog can be customized by setting its associated [[X resources]]. The x11-ssh-askpass [http://www.jmknoble.net/software/x11-ssh-askpass/ homepage] presents some example [http://www.jmknoble.net/software/x11-ssh-askpass/screenshots.html example themes]. See the x11-ssh-askpass man page for full details.<br />
<br />
====Alternative passphrase dialogs====<br />
There are other passphrase dialog programs which can be used instead of x11-ssh-askpass. The following list provides some alternative solutions.<br />
<br />
* {{Pkg|ksshaskpass}} is available in the Official Repositories. It is dependent on {{Pkg|kdelibs}} and is suitable for the KDE Desktop Environment.<br />
<br />
* {{Pkg|openssh-askpass}} depends on the {{Pkg|qt}} libraries, and is available from the Official Repositories.<br />
<br />
===pam_ssh===<br />
The [http://pam-ssh.sourceforge.net/ pam_ssh] project exists to provide a [[Wikipedia:Pluggable authentication module|Pluggable Authentication Module]] (PAM) for SSH private keys. This module can provide single sign-on behavior for your SSH connections. On login, your SSH private key passphrase can be entered in place of, or in addition to, your traditional system password. Once you have been authenticated, the pam_ssh module spawns ssh-agent to store your decrypted private key for the duration of the session.<br />
<br />
To enable single sign-on behavior at the tty login prompt, install the unofficial {{AUR|pam_ssh}} package, available in the [[Arch User Repository]]. <br />
<br />
Edit the {{ic|/etc/pam.d/login}} configuration file to include the text highlighted in bold in the example below. The order in which these lines appear is significiant and can affect login behavior.<br />
<br />
{{Warning|Misconfiguring PAM can leave the system in a state where all users become locked out. Before making any changes, you should have an understanding of how PAM configuration works as well as a backup means of accessing the PAM configuration files, such as an Arch Live CD, in case you become locked out and need to revert any changes. An IBM developerWorks [http://www.ibm.com/developerworks/linux/library/l-pam/index.html article] is available which explains PAM configuration in further detail.}}<br />
<br />
{{hc|/etc/pam.d/login|2=<br />
#%PAM-1.0<br />
<br />
auth required pam_securetty.so<br />
auth requisite pam_nologin.so<br />
'''auth sufficient pam_ssh.so'''<br />
auth include system-local-login<br />
account include system-local-login<br />
session include system-local-login<br />
'''session optional pam_ssh.so'''<br />
}}<br />
<br />
{{out of date|The below paragraph has not been properly updated for {{pkg|pambase}}<nowiki>=</nowiki>20120701-1.}}<br />
<br />
In the above example, login uses the pam_ssh module to check the entered password against the user's SSH private key passphrase. If the password matches, the user is immediately authenticated and granted access to the system. If the password does not match, control falls to the pam_unix module included via the {{ic|/etc/pam.d/system-local-login}} file. The pam_unix module provides traditional system password authentication. Note, however, that the line which actually calls the pam_unix module resides in {{ic|/etc/pam.d/system-auth}} and this file is referenced in {{ic|/etc/pam.d/login}} through a series of "include" control flags. Because the pam_unix module is passed the {{ic|try_first_pass}} option, it first checks the previously entered password against the {{ic|/etc/passwd}} file instead of prompting for a password again if the pam_ssh authentication failed. In this way, the use of pam_ssh will be transparent to users without an SSH private key.<br />
<br />
If you use another means of logging in, such as an X11 display manager like [[SLiM]] or [[XDM]] and you would like it to provide similar functionality, you must edit its associated PAM configuration file in a similar fashion. Packages providing support for PAM typically place a default configuration file in the {{ic|/etc/pam.d/}} directory.<br />
<br />
Further details on how to use pam_ssh and a list of its options can be found in the pam_ssh man page.<br />
<br />
====Known issues with pam_ssh====<br />
Work on the pam_ssh project is infrequent and the documentation provided is sparse. You should be aware of some of its limitations which are not mentioned in the package itself.<br />
<br />
* SSH keys employing the newer option of ECDSA (elliptic curve) cryptography do not appear to be supported by pam_ssh. You must use either RSA or DSA keys.<br />
<br />
* The {{ic|ssh-agent}} process spawned by pam_ssh does not persist between user logins. If you like to keep a [[GNU Screen]] session active between logins you may notice when reattaching to your screen session that it can no longer communicate with ssh-agent. This is because the GNU Screen environment and those of its children will still reference the instance of ssh-agent which existed when GNU Screen was invoked but was subsequently killed in a previous logout. The [[#keychain|Keychain]] front-end avoids this problem by keeping the ssh-agent process alive between logins.<br />
<br />
===GNOME Keyring===<br />
If you use the [[GNOME]] desktop, the [[GNOME Keyring]] tool can be used as an SSH agent. Visit the [[GNOME Keyring]] article.<br />
<br />
==Troubleshooting==<br />
If it appears that the SSH server is ignoring your keys, ensure that you have the proper permissions set on all relevant files.<br /><br />
For the local machine:<br />
<br />
$ chmod 700 ~/<br />
$ chmod 700 ~/.ssh<br />
$ chmod 600 ~/.ssh/id_ecdsa<br />
<br />
For the remote machine:<br />
<br />
$ chmod 700 ~/<br />
$ chmod 700 ~/.ssh<br />
$ chmod 600 ~/.ssh/authorized_keys<br />
<br />
If that does not solve the problem you may try temporarily setting {{ic|StrictModes}} to {{ic|no}} in {{ic|sshd_config}}. If authentication with StrictModes off is successful, it is likely an issue with file permissions persists.<br />
{{Tip|Do not forget to set {{ic|StrictModes}} to {{ic|yes}} for added security.}}<br />
Make sure the remote machine supports the type of keys you are using. Try using RSA or DSA keys instead [[#Generating an SSH key pair]]<br />
Some servers do not support ECDSA keys. <br />
<br />
Failing this, run the sshd in debug mode and monitor the output while connecting:<br />
<br />
# /usr/sbin/sshd -d<br />
<br />
=== Using kdm ===<br />
It appears that kdm doesn't launch the ssh-agent process directly. You need to install the {{Pkg|kde-agent}}.<br />
<br />
==See also==<br />
* [http://www-106.ibm.com/developerworks/linux/library/l-keyc.html OpenSSH key management, Part 1]<br />
* [http://www-106.ibm.com/developerworks/linux/library/l-keyc2/ OpenSSH key management, Part 2]<br />
* [http://www-106.ibm.com/developerworks/library/l-keyc3/ OpenSSH key management, Part 3]<br />
* [http://kimmo.suominen.com/docs/ssh/ Getting started with SSH]<br />
* [http://openssh.org/txt/release-5.7 OpenSSH 5.7 Release Notes]</div>Sushi Dude