https://wiki.archlinux.org/api.php?action=feedcontributions&user=Oal&feedformat=atomArchWiki - User contributions [en]2024-03-29T07:15:38ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Fonts&diff=305424Fonts2014-03-18T10:57:41Z<p>Oal: /* TrueType */ incorrect info</p>
<hr />
<div>[[Category:Fonts]]<br />
[[Category:Graphics and desktop publishing]]<br />
[[cs:Fonts]]<br />
[[de:Schriftarten]]<br />
[[es:Fonts]]<br />
[[it:Fonts]]<br />
[[ja:Fonts]]<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|Java Runtime Environment Fonts}}<br />
{{Related|MS Fonts}}<br />
{{Related articles end}}<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|pacman]]. Available fonts may be found by using:<br />
$ pacman -Ss font<br />
Or to search for {{ic|ttf}} fonts only:<br />
$ pacman -Ss ttf<br />
<br />
Some fonts like {{pkg|terminus-font}} are installed in {{ic|/usr/share/fonts/local}}, which is not added to the font path by default. By adding the following lines to {{ic|~/.xinitrc}}, the fonts can be used in X11:<br />
{{bc|<br />
xset +fp /usr/share/fonts/local<br />
xset fp rehash<br />
}}<br />
In case the first command causes the following error<br />
{{bc|<br />
$ xset +fp /usr/share/fonts/local/<br />
xset: bad font path element (#0), possible causes are:<br />
Directory does not exist or has wrong permissions<br />
Directory missing fonts.dir<br />
Incorrect font server address or syntax<br />
}}<br />
you'll have to run<br />
{{bc|<br />
# cd /usr/share/fonts/local;mkfontdir<br />
}}<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 />
{{bc|<nowiki><br />
pkgname=ttf-fontname<br />
pkgver=1.0<br />
pkgrel=1<br />
pkgdesc="custom fonts"<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 -d "$pkgdir/usr/share/fonts/TTF"<br />
cp -dpr --no-preserve=ownership "$srcdir/$pkgname/"*.ttf "$pkgdir/usr/share/fonts/TTF/"<br />
}<br />
</nowiki>}}<br />
<br />
This PKGBUILD assumes the fonts are TrueType. An install file ({{ic|ttf-fontname.install}}) will also need to be created to update the font cache:<br />
<br />
{{bc|<nowiki><br />
post_install() {<br />
echo -n "Updating font cache... "<br />
fc-cache -fs >/dev/null<br />
mkfontscale /usr/share/fonts/TTF /usr/share/fonts/Type1<br />
mkfontdir /usr/share/fonts/TTF /usr/share/fonts/Type1<br />
echo "done"<br />
}<br />
<br />
post_upgrade() {<br />
post_install<br />
}<br />
<br />
post_remove() {<br />
post_install<br />
}<br />
</nowiki>}}<br />
<br />
For a more convenient package creation from ttf-fonts you can also use {{AUR|makefontpkg}} from the [[AUR]].<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. To install fonts for only a single user, use {{ic|~/.fonts/}} instead.<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 [[#Fonts with X.Org]] for more detail.<br />
<br />
Then update the fontconfig font cache:<br />
<br />
$ fc-cache -vf<br />
<br />
=== Manual installation: advanced method ===<br />
<br />
Manual installation and maintenance of your font resources may be especially useful if your collection is more specialized, e.g. if you use commercial fonts,<br />
if you use fonts in different formats, if you often install and remove font files, or if you just feel you need more control and better access than offered by<br />
the package manager. There are numerous benefits to such an approach:<br />
<br />
* You can avoid installation of multiple copies of the same family in different versions and formats (one of the most common reasons for rendering issues).<br />
* You can use multiple and non-standard physical sources of font files (e.g. an additional hard drive, a separate partition).<br />
* You can avoid relying on huge and cryptic local font sources which possibly contain 5 families you need and 55 you don't need (TeX Live & {{ic|09-texlive-fonts.conf}}, random font collections from the AUR, etc).<br />
* You can avoid rendering issues because your fontconfig settings were tuned to a different format but the one installed in your system.<br />
* You can quickly verify which families in which format(s) are present in the system and available for applications by visually inspecting the content of the main font directory (as a result, you don't need sophisticated and heavy-on-resources font management applications: {{Pkg|gtk2fontsel}} and basic CLI tools like {{ic|fc-query}} from {{Pkg|fontconfig}} package will do the job even better and faster).<br />
* When you install or upgrade a single font, the same version will be available for all applications, including LaTeX related software.<br />
* If necessary, you can quickly enable / disable a particular family because you know where exactly it can be found (useful for debugging).<br />
* You don't need to worry about redundant {{ic|/etc/fonts/conf.avail/nn-foo.conf}} fontconfig files, potentially conflicting with your rendering settings (especially when you are using a [[Font_Configuration#Patched_packages|customized font configuration and patched libraries]]).<br />
* In the long run, you save time needed to resolve issues and eliminate conflicts caused by careless use of the package manager.<br />
<br />
In practical terms, there are at least a few ways to achieve this, which, if necessary, can be adopted by any package manager. The one described below has<br />
proven to be very efficient and secure even with large font collections.<br />
<br />
* We are going to separate font source locations (e.g. {{ic|/usr/share/fonts.avail}}: this is where our fonts will be stored) from a directory containing symbolic links to the families in use ({{ic|/usr/share/fonts}}).<br />
<br />
* Each family is going to be located in a separate, clearly named subdirectory. The naming convention should be consistent and unambiguous, for instance:<br />
<br />
{{bc|<nowiki><br />
<ttf|otf|t1>-<optional_global_group_or_foundry_name>-<font_family_name><br />
</nowiki>}}<br />
<br />
This way the content of the source directory will look like this:<br />
<br />
{{bc|<nowiki><br />
$ ls /usr/share/fonts.avail<br />
<br />
/usr/share/fonts.avail/otf-heuristica<br />
/usr/share/fonts.avail/ttf-liberation<br />
/usr/share/fonts.avail/ttf-ms-arial<br />
...<br />
</nowiki>}}<br />
<br />
* We are not going to touch TeX Live font directories to avoid issues with LaTeX software. Instead, since we can use multiple locations, we will create symlinks in {{ic|/usr/share/fonts}}, giving applications access to particular families:<br />
<br />
{{bc|<nowiki><br />
# cd /usr/share/fonts<br />
# ln -s ../fonts.avail/otf-heuristica .<br />
# ln -s /opt/texlive/texmf-dist/fonts/truetype/public/opensans ttf-texlive-open.sans<br />
</nowiki>}}<br />
<br />
The result:<br />
<br />
{{bc|<nowiki><br />
$ ls /usr/share/fonts<br />
<br />
ttf-liberation -> ..fonts.avail/ttf-liberation<br />
ttf-ms-arial -> ..fonts.avail/ttf-ms-arial<br />
otf-heuristica -> ..fonts.avail/otf-heuristica<br />
otf-texlive-tex.gyre -> /opt/texlive/texmf-dist/fonts/opentype/public/tex-gyre<br />
ttf-texlive-open.sans -> /opt/texlive/texmf-dist/fonts/truetype/public/opensans<br />
...<br />
</nowiki>}}<br />
<br />
Finally, you may want to run the usual:<br />
<br />
{{bc|<nowiki><br />
# fc-cache && mkfontscale && mkfontdir<br />
</nowiki>}}<br />
<br />
A similar approach can be found in [[TeX_Live|TeX Live]] Wiki article, but it's way simpler and describes a per-user scenario rather than a global implementation.<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 />
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 />
=== Pango Warnings ===<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 and runs as root to enable them system-wide.<br />
<br />
# pacman -S ttf-liberation<br />
-- output abbreviated, assumes installation succeeded -- <br />
<br />
# fc-cache -vfs<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 />
=== Fonts with X.Org ===<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 />
In order for [[Xorg]] to find and use your newly installed fonts, you must add the font paths to {{ic|/etc/X11/xorg.conf}} (another X.Org configuration file may work too).<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 />
# 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/local"<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 />
==Console fonts==<br />
<br />
The [[Wikipedia:Virtual console|virtual console]] uses the kernel built-in font and ASCII character set by default, but both can be easily changed.<br />
<br />
A console font is limited to either 256 or 512 characters. Available fonts are saved in {{ic|/usr/share/kbd/consolefonts/}} directory.<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/}}.<br />
<br />
=== Previewing and testing ===<br />
<br />
{{Tip|An organized library of images for previewing is available: [http://alexandre.deverteuil.net/consolefonts/consolefonts.html 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 use as the default. Just pass the name of the font (they are located in {{ic|/usr/share/kbd/consolefonts/}}):<br />
<br />
$ setfont Lat2-Terminus16<br />
<br />
Optionally, you can specify character set to be used using the {{ic|-m}} option:<br />
<br />
$ setfont Lat2-Terminus16 -m 8859-2<br />
<br />
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 />
=== Changing the default font ===<br />
<br />
The {{ic|FONT}} and {{ic|FONT_MAP}} variables in {{ic|/etc/vconsole.conf}} are used to change the default font.<br />
<br />
For displaying characters such as ''Č, ž, đ, š'' or ''Ł, ę, ą, ś'' using the font {{ic|lat2-16.psfu.gz}}:<br />
<br />
FONT=lat2-16<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]]. You can use a Terminus font which is recommended if you work a lot in console without X server. ter-216b for example is latin-2 part, size 16, bold. ter-216n is the same but normal weight. Terminus fonts have sizes up to 32.<br />
<br />
Now, set the proper font mapping, for lat2-16 it will be:<br />
<br />
FONT_MAP=8859-2<br />
<br />
To use the specified font in early userspace, use the {{ic|keymap}} 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 />
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 PNG images of all fonts in [http://ternstor.github.com/archfonts/extra.html extra], [http://ternstor.github.com/archfonts/community.html community] and the [http://ternstor.github.com/archfonts/aur.html AUR] so you can preview all the fonts below.<br />
<br />
===Braille===<br />
*{{Pkg|ttf-ubraille}} - Font containing Unicode symbols for ''braille''<br />
<br />
===International users===<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 :lang&#61;ar &#124; cut -d: -f1|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 these packages: {{Pkg|ttf-freefont}}, {{Pkg|ttf-arphic-uming}}, {{Pkg|ttf-baekmuk}}<br />
<br />
====Arabic & Urdu====<br />
*{{AUR|ttf-qurancomplex-fonts}} - Fonts by King Fahd Glorious Quran Printing Complex in al-Madinah al-Munawwarah ''(AUR)''<br />
*{{AUR|ttf-amiri}} - A classical Arabic typeface in Naskh style poineered by Amiria Press ''(AUR)''<br />
*{{AUR|ttf-sil-lateef}} - Unicode Arabic font from SIL ''(AUR)''<br />
*{{AUR|ttf-sil-scheherazade}} - Unicode Arabic font from SIL ''(AUR)''<br />
*{{AUR|ttf-arabeyes-fonts}} - Collection of free Arabic fonts ''(AUR)''<br />
<br />
====Birman====<br />
*{{AUR|ttf-myanmar3}} - Font for Myanmar/Burmese script ''(AUR)''<br />
<br />
====Chinese, Japanese, Korean, Vietnamese====<br />
<br />
=====(Mainly) Chinese=====<br />
*{{AUR|ttf-tw}} - Kai and Song traditional Chinese font from the Ministry of Education of Taiwan ''(AUR)''.<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 />
<br />
=====Japanese=====<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 />
*{{AUR|ttf-vlgothic}} - Japanese Gothic fonts. Default of Debian/Fedora/Vine Linux ''(AUR)''<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). ''(AUR)''<br />
*{{AUR|ttf-ipa-mona}}, {{AUR|ttf-monapo}} - Japanese fonts to show [[wikipedia:2channel_Shift_JIS_art|2channel Shift JIS art]] properly. ''(AUR)''<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 />
<br />
=====Korean=====<br />
*{{Pkg|ttf-baekmuk}} - Collection of Korean TrueType fonts<br />
*{{AUR|ttf-alee}} - Set of free Hangul TrueType fonts (''AUR'')<br />
*{{AUR|ttf-unfonts-core}} - Un fonts (default Baekmuk fonts may be unsatisfactory) (''AUR'')<br />
*{{AUR|ttf-nanum}} - Nanum series TrueType fonts (''AUR'')<br />
*{{AUR|ttf-nanumgothic_coding}} - Nanum series fixed width TrueType fonts (''AUR'')<br />
<br />
====Cyrillic====<br />
''Also see [[#Monospaced]], [[#Sans-serif]] and [[#Serif]]''<br />
*{{AUR|font-arhangai}} - Mongolian Cyrillic (''AUR'')<br />
*{{AUR|ttf-pingwi-typography}} - PingWi Typography (PWT) fonts (''AUR'')<br />
<br />
====Greek====<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 />
*{{AUR|otf-gfs}} - Selection of OpenType fonts from the Greek Font Society ''(AUR)''<br />
*{{AUR|ttf-mgopen}} - Professional TrueType fonts from Magenta ''(AUR)''<br />
<br />
====Hebrew====<br />
*{{AUR|culmus}} - Nice collection of free Hebrew fonts ''(AUR)''<br />
<br />
====Indic====<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) ''(AUR)''<br />
<br />
====Khmer====<br />
*{{Pkg|ttf-khmer}} - Font covering glyphs for Khmer language<br />
*[http://code.google.com/webfonts/family?family=Hanuman&subset=khmer Hanuman] ({{AUR|ttf-google-fonts-hg}} or {{AUR|ttf-google-fonts-git}})<br />
<br />
====Sinhala====<br />
*{{AUR|ttf-lklug}} - Sinhala Unicode font (''AUR'')<br />
<br />
====Tamil====<br />
*{{AUR|ttf-tamil}} - Tamil Unicode fonts (''AUR'')<br />
<br />
====Tibetan====<br />
*{{Pkg|ttf-tibetan-machine}} - Tibetan Machine TTFont<br />
<br />
===Math===<br />
*{{Pkg|font-mathematica}} - Mathematica fonts by Wolfram Research, Inc.<br />
*{{AUR|ttf-mathtype}} - MathType fonts ''(AUR)''<br />
*{{AUR|ttf-computer-modern-fonts}} - ''(AUR)''<br />
<br />
===Microsoft fonts===<br />
See [[MS Fonts]].<br />
<br />
=== Apple Mac OS X fonts ===<br />
<br />
* {{AUR|ttf-mac-fonts}} - Mac OS X TrueType fonts<br />
* {{AUR|ttf-mac}} - Mac OS X TrueType fonts (This package does not come with the ttf fonts (only the otf fonts), they have to be provided on their own.<br />
<br />
===Monospaced===<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 />
* Agave ({{AUR|ttf-agave}})<br />
* [[Wikipedia:Andalé Mono|Andalé Mono]] ({{AUR|ttf-ms-fonts}})<br />
* Anka/Coder ({{AUR|ttf-anka-coder}})<br />
* [http://www.marksimonson.com/fonts/view/anonymous-pro Anonymous Pro] ({{AUR|ttf-anonymous-pro}}, included in {{AUR|ttf-google-fonts-hg}} and {{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-google-fonts-hg}} 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-hg}} and {{AUR|ttf-google-fonts-git}})<br />
* Envy Code R ({{AUR|ttf-envy-code-r}})<br />
* [[Wikipedia:GNU FreeFont|FreeMono]] ({{Pkg|ttf-freefont}}) - Unicode<br />
* [[Wikipedia:Inconsolata|Inconsolata]] ({{Pkg|ttf-inconsolata}}) - 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}}) - Alternative to Courier New (metric-compatible)<br />
* [[Wikipedia:Lucida Typewriter|Lucida Typewriter]] (included in package {{Pkg|jre}})<br />
* [[Wikipedia:Monaco (typeface)|Monaco]] ({{AUR|ttf-monaco}}) - Popular programming font on OSX/Textmate<br />
* Monofur ({{AUR|ttf-monofur}})<br />
<br />
====Bitmap====<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 />
*Proggy opti cyrillic ({{AUR|proggyopticyr-font}})<br />
*Tamsyn ({{Pkg|tamsyn-font}})<br />
*[[Wikipedia:Terminus (typeface)|Terminus]] ({{Pkg|terminus-font}})<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}}, included in {{AUR|ttf-sil-fonts}})<br />
*[[Wikipedia:Arial|Arial]] ({{AUR|ttf-ms-fonts}})<br />
*[[Wikipedia:Arial Black|Arial Black]] ({{AUR|ttf-ms-fonts}})<br />
*Arimo ({{AUR|ttf-google-fonts-hg}} 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:Constantia (typeface)|Constantia]] ({{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-hg}} and {{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}}, improved/reworked Cyrillic: {{AUR|ttf-liberastika}}) - Alternative to Arial (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-hg}} or {{AUR|ttf-google-fonts-git}}) - 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic<br />
*[[Wikipedia:Tahoma (typeface)|Tahoma]] ({{AUR|ttf-tahoma}})<br />
*[[Wikipedia:Trebuchet MS|Trebuchet]] ({{AUR|ttf-ms-fonts}})<br />
*[[Wikipedia:Ubuntu-Title|Ubuntu-Title]] ({{AUR|ttf-ubuntu-title}})<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 />
*[[Wikipedia:Cambria (typeface)|Cambria]] ({{AUR|ttf-vista-fonts}})<br />
*[[Wikipedia:Charis SIL|Charis]] ({{AUR|ttf-charis}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Cyrillic<br />
*[[Wikipedia:DejaVu fonts|DejaVu Serif]] ({{Pkg|ttf-dejavu}}) - Unicode<br />
*[[Wikipedia:Doulos SIL|Doulos]] ({{AUR|doulos-sil}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Cyrillic<br />
*[[Wikipedia:Droid (font)|Droid Serif]] ({{Pkg|ttf-droid}}, included in {{AUR|ttf-google-fonts-hg}} and {{AUR|ttf-google-fonts-git}})<br />
*[[Wikipedia:GNU FreeFont|FreeSerif]] ({{Pkg|ttf-freefont}}) - Unicode<br />
*[[Wikipedia:Gentium|Gentium]] ({{Pkg|ttf-gentium}}, included in {{AUR|ttf-sil-fonts}}) - Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet<br />
*[[Wikipedia:Georgia (typeface)|Georgia]] ({{AUR|ttf-ms-fonts}})<br />
*[[Wikipedia:Liberation fonts|Liberation Serif]] ({{Pkg|ttf-liberation}}) - Alternative to Times New Roman (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-google-fonts-hg}} or {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS replacement for Times New Roman (metric-compatible)<br />
<br />
===Unsorted===<br />
<!--This section should be absorbed into the Monospace/Serif/Sans-Serif structure--><br />
*{{AUR|ttf-google-fonts-git}} and {{AUR|ttf-google-fonts-hg}} — 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. {{AUR|ttf-google-fonts-hg}} pulls down the entire Mercurial repository from the upstream Web Fonts project. {{AUR|ttf-google-fonts-git}} pulls from a much smaller and leaner unofficial repository hosted on GitHub. ''(AUR)''<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 />
*{{AUR|ttf-sil-fonts}} — Gentium, Charis, Doulos, Andika and Abyssinica from SIL ''(AUR)''<br />
*{{Pkg|font-bh-ttf}} — X.Org Luxi fonts<br />
*{{Pkg|ttf-cheapskate}} — Font collection from ''dustismo.com''<br />
*{{AUR|ttf-isabella}} — Calligraphic font based on the ''Isabella Breviary'' of 1497<br />
*{{Pkg|ttf-junicode}} — Junius font containing almost complete medieval latin script glyphs<br />
*arkpandorafonts {{AUR|ttf-arkpandora}} — Alternative to Arial and Times New Roman fonts ''(AUR)''<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 />
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 />
<?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 />
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 />
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 />
$ fc-match monospace<br />
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"<br />
<br />
In this case, {{ic|DejaVuSansMono.ttf}} is the font represented by the monospace alias.<br />
<br />
== Hints ==<br />
=== Install fonts from official repositories ===<br />
Maybe you want to install all fonts available in ''official repositories''.<br />
;All fonts:<br />
# pacman -S $(pacman -Ssq font)<br />
;All ''TrueType'' fonts:<br />
# pacman -S $(pacman -Ssq ttf)<br />
<br />
=== List all installed fonts ===<br />
You can use the following command to list all installed fonts that are available on your system. <br />
<br />
$ fc-list<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}} 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 />
* [[Font Configuration]]</div>Oalhttps://wiki.archlinux.org/index.php?title=CUPS&diff=244296CUPS2013-01-17T21:33:11Z<p>Oal: /* Printer is not recognized by CUPS */</p>
<hr />
<div>[[Category:Printers]]<br />
[[cs:CUPS]]<br />
[[es:CUPS]]<br />
[[fr:CUPS]]<br />
[[it:CUPS]]<br />
[[pl:CUPS]]<br />
[[ru:CUPS]]<br />
[[th:CUPS]]<br />
[[tr:CUPS]]<br />
[[zh-CN:CUPS]]<br />
[[zh-TW:CUPS]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing and configuring CUPS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|CUPS printer sharing}}<br />
{{Article summary wiki|CUPS printer-specific problems}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
<br />
From [http://www.cups.org/index.php CUPS' site]:<br />
:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for OS® X and other UNIX®-like operating systems''".<br />
<br />
Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.<br />
<br />
==Cups Linux Printing workflow==<br />
As of {{Pkg|cups}} version 1.5.3-3, Arch Linux makes use of the new full pdf-based printing workflow. For<br />
further reading check [http://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdfasstandardprintjobformat PDF standard printing job format] and an old [https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPS-Filter-Chart CUPS filtering chart] for history and fun.<br />
A good starting point for general Linux printing questions is [http://www.linuxfoundation.org/collaborate/workgroups/openprinting here].<br />
<br />
There are two ways to setup a printer:<br />
* If there's a Linux cups server running in your network and sharing a printer you only need to install the client package.<br />
* The printer is connected directly to your system or you have access to an IPP network printer then setup a local cups server<br />
<br />
==Installing the client package==<br />
The package {{Pkg|libcups}} is the only required package. [[pacman|Install]] it from the [[Official repositories]].<br />
<br />
Then add your CUPS server's IP address or hostname into {{ic|/etc/cups/client.conf}}. That is all you need. Every application should quickly find the printer(s) shared by that CUPS server.<br />
<br />
===Optional advanced network setup===<br />
It is also possible to run a entire cupsd+cups-browsed instance on your client with Avahi browsing enabled to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown.<br />
{{Note|This behavior did not change with cups 1.6.x - the difference is that until 1.5.x cupsd was able to do printer browsing alone and now it can only browse its own shared printers.<br />
To get the local cupsd recognise other shared printers offered by a remote cupsd server you need a running local cups-browserd (supported since cups-filters 1.0.26) instance using Avahi to discover unknown printers.}}<br />
<br />
==Installing the server packages==<br />
The packages {{Pkg|cups}}, {{Pkg|cups-filters}}, {{Pkg|ghostscript}}, {{Pkg|gsfonts}} and some printer driver are needed. [[pacman|Install]] them from the [[Official repositories]].<br />
<br />
* '''cups''' - the actual CUPS daemon<br />
* '''cups-filters''' - essential filters<br />
* '''ghostscript''' - (optional) PostScript interpreter<br />
* '''gsfonts''' - GhostScript standard Type1 fonts<br />
<br />
If you want to enable printer browsing through your network, also install {{Pkg|avahi}}. Make sure avahi-daemon is started before cupsd.<br />
<br />
If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install {{Pkg|samba}}.<br />
<br />
===Printer driver===<br />
Here are some of the driver packages. Choosing the right driver depends on the printer:<br />
<br />
* '''{{Pkg|gutenprint}}''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostScript, CUPS, Foomatic, and the [[GIMP]]<br />
* '''{{Pkg|foomatic-db}}, {{Pkg|foomatic-db-engine}}, {{Pkg|foomatic-db-nonfree}}, and {{Pkg|foomatic-filters}}''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".<br />
* '''{{Pkg|hplip}}''' - HP drivers for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.<br />
* '''{{Pkg|splix}}''' - Samsung drivers for SPL (Samsung Printer Language) printers.<br />
<br />
* '''{{AUR|foo2zjs}}''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here]. Package is available in the [[AUR]].<br />
* '''{{AUR|hpoj}}''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems as in [https://answers.launchpad.net/hplip/+question/133425 this thread]. Package is available in the [[AUR]].<br />
* '''{{AUR|samsung-unified-driver}}''' - Unified Linux Driver for Samsung printers and scanners. Required for new printers such as the ML-2160. Package is available in the [[AUR]].<br />
* '''{{AUR|ufr2}}''' or '''{{AUR|cndrvcups-lb}}''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].<br />
<br />
* '''{{Pkg|cups-pdf}}''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it<br />
<br />
If you are not sure of what driver package to install or if the current driver is not working, it may be easiest to just install all of the drivers. Some of the package names are misleading because printers of other makes may rely on them. For example, the Brother HL-2140 needs the hplip driver installed.<br />
<br />
====Download printer PPD====<br />
Depending on the printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the ''foomatic-filters'', ''gimp-print'' and ''hplip'' packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
Here is an explanation of what a PPD file is from the Linux Printing website:<br />
:"''For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc.''"<br />
<br />
If the PPD for the printer is ''not'' already in CUPS, then:<br />
*check [[AUR]] to see if there are packages for the printer/manufacturer<br />
*visit the [http://www.openprinting.org/printers OpenPrinting database] and select the manufacturer and model of the printer<br />
*visit the manufacturer's site and search for GNU/Linux drivers<br />
<br />
{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}<br />
<br />
==Configuring==<br />
Now that CUPS is installed, there are a variety of options on how to set up printing solutions. As always, the tried and true command line method is at your disposal. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. However, in order to make this process easy for the largest amount of users, this article will focus on the web interface provided by CUPS.<br />
<br />
If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.<br />
<br />
USB printers can get accessed with two methods: The usblp kernel module and libusb. The former is the classic way. It is simple: Data is sent to the printer by writing it to a device file as a simple serial data stream. Reading the same device file allows bi-di access, at least for things like reading out ink levels, status, or printer capability information (PJL). It works very well for simple printers, but for multi-function devices (printer/scanner) it is not suitable and manufacturers like HP supply their own backends. (source: [http://lists.linuxfoundation.org/pipermail/printing-architecture/2012/002412.html here])<br />
<br />
===Kernel modules===<br />
Before using the CUPS web interface, the appropriate kernel modules need to be installed. The following steps are from the Gentoo Printing Guide.<br />
<br />
This section may not be necessary, however, depending on which kernel is being used. The kernel module may load automatically after plugging in the printer. Use the {{ic|tail}} command (described below) to see if the printer has already been detected. The {{ic|lsmod}} utility can also be used to see what modules have been loaded.<br />
<br />
====USB printers====<br />
{{Warning|As of {{pkg|cups}} version 1.6.0, you no longer need to [[Kernel modules#Blacklisting|blacklist]] the {{ic|usblp}} kernel module.}}<br />
If you find out this is the only way to fix a remaining issue please report this upstream to the CUPS bug tracker and maybe also get in contact with Till Kamppeter (Debian CUPS maintainer). See [http://cups.org/str.php?L4128 upstream bug] for more.<br />
<br />
Some USB printer users may want to try if blacklisting the {{ic|usblp}} module would help:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|blacklist usblp}}<br />
<br />
Custom kernel users may need to manually load the {{ic|usbcore}} module before proceeding:<br />
# modprobe usbcore<br />
<br />
Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:<br />
# tail /var/log/messages.log<br />
or<br />
# dmesg<br />
<br />
If you're using {{ic|usblp}}, the output should indicate that the printer has been detected like so:<br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
<br />
If you blacklisted {{ic|usblp}}, you will see something like:<br />
usb 3-2: new full speed USB device using uhci_hcd and address 3<br />
usb 3-2: configuration #1 chosen from 1 choice<br />
<br />
====Parallel port printers====<br />
To use a parallel port printer the configuration is pretty much the same, except for the modules:<br />
# modprobe lp<br />
# modprobe parport<br />
# modprobe parport_pc<br />
<br />
Once again, check the setup by running:<br />
# tail /var/log/messages.log<br />
It should display something like this:<br />
lp0: using parport0 (polling).<br />
<br />
If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in {{ic|/etc/cups/printers.conf}}:<br />
DeviceID = parallel:/dev/usb/lp0<br />
<br />
====Auto-loading====<br />
It is convenient to have the system automatically load the kernel module every time it starts up. To do so, use a text editor to open up {{ic|/etc/modules-load.d/printing.conf}} and add the appropriate modules one per line. Here is an example:<br />
lp<br />
parport<br />
parport_pc<br />
<br />
===CUPS daemon===<br />
With the kernel modules installed, you can now [[Systemd#Using_units|start the cups service]] and [[Systemd#Using_units|start the cups-browsed service]]. You may want to enable the these services so that it [[Daemon#Starting_on_Boot|starts automatically on boot]].<br />
<br />
=== Web interface and tool-kit ===<br />
<br />
Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hosts}}).<br />
<br />
From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a username and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label (e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.<br />
<br />
Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.<br />
<br />
{{Tip|See: [[#Alternative CUPS interfaces]] for other other front-ends.}}<br />
{{Note|When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize <br />
your printer.}}<br />
<br />
{{Note|To enable wireless scanning on certain HP multi-function devices using the {{pkg|hplip}} package, you may need to add the printer as a Network Printer using the http:// protocol. To determine the proper URI to use, run the {{ic|hp-makeuri}} command.}}<br />
<br />
==== CUPS administration ====<br />
<br />
A username and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default username is the one assigned in the ''sys'' group, or root (change this by editing {{ic|/etc/cups/cupsd.conf}} in the line of {{ic|SystemGroup}}). <br />
<br />
If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default username and password. In this case, follow [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions] on the CUPS FAQ. You might also want to read [https://bbs.archlinux.org/viewtopic.php?id=35567 this post].<br />
<br />
====Remote access to web interface====<br />
By default, the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the {{ic|/etc/cups/cupsd.conf}} file. Replace the line:<br />
Listen localhost:631<br />
with<br />
Port 631<br />
so that CUPS listens to incoming requests.<br />
<br />
Three levels of access can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
<br />
To give remote hosts access to one of these levels, add an {{ic|Allow}} statement to that level's section. An {{ic|Allow}} statement can take one or more of the forms listed below:<br />
Allow from all<br />
Allow from host.domain.com<br />
Allow from *.domain.com<br />
Allow from ip-address<br />
Allow from ip-address/netmask<br />
<br />
Deny statements can also be used. For example, if wanting to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file {{ic|/etc/cups/cupsd.conf}} would include this:<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow from localhost<br />
'''Allow from 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
You might also need to add:<br />
<br />
DefaultEncryption Never<br />
<br />
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.<br />
<br />
==Troubleshooting==<br />
The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:<br />
LogLevel debug<br />
<br />
And then viewing the output from {{ic|/var/log/cups/error_log}} like this:<br />
# tail -n 100 -f /var/log/cups/error_log<br />
<br />
The characters at the left of the output stand for:<br />
*D=Debug<br />
*E=Error<br />
*I=Information<br />
*And so on<br />
<br />
These files may also prove useful:<br />
*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful<br />
*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity<br />
<br />
Of course, it is important to know how CUPS works if wanting to solve related issues:<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).<br />
# CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.<br />
<br />
Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.<br />
<br />
===Problems resulting from upgrades===<br />
''Issues that appeared after CUPS and related program packages underwent a version increment''<br />
<br />
====CUPS stops working====<br />
The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" may result from trying to manage CUPS via localhost:631, for example.<br />
<br />
To use the new configuration, copy {{ic|/etc/cups/cupsd.conf.default}} to {{ic|/etc/cups/cupsd.conf}} (backup the old configuration if needed) and restart CUPS to employ the new settings.<br />
<br />
====All jobs are "stopped"====<br />
If all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.<br />
<br />
To check the printer's settings go to ''Printers'', then ''Modify Printer''. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.<br />
<br />
====All jobs are "The printer is not responding"====<br />
On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS, e.g.<br />
If your printer's connection looks like this:<br />
lpd://BRN_020554/BINARY_P1<br />
<br />
then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS<br />
<br />
====The PPD version is not compatible with gutenprint====<br />
Run:<br />
# /usr/sbin/cups-genppdupdate<br />
<br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
===Other===<br />
<br />
=====CUPS permission errors=====<br />
*Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:<br />
smb://workgroup/username:password@hostname/printer_name<br />
<br />
*Sometimes, the block device has wrong permissions:<br />
# ls /dev/usb/<br />
lp0<br />
# chgrp lp /dev/usb/lp0<br />
<br />
====HPLIP printer sends "/usr/lib/cups/backend/hp failed" error====<br />
Make sure dbus is installed and running. If the error persists, try starting avahi-daemon.<br />
<br />
Try adding the printer as a Network Printer using the http:// protocol. Generate the printer URI with {{ic|hp-makeuri}}.<br />
<br />
{{Note|There might need to set permissions issues right. Follow indications here: [[CUPS#Device node permissions]].}}<br />
<br />
====HPLIP printer claims job is complete but printer does nothing====<br />
This happens on HP printers when you select the (old) hpijs driver (e.g. the Deskjet D1600 series). Instead, use the hpcups driver when adding the printer.<br />
<br />
Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue.<br />
As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter<br />
hp-firmware -n<br />
<br />
====hp-toolbox sends an error, "Unable to communicate with device"====<br />
If running hp-toolbox as a regular user results in:<br />
# hp-toolbox<br />
# error: Unable to communicate with device (code=12): hp:/usb/<printer id><br />
or, "{{ic|Unable to communicate with device"}}", then it may be needed to [[Groups#Group management|add the user to the lp group]].<br />
<br />
This can also be caused by printers such as the P1102 that provide a virtual cd-rom drive for MS-Windows drivers. The lp dev appears and then disappears. In that case try the '''usb-modeswitch''' and '''usb-modeswitch-data''' packages, that lets one switch off the "Smart Drive" (udev rules included in said packages).<br />
<br />
This can also occur with network attached printers if the [[Avahi|avahi-daemon]] is not running.<br />
<br />
====CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer====<br />
If receiving any of the following error messages in {{ic|/var/log/cups/error_log}} while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':<br />
Filter "foomatic-rip" for printer "<printer_name>" not available: No such file or director<br />
or:<br />
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!<br />
make sure {{pkg|hplip}} has been [[pacman|installed]], in addition to [[#Packages|the packages mentioned above]]. See [https://bbs.archlinux.org/viewtopic.php?id=65615 this forum post] for more information.<br />
<br />
====Printing fails with unauthorised error====<br />
If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:<br />
AuthInfoRequired negotiate<br />
<br />
Comment it out and restart CUPS.<br />
<br />
====Print button greyed-out in GNOME print dialogs====<br />
:''<small>Source: [https://bbs.archlinux.org/viewtopic.php?id=70418 I can't print from gnome applications. - Arch Forums]</small>''<br />
<br />
Be sure the package: '''libgnomeprint''' is installed<br />
<br />
Edit {{ic|/etc/cups/cupsd.conf}} and add<br />
# HostNameLookups Double<br />
<br />
Restart CUPS:<br />
# systemctl restart cups<br />
<br />
====Unknown supported format: application/postscript====<br />
Comment the lines:<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
from {{ic|/etc/cups/mime.convs}}, and:<br />
application/octet-stream<br />
in {{ic|/etc/cups/mime.types}}.<br />
<br />
====Finding URIs for Windows Print Servers====<br />
<br />
Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:<br />
$ smbtree -U ''windowsusername''<br />
This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:<br />
{{bc| WORKGROUP<br />
\\REGULATOR-PC <br />
\\REGULATOR-PC\Z <br />
\\REGULATOR-PC\Public <br />
\\REGULATOR-PC\print$ Printer Drivers<br />
\\REGULATOR-PC\G <br />
\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}<br />
What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:<br />
smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series<br />
as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.<br />
If it won't work try '%20' instead of spaces.<br />
<br />
====Print-Job client-error-document-format-not-supported====<br />
Try installing the foomatic packages and use a foomatic driver.<br />
<br />
====/usr/lib/cups/backend/hp failed====<br />
Change<br />
SystemGroup sys root<br />
to<br />
SystemGroup lp root<br />
in {{ic|/etc/cups/cupsd.conf}}<br />
<br />
<br />
Following steps 1-3 in the Alternative CUPS interfaces below may be a better solution, since newer versions of cups will not allow the same group for both normal and admin operation.<br />
<br />
===="Unable to get list of printer drivers"====<br />
Try to remove Foomatic drivers.<br />
<br />
====lp: Error - Scheduler Not Responding====<br />
If you get this error when printing a document using:<br />
<br />
$ lp document-to-print<br />
<br />
Try setting the CUPS_SERVER environment variable:<br />
<br />
$ export CUPS_SERVER=localhost<br />
<br />
If this solves your problem, make the solution permanent by adding the export line above to ~/.bash_profile.<br />
<br />
====CUPS prints only an empty and an error-message page on HP LaserJet====<br />
<br />
There is a bug that causes CUPS to fail when printing images on HP LaserJet (in my case 3380). The bug has been reported and fixed by [https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/998087 Ubuntu].<br />
The first page is empty, the second page contains the following error message:<br />
ERROR:<br />
invalidaccess<br />
OFFENDING COMMAND:<br />
filter<br />
STACK:<br />
/SubFileDecode<br />
endstream<br />
...<br />
<br />
In order to fix the issue, use the following command (as superuser):<br />
lpadmin -p <printer> -o pdftops-renderer-default=pdftops<br />
<br />
===="Using invalid Host" error message====<br />
<br />
Try to add "ServerAlias *" into cupsd.conf<br />
<br />
====Printer doesn't print with an "Filter failed" message on CUPS web interface (HP printer)====<br />
<br />
Change the permissions of the printer USB port:<br />
<br />
Get the bus and device number from lsusb, then set the permission using:<br />
<br />
# chmod 0666 /dev/bus/usb/<bus number>/<device number><br />
<br />
====Printer is not recognized by CUPS====<br />
<br />
If your printer is not listed in the "Add Printers" page of the CUPS web interface, nor by lpinfo -v, try the following (suggested in [https://bbs.archlinux.org/viewtopic.php?pid=1037279#p1037279 this thread]):<br />
<br />
# Remove {{ic|usblp}} from blacklist<br />
# Load {{ic|usblp}} module<br />
modprobe usblp<br />
# Stop cups (sudo systemctl stop cups)<br />
# Add the following udev rule in the following new rule /etc/udev/rules.d/10-cups_device_link.rules<br />
KERNEL=="lp[0-9]", SYMLINK+="%k", GROUP="lp"<br />
# Reload udev rules<br />
sudo udevadm control --reload-rules<br />
# Unplug and re-plug the printer <br />
# Wait a few and then start cups again (sudo systemctl start cups)<br />
<br />
==Appendix==<br />
<br />
===Alternative CUPS interfaces===<br />
If using [[GNOME]], a possibility is to manage and configure the printer by [[pacman|installing]] {{Pkg|system-config-printer-gnome}}.<br />
<br />
For system-config-printer to work as it should, running as root may be required, or alternatively set up a "normal" user to administer CUPS (if so '''follow steps 1-3''')<br />
<br />
* 1. Create group, and add a user to it<br />
# groupadd lpadmin<br />
# usermod -aG lpadmin <username><br />
<br />
* 2. Add "lpadmin" (without the quotes) to this line in {{ic|/etc/cups/cupsd.conf}}<br />
SystemGroup sys root <insert here><br />
<br />
* 3. Restart cups, log out and in again (or restart computer)<br />
{{bc|# systemctl restart cups}}<br />
<br />
[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
There is also {{AUR|gtklp}} in the [[AUR]].<br />
<br />
===PDF virtual printer===<br />
CUPS-PDF is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. Obviously this package is not necessary, but it can be quite useful.<br />
<br />
Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit {{ic|/etc/cups/cups-pdf.conf}} by changing the line<br />
#Out /var/spool/cups-pdf/${USER}<br />
<br />
to<br />
<br />
Out /home/${USER}<br />
<br />
This package can be installed by the following command:<br />
# pacman -S cups-pdf<br />
<br />
After installing the package, set it up as if it were for any other printer by using the web interface. For the Device, select '''CUPS-PDF (Virtual PDF Printer)'''; Make/Manufacturer, choose '''Generic'''; Model/Driver, select '''Generic postscript color printer''' or '''Generic Cups-PDF Printer'''. Alternatively, provide the PPD file from [http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/cups-pdf-CURRENT/extra/CUPS-PDF.ppd this link].<br />
<br />
==== Print to PostScript: CUPS-PDF virtual printer trick ====<br />
<br />
Printing to PDF in most applications like OpenOffice is no problem; just hit the button. Yet when printing out to postscript, matters take a little more work. For applications like OpenOffice where printing to kprinter is nebulous at best, there has to be another way&mdash;and there is. The CUPS-PDF (Virtual PDF Printer) actually creates a PostScript file and then creates the PDF using the ps2pdf utility. To print to postscript, what needs to be done is capturing the intermediate postscript file created by CUPS-PDF. This is easily accomplished with by selecting the "print to file" option in the print dialog. (choose either .ps or .eps as the extension) After selecting the "print to file" checkbox simply enter the file name and click "print".<br />
<br />
=====Configuring CUPS-PDF virtual printer=====<br />
#Set up the CUPS daemon using the instructions on this page.<br />
#Install {{Pkg|cups-pdf}} from the [[Official Repositories|official repositories]].<br />
#Access the cups print manager: http://localhost:631 and select:<br />
Administration -> Add Printer<br />
Select CUPS-PDF (Virtual PDF), choose for the make and driver:<br />
Make: Generic<br />
Driver: Generic CUPS-PDF Printer<br />
<br />
Now to print to PostScript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...<br />
<br />
===Another source for printer drivers===<br />
[http://www.turboprint.de/english.html Turboprint] is a proprietary driver for many printers not yet supported by GNU/Linux (Canon i*, for example). Unlike CUPS, however, high quality prints are either marked with a watermark or are a pay-only service.<br />
<br />
==See also==<br />
* [http://localhost:631/documentation.html Official CUPS documentation], ''locally installed''<br />
* [http://www.cups.org/ Official CUPS Website]<br />
* [http://www.linuxprinting.org/ Linux Printing], ''[http://www.linuxfoundation.org The Linux Foundation]''<br />
* [http://www.gentoo.org/doc/en/printing-howto.xml Gentoo's Printing Guide], ''[http://www.gentoo.org/doc/en Gentoo Documentation Resources]''<br />
* [https://bbs.archlinux.org/ Arch Linux User Forums]<br />
* [http://wiki.gotux.net/tutorials/software/hp-printer Install HP Printers Easy Way]</div>Oalhttps://wiki.archlinux.org/index.php?title=Eclipse&diff=235363Eclipse2012-11-14T13:57:24Z<p>Oal: /* = Tooltips have dark background color with Gnome 3.6 Adwaita theme */</p>
<hr />
<div>[[Category:Development]]<br />
[[it:Eclipse]]<br />
[[ru:Eclipse]]<br />
[[zh-CN:Eclipse]]<br />
[http://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 (see below) and task management (either through its built-in TODO list or through the eclipse-mylyn package).<br />
<br />
== Installation ==<br />
<br />
It is very easy to install the Eclipse SDK in Arch Linux, just [[Pacman|install]] the {{Pkg|eclipse}} package from the [[official repositories]].<br />
<br />
This base package has [[Java]] development support built in.<br />
<br />
== Plugins ==<br />
There are two methods to install plugins for Eclipse:<br />
*using [[pacman]] to install plugins packaged in Arch repositories (see [[Eclipse plugin package guidelines]] for further informations);<br />
*using 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 />
{{Warning|<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/share/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 />
=== C/C++ support ===<br />
<br />
==== Eclipse CDT ====<br />
*Project homepage: http://www.eclipse.org/cdt/<br />
*Package in [extra]: {{Pkg|eclipse-cdt}}<br />
<br />
=== Perl support ===<br />
<br />
====EPIC====<br />
*Project homepage: http://www.epic-ide.org/<br />
*Package in [[AUR]]: {{AUR|eclipse-epic}}<br />
<br />
=== [[PHP]] support ===<br />
<br />
==== Eclipse PDT ====<br />
*Project homepage: http://www.eclipse.org/pdt/<br />
*Instructions for the Eclipse plugin version: http://wiki.eclipse.org/PDT/Installation<br />
*Package in [[AUR]]: {{AUR|eclipse-pdt}}<br />
<br />
==== PHPEclipse ====<br />
*Project homepage: http://www.phpeclipse.com/<br />
*Package in [[AUR]]: {{AUR|eclipse-phpeclipse}}<br />
<br />
==== Aptana PHP ====<br />
See Aptana Studio further down.<br />
<br />
=== [[Python]] support ===<br />
<br />
==== PyDev ====<br />
*Project homepage: http://pydev.org/<br />
*Package in [[AUR]]: {{AUR|eclipse-pydev}}<br />
<br />
=== Web development (HTML, CSS, JavaScript...) ===<br />
<br />
==== Aptana Studio ====<br />
*Project homepage: http://www.aptana.org/<br />
*For the Eclipse plugin version, use Eclipse's plugin manager<br />
*For the standalone version, there is a package in [[AUR]]: {{AUR|aptana-studio}}<br />
<br />
=== [[Subversion]] support ===<br />
<br />
==== Subclipse ====<br />
*Project homepage: http://subclipse.tigris.org/<br />
*Package in [[AUR]]: {{AUR|eclipse-subclipse}}<br />
*[http://www-128.ibm.com/developerworks/opensource/library/os-ecl-subversion/ How to use Subversion with Eclipse]<br />
<br />
==== Eclipse Subversive ====<br />
*Project homepage: http://www.eclipse.org/subversive/<br />
*Package in [[AUR]]: {{AUR|eclipse-subversive}}<br />
<br />
=== [[Git]] support ===<br />
<br />
==== EGit ====<br />
*Project homepage: http://www.eclipse.org/egit<br />
*Eclipse Update Link: http://download.eclipse.org/egit/updates<br />
*Package in [[AUR]]: {{AUR|eclipse-egit}}<br />
<br />
=== [[Mercurial]] support ===<br />
<br />
==== MercurialEclipse ====<br />
*Project homepage: http://code.google.com/a/eclipselabs.org/p/mercurialeclipse/<br />
*Eclipse Update Link: http://mercurialeclipse.eclipselabs.org.codespot.com/hg.wiki/update_site/stable<br />
*Package in [[AUR]]: {{AUR|eclipse-mercurial}}<br />
<br />
===[[LaTeX]] support ===<br />
<br />
==== TeXlipse ====<br />
*Project homepage: http://texlipse.sourceforge.net/<br />
*Eclipse Update Link: http://texlipse.sourceforge.net<br />
<br />
==Updates==<br />
*Eclipse and the plugins installed with pacman are obviously updated with pacman itself.<br />
*For plugins installed with Eclipse's plugin manager, 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 3.7 (Indigo), check you have enabled this repository:<br />
<br />
http://download.eclipse.org/releases/indigo<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 />
== Enable javadoc integration ==<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 provided by sun. Just follow these instructions:<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 "http://java.sun.com/javase/6/docs/api/" in the "Javadoc location path:" text field.<br />
# Done!<br />
<br />
=== Offline Version ===<br />
<br />
If you have no internet connection on your development machine or do not want to constantly consume bandwidth for the documentation, you can store the documentation locally, by installing the {{ic|openjdk[version]-src}} package. Eclipse should find the javadocs automatically.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Autocompletion and javadoc render crash ===<br />
For some reason, libxul may crash Eclipse with a Traceback like<br />
<br />
# Problematic frame:<br />
# C [libxul.so+0xd07552] NS_InvokeByIndex_P+0x5e9a<br />
<br />
To fix this issue, you can try installing {{Pkg|libwebkit}} and adding the following lines in your {{ic|/usr/share/eclipse/eclipse.ini}}: <br />
<br />
-Dorg.eclipse.swt.browser.UseWebKitGTK=true<br />
<br />
If that does not work (or if you do not want to use libwebkit) try this:<br />
<br />
:1. Download http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.0.17/runtimes/xulrunner-1.9.0.17.en-US.linux-i686.tar.bz2<br />
:2. Unpack it into {{ic|/home/<Username>/.xulrunner}} (or another location)<br />
:3. Add this line to your Eclipse configuration file {{ic|/usr/share/eclipse/eclipse.ini}}:<br />
<br />
-Dorg.eclipse.swt.browser.XULRunnerPath=/home/<Username>/.xulrunner<br />
<br />
:Now everything should just work fine and tooltips should display correctly.<br />
<br />
=== Crash on first boot or when choosing "Help -> Welcome" ===<br />
See above.<br />
<br />
=== Ctrl+X closes Eclipse ===<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 {{Keypress|Ctrl+X}} combination. Usually it is the first one.<br />
<br />
=== Eclipse 4.2.0 not respecting dark/custom gtk themes resulting in white background ===<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: http://www.eclipse.org/forums/index.php/m/872214/<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 />
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=688285 <br />
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=381010 (WONTFIX)</div>Oalhttps://wiki.archlinux.org/index.php?title=Eclipse&diff=235362Eclipse2012-11-14T13:57:13Z<p>Oal: /* Troubleshooting */</p>
<hr />
<div>[[Category:Development]]<br />
[[it:Eclipse]]<br />
[[ru:Eclipse]]<br />
[[zh-CN:Eclipse]]<br />
[http://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 (see below) and task management (either through its built-in TODO list or through the eclipse-mylyn package).<br />
<br />
== Installation ==<br />
<br />
It is very easy to install the Eclipse SDK in Arch Linux, just [[Pacman|install]] the {{Pkg|eclipse}} package from the [[official repositories]].<br />
<br />
This base package has [[Java]] development support built in.<br />
<br />
== Plugins ==<br />
There are two methods to install plugins for Eclipse:<br />
*using [[pacman]] to install plugins packaged in Arch repositories (see [[Eclipse plugin package guidelines]] for further informations);<br />
*using 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 />
{{Warning|<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/share/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 />
=== C/C++ support ===<br />
<br />
==== Eclipse CDT ====<br />
*Project homepage: http://www.eclipse.org/cdt/<br />
*Package in [extra]: {{Pkg|eclipse-cdt}}<br />
<br />
=== Perl support ===<br />
<br />
====EPIC====<br />
*Project homepage: http://www.epic-ide.org/<br />
*Package in [[AUR]]: {{AUR|eclipse-epic}}<br />
<br />
=== [[PHP]] support ===<br />
<br />
==== Eclipse PDT ====<br />
*Project homepage: http://www.eclipse.org/pdt/<br />
*Instructions for the Eclipse plugin version: http://wiki.eclipse.org/PDT/Installation<br />
*Package in [[AUR]]: {{AUR|eclipse-pdt}}<br />
<br />
==== PHPEclipse ====<br />
*Project homepage: http://www.phpeclipse.com/<br />
*Package in [[AUR]]: {{AUR|eclipse-phpeclipse}}<br />
<br />
==== Aptana PHP ====<br />
See Aptana Studio further down.<br />
<br />
=== [[Python]] support ===<br />
<br />
==== PyDev ====<br />
*Project homepage: http://pydev.org/<br />
*Package in [[AUR]]: {{AUR|eclipse-pydev}}<br />
<br />
=== Web development (HTML, CSS, JavaScript...) ===<br />
<br />
==== Aptana Studio ====<br />
*Project homepage: http://www.aptana.org/<br />
*For the Eclipse plugin version, use Eclipse's plugin manager<br />
*For the standalone version, there is a package in [[AUR]]: {{AUR|aptana-studio}}<br />
<br />
=== [[Subversion]] support ===<br />
<br />
==== Subclipse ====<br />
*Project homepage: http://subclipse.tigris.org/<br />
*Package in [[AUR]]: {{AUR|eclipse-subclipse}}<br />
*[http://www-128.ibm.com/developerworks/opensource/library/os-ecl-subversion/ How to use Subversion with Eclipse]<br />
<br />
==== Eclipse Subversive ====<br />
*Project homepage: http://www.eclipse.org/subversive/<br />
*Package in [[AUR]]: {{AUR|eclipse-subversive}}<br />
<br />
=== [[Git]] support ===<br />
<br />
==== EGit ====<br />
*Project homepage: http://www.eclipse.org/egit<br />
*Eclipse Update Link: http://download.eclipse.org/egit/updates<br />
*Package in [[AUR]]: {{AUR|eclipse-egit}}<br />
<br />
=== [[Mercurial]] support ===<br />
<br />
==== MercurialEclipse ====<br />
*Project homepage: http://code.google.com/a/eclipselabs.org/p/mercurialeclipse/<br />
*Eclipse Update Link: http://mercurialeclipse.eclipselabs.org.codespot.com/hg.wiki/update_site/stable<br />
*Package in [[AUR]]: {{AUR|eclipse-mercurial}}<br />
<br />
===[[LaTeX]] support ===<br />
<br />
==== TeXlipse ====<br />
*Project homepage: http://texlipse.sourceforge.net/<br />
*Eclipse Update Link: http://texlipse.sourceforge.net<br />
<br />
==Updates==<br />
*Eclipse and the plugins installed with pacman are obviously updated with pacman itself.<br />
*For plugins installed with Eclipse's plugin manager, 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 3.7 (Indigo), check you have enabled this repository:<br />
<br />
http://download.eclipse.org/releases/indigo<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 />
== Enable javadoc integration ==<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 provided by sun. Just follow these instructions:<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 "http://java.sun.com/javase/6/docs/api/" in the "Javadoc location path:" text field.<br />
# Done!<br />
<br />
=== Offline Version ===<br />
<br />
If you have no internet connection on your development machine or do not want to constantly consume bandwidth for the documentation, you can store the documentation locally, by installing the {{ic|openjdk[version]-src}} package. Eclipse should find the javadocs automatically.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Autocompletion and javadoc render crash ===<br />
For some reason, libxul may crash Eclipse with a Traceback like<br />
<br />
# Problematic frame:<br />
# C [libxul.so+0xd07552] NS_InvokeByIndex_P+0x5e9a<br />
<br />
To fix this issue, you can try installing {{Pkg|libwebkit}} and adding the following lines in your {{ic|/usr/share/eclipse/eclipse.ini}}: <br />
<br />
-Dorg.eclipse.swt.browser.UseWebKitGTK=true<br />
<br />
If that does not work (or if you do not want to use libwebkit) try this:<br />
<br />
:1. Download http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.0.17/runtimes/xulrunner-1.9.0.17.en-US.linux-i686.tar.bz2<br />
:2. Unpack it into {{ic|/home/<Username>/.xulrunner}} (or another location)<br />
:3. Add this line to your Eclipse configuration file {{ic|/usr/share/eclipse/eclipse.ini}}:<br />
<br />
-Dorg.eclipse.swt.browser.XULRunnerPath=/home/<Username>/.xulrunner<br />
<br />
:Now everything should just work fine and tooltips should display correctly.<br />
<br />
=== Crash on first boot or when choosing "Help -> Welcome" ===<br />
See above.<br />
<br />
=== Ctrl+X closes Eclipse ===<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 {{Keypress|Ctrl+X}} combination. Usually it is the first one.<br />
<br />
=== Eclipse 4.2.0 not respecting dark/custom gtk themes resulting in white background ===<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: http://www.eclipse.org/forums/index.php/m/872214/<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 />
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=688285 <br />
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=381010 (WONTFIX)</div>Oalhttps://wiki.archlinux.org/index.php?title=MinGW_package_guidelines&diff=192784MinGW package guidelines2012-04-04T09:36:18Z<p>Oal: typo</p>
<hr />
<div>[[Category:Package development (English)]]<br />
{{i18n|MinGW PKGBUILD Guidelines}}<br />
{{Package Guidelines}}<br />
<br />
Writing [[PKGBUILD]]s for software running in [[Wikipedia:MinGW|MinGW]] environment.<br />
<br />
== Package Naming ==<br />
Since there are mingw32 as well as mingw-w64, it is important to properly name your packages. A package for mingw32 might be named {{Ic|mingw32-''pkgname''}} while a package for mingw-w64 should be named {{Ic|mingw-w64-''pkgname''}}. The following parts of the guide focuses on mingw32 as it is a lot more popular than mingw-w64.<br />
<br />
== Packaging ==<br />
Packaging for cross platform packages can be fairly tricky as there are many different build systems and low-level quirks. Take a note of the following things though:<br />
* always add {{Pkg|mingw32-runtime}} to {{ic|depends}}<br />
* always add {{Pkg|mingw32-gcc}} to {{ic|makedepends}}<br />
* always add {{ic|!strip}} and {{ic|!buildflags}} to {{ic|options }}<br />
* always use the original {{ic|pkgdesc}} and append {{ic|(mingw32)}} to the end of {{ic|pkgdesc}}<br />
* always use and follow the original {{ic|pkgver}} of the official package<br />
* always add {{ic|unset LDFLAGS}} in front of toolchain configure/Makefile generation sequences<br />
* always put all stuff under the {Ic|/usr/i486-mingw32 prefix}}<br />
* always use {{ic|any}} as the architecture<br />
* consider using {{ic|!libtool}} in {{ic|options}} if you get {{Ic|.la}} files in {{ic|$pkgdir}}<br />
<br />
As mentioned above, the files should all be installed into {{Ic|/usr/i486-mingw32}}. Specifically, all {{Ic|.dll}} files should be put into {{Ic|/usr/i486-mingw32/bin}} as they are dynamic libraries needed at runtime. Their corresponding {{Ic|.dll.a}} files should go into {{Ic|/usr/i486-mingw32/lib}}. Please delete any unnecessary documentation and perhaps other files from {{Ic|/usr/share}}. Cross-compilations packages aren't meant for the user but only for the compiler and as such you should try to make them as small as possible.<br />
<br />
Always try to match the {{Ic|pkgver}} in your mingw packages to the {{Ic|pkgver}} of the corresponding regular packages in the official Arch Linux repos (not the testing repos). This ensures that the cross-compiled software works exactly the same way on mingw without any unexpected bugs. If packages in Arch are out-of-date, there usually is a good reason and you should still follow the Arch version instead of using the most recent upstream release.<br />
<br />
== Examples ==<br />
The following examples will try to cover some of the most common conventions and build systems.<br />
<br />
=== Plain Makefile ===<br />
{{bc|<nowiki><br />
# Maintainer: yourname <yourmail><br />
pkgname=mingw32-foo<br />
pkgver=1.0<br />
pkgrel=1<br />
pkgdesc="Foo bar (mingw32)"<br />
arch=('any')<br />
url="http://www.foo.bar"<br />
license=('GPL')<br />
makedepends=('mingw32-gcc')<br />
depends=('mingw32-runtime')<br />
options=('!strip' '!buildflags')<br />
source=("http://www.foo.bar/foobar.tar.gz")<br />
md5sums=('4736ac4f34fd9a41fa0197eac23bbc24')<br />
<br />
build() {<br />
cd "${srcdir}/foobar"<br />
<br />
unset LDFLAGS<br />
<br />
sed "s|LOCAL = /usr/local|LOCAL = ${pkgdir}/usr/i486-mingw32|g" -i Makefile<br />
sed "s|CXX = gcc|CXX = i486-mingw32-gcc|g" -i Makefile<br />
sed "s|CXXFLAGS = |CXXFLAGS = -fPIC |g" -i Makefile<br />
<br />
# or with setconf instead of sed (add 'setconf' to makedepends)<br />
#setconf Makefile LOCAL "$pkgdir/usr/i486-mingw32"<br />
#setconf Makefile CXX i486-mingw32-gcc<br />
#setconf Makefile CXXFLAGS -fPIC<br />
<br />
make<br />
}<br />
<br />
package() {<br />
cd "${srcdir}/foobar"<br />
<br />
mkdir -p ${pkgdir}/usr/i486-mingw32/{lib,include}<br />
make install<br />
chmod 644 ${pkgdir}/usr/i486-mingw32/lib/libfoo.a<br />
i486-mingw32-ranlib ${pkgdir}/usr/i486-mingw32/lib/libfoo.a<br />
}<br />
</nowiki>}}<br />
<br />
=== Autotools ===<br />
{{bc|<nowiki><br />
# Maintainer: yourname <yourmail><br />
pkgname=mingw32-foo<br />
pkgver=1.0<br />
pkgrel=1<br />
pkgdesc="Foo bar (mingw32)"<br />
arch=('any')<br />
url="http://www.foo.bar"<br />
license=('GPL')<br />
makedepends=('mingw32-gcc')<br />
depends=('mingw32-runtime')<br />
options=('!strip' '!buildflags')<br />
source=("http://www.foo.bar/foobar.tar.gz")<br />
md5sums=('4736ac4f34fd9a41fa0197eac23bbc24')<br />
<br />
build() {<br />
cd "${srcdir}/foobar"<br />
<br />
unset LDFLAGS<br />
<br />
./configure --prefix=/usr/i486-mingw32 --host=i486-mingw32<br />
make<br />
}<br />
<br />
package() {<br />
cd "${srcdir}/foobar"<br />
<br />
make DESTDIR=${pkgdir} install<br />
}<br />
</nowiki>}}<br />
<br />
=== CMake ===<br />
{{bc|<nowiki><br />
# Maintainer: yourname <yourmail><br />
pkgname=mingw32-foo<br />
pkgver=1.0<br />
pkgrel=1<br />
pkgdesc="Foo bar (mingw32)"<br />
arch=('any')<br />
url="http://www.foo.bar"<br />
license=('GPL')<br />
makedepends=('mingw32-gcc' 'cmake')<br />
depends=('mingw32-runtime')<br />
options=('!strip' '!buildflags')<br />
source=("http://www.foo.bar/foobar.tar.gz"<br />
"cmake-toolchain.cmake")<br />
md5sums=('4736ac4f34fd9a41fa0197eac23bbc24'<br />
'dd2b2db48187dff84050fe191d309d81')<br />
<br />
build() {<br />
cd "${srcdir}/foobar"<br />
<br />
unset LDFLAGS<br />
<br />
mkdir build && cd build<br />
cmake .. \<br />
-DCMAKE_INSTALL_PREFIX=/usr/i486-mingw32/ \<br />
-DCMAKE_TOOLCHAIN_FILE=${srcdir}/cmake-toolchain.cmake<br />
make<br />
}<br />
<br />
package() {<br />
cd "${srcdir}/foobar"<br />
<br />
cd build<br />
make DESTDIR=${pkgdir} install<br />
}<br />
</nowiki>}}<br />
<br />
In this case, the toolchain is specified externally in {{ic|cmake-toolchain.cmake}}:<br />
<br />
{{hc|cmake-toolchain.cmake|<nowiki># the name of the target operating system<br />
SET(CMAKE_SYSTEM_NAME Windows)<br />
<br />
# which compilers to use for C and C++<br />
SET(CMAKE_C_COMPILER i486-mingw32-gcc)<br />
SET(CMAKE_CXX_COMPILER i486-mingw32-g++)<br />
SET(CMAKE_RC_COMPILER i486-mingw32-windres)<br />
<br />
# here is the target environment located<br />
SET(CMAKE_FIND_ROOT_PATH /usr/i486-mingw32)<br />
<br />
# adjust the default behaviour of the FIND_XXX() commands:<br />
# search headers and libraries in the target environment, search <br />
# programs in the host environment<br />
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)<br />
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)<br />
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)</nowiki>}}</div>Oalhttps://wiki.archlinux.org/index.php?title=Eclipse&diff=182806Eclipse2012-02-09T15:00:59Z<p>Oal: /* Autocompletion and javadoc render crash */ make this more googlable</p>
<hr />
<div>[[Category:Development (English)]]<br />
{{i18n|Eclipse}}<br />
[http://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 and Perl. The IDE can also provide subversion support (see below) and task management (either through its built-in TODO list or through the eclipse-mylyn package).<br />
<br />
== Installation ==<br />
<br />
It is very easy to install the Eclipse SDK in Arch Linux:<br />
# pacman -S eclipse<br />
<br />
This base package has Java development support built in.<br />
<br />
== Plugins ==<br />
There are two methods to install plugins for Eclipse:<br />
*using [[pacman]] to install plugins packaged in Arch repositories (see [[Eclipse plugin package guidelines]] for further informations);<br />
*using 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 />
{{Warning|<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 {{Filename|/usr/share/eclipse/plugins/}}; if you installed them as normal user, they would be stored in a version-dependent folder inside {{Filename|~/.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 />
=== C/C++ support ===<br />
<br />
==== Eclipse CDT ====<br />
*Project homepage: http://www.eclipse.org/cdt/<br />
*Package in [extra]: {{Package Official|eclipse-cdt}}<br />
<br />
=== Perl support ===<br />
<br />
====EPIC====<br />
*Project homepage: http://www.epic-ide.org/<br />
*Package in [[AUR]]: {{Package AUR|eclipse-epic}}<br />
<br />
=== [[PHP]] support ===<br />
<br />
==== Eclipse PDT ====<br />
*Project homepage: http://www.eclipse.org/pdt/<br />
*Instructions for the Eclipse plugin version: http://wiki.eclipse.org/PDT/Installation<br />
*Package in [[AUR]]: {{Package AUR|eclipse-pdt}}<br />
<br />
==== PHPEclipse ====<br />
*Project homepage: http://www.phpeclipse.com/<br />
*Package in [community]: {{Package Official|eclipse-phpeclipse}}<br />
<br />
==== Aptana PHP ====<br />
See Aptana Studio further down.<br />
<br />
=== [[Python]] support ===<br />
<br />
==== PyDev ====<br />
*Project homepage: http://pydev.org/<br />
*Package in [[AUR]]: {{Package AUR|eclipse-pydev}}<br />
<br />
=== Web development (HTML, CSS, JavaScript...) ===<br />
<br />
==== Aptana Studio ====<br />
*Project homepage: http://www.aptana.org/<br />
*For the Eclipse plugin version, use Eclipse's plugin manager<br />
*For the standalone version, there is a package in [[AUR]]: {{Package AUR|aptana-studio}}<br />
<br />
=== [[Subversion]] support ===<br />
<br />
==== Subclipse ====<br />
*Project homepage: http://subclipse.tigris.org/<br />
*Package in [[AUR]]: {{Package AUR|eclipse-subclipse}}<br />
*[http://www-128.ibm.com/developerworks/opensource/library/os-ecl-subversion/ How to use Subversion with Eclipse]<br />
<br />
==== Eclipse Subversive ====<br />
*Project homepage: http://www.eclipse.org/subversive/<br />
*Package in [[AUR]]: {{Package AUR|eclipse-subversive}}<br />
<br />
=== [[Git]] support ===<br />
<br />
==== EGit ====<br />
*Project homepage: http://www.eclipse.org/egit<br />
*Eclipse Update Link: http://download.eclipse.org/egit/updates<br />
*Package in [[AUR]]: {{Package AUR|eclipse-egit}}<br />
<br />
===[[LaTeX]] support ===<br />
<br />
==== TeXlipse ====<br />
*Project homepage: http://texlipse.sourceforge.net/<br />
*Eclipse Update Link: http://texlipse.sourceforge.net<br />
<br />
==Updates==<br />
*Eclipse and the plugins installed with pacman are obviously updated with pacman itself.<br />
*For plugins installed with Eclipse's plugin manager, 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 3.7 (Indigo), check you have enabled this repository:<br />
<br />
http://download.eclipse.org/releases/indigo<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 />
== Using Sun JDK in place of OpenJDK ==<br />
{{Accuracy}}<br />
Eclipse depends on openjdk6 by default, which you can easily replace with jdk, following [[Java|this article]].<br />
<br />
By the way, you may want to link the file /opt/java/bin/java to /usr/bin/java:<br />
# ln -s /opt/java/bin/java /usr/bin<br />
<br />
== Enable javadoc integration ==<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 provided by sun. Just follow these instructions:<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 {{Filename|/opt/java/jre/lib/rt.jar}} item under "JRE system libraries:", then click "Javadoc Location...".<br />
# Enter "http://java.sun.com/javase/6/docs/api/" in the "Javadoc location path:" text field.<br />
# Done!<br />
<br />
=== Offline Version ===<br />
<br />
If you have no internet connection on your development machine or do not want to constantly consume bandwidth for the documentation, you can store the documentation locally.<br />
<br />
# Start your favorite web browser and navigate to http://java.sun.com/javase/downloads/index.jsp<br />
# Search for "Java SE 6 Documentation" and click the Download link.<br />
# Follow the instructions to download the "jdk-6-doc.zip" file. (e.g. to {{Filename|/home/docs/jdk-6-doc.zip}}).<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 {{Filename|/opt/java/jre/lib/rt.jar}} item under "JRE system libraries:", then click "Javadoc Location...".<br />
# Select the point "Javadoc in archive"<br />
# Enter the path to the previously downloaded {{Filename|jdk-6-doc.zip}} (e.g. {{Filename|/home/docs/jdk-6-doc.zip}}) in the "Archive path:" text field.<br />
# Done!<br />
<br />
== Troubleshooting ==<br />
<br />
=== Autocompletion and javadoc render crash ===<br />
For some reason, libxul may crash Eclipse with a Traceback like<br />
<br />
# Problematic frame:<br />
# C [libxul.so+0xd07552] NS_InvokeByIndex_P+0x5e9a<br />
<br />
To fix this issue, you can try installing {{Package Official|libwebkit}} and adding the following lines in your {{Filename|/usr/share/eclipse/eclipse.ini}}: <br />
<br />
-Dorg.eclipse.swt.browser.UseWebKitGTK=true<br />
<br />
If that does not work (or if you do not want to use libwebkit) try this:<br />
<br />
:1. Download http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.0.17/runtimes/xulrunner-1.9.0.17.en-US.linux-i686.tar.bz2<br />
:2. Unpack it into /home/<Username>/.xulrunner (or another location)<br />
:3. Add this line to your Eclipse configuration file {{Filename|/usr/share/eclipse/eclipse.ini}}:<br />
<br />
-Dorg.eclipse.swt.browser.XULRunnerPath=/home/<Username>/.xulrunner<br />
<br />
:Now everything should just work fine and tooltips should display correctly.<br />
<br />
=== Crash on first boot or when choosing "Help->Welcome" ===<br />
See above.</div>Oalhttps://wiki.archlinux.org/index.php?title=CUPS&diff=178515CUPS2012-01-15T19:10:06Z<p>Oal: I know this is somewhat redundant but I think this may save people from wasting a few hours</p>
<hr />
<div>[[Category:Printers (English)]]<br />
{{i18n|CUPS}}<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing and configuring CUPS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|CUPS printer sharing}}<br />
{{Article summary wiki|CUPS printer-specific problems}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
<br />
From [http://www.cups.org/index.php CUPS' site]:<br />
:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for Mac OS® X and other UNIX®-like operating systems''".<br />
<br />
Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.<br />
<br />
==Installing==<br />
These packages are needed:<br />
# pacman -S cups ghostscript gsfonts<br />
If regular cups does not work you may try installing {{AUR|cups-usblp}} from the [[AUR]] (Recommended for Samsung USB printers).<br />
<br />
* '''cups''' - The actual CUPS software<br />
* '''ghostscript''' - Interpreter for the Postscript language<br />
* '''gsfonts''' - GhostScript standard Type1 fonts<br />
* '''hpoj''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems. Read this [http://answers.launchpad.net/hplip/+question/133425 thread at launchpad/hplip] for more information.<br />
<br />
If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install Samba:<br />
# pacman -S samba<br />
<br />
===Printer driver===<br />
Here are some of the driver packages. Choosing the right driver depends on the printer:<br />
<br />
* '''gutenprint''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostSscript, CUPS, Foomatic, and the [[GIMP]]<br />
* '''foomatic-db, foomatic-db-engine, foomatic-db-nonfree, and foomatic-filters''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".<br />
* '''foo2zjs''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here], Foo2zsj is available in the {{AUR|foo2zjs}}.<br />
* '''hplip''' - HP GNU/Linux driver. Provides support for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.<br />
* '''splix''' - Samsung drivers for SPL (Samsung Printer Language) printers (for USB printers use with {{AUR|cups-usblp}} from the [[AUR]])<br />
* '''ufr2''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].<br />
* '''cups-pdf''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it<br />
<br />
If unsure of what driver package to install or if the current driver is not working, it may be easiest to just install all of drivers, since some of the packages are misleading because printers of other makes may rely on them. For instance, the Brother HL-2140 needs the hplip driver installed.<br />
# pacman -S gutenprint foomatic-db foomatic-db-engine \<br />
foomatic-db-nonfree foomatic-filters \<br />
hplip splix cups-pdf<br />
<br />
====Download printer PPD====<br />
Depending on the printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the ''foomatic-filters'', ''gimp-print'' and ''hplip'' packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
Here is an explanation of what a PPD file is from the Linux Printing website:<br />
:"''For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc.''"<br />
<br />
If the PPD for the printer is ''not'' already in CUPS, then:<br />
*check [[AUR]] to see if there are packages for the printer/manufacturer<br />
*visit the [http://www.openprinting.org/printers OpenPrinting database] and select the manufacturer and model of the printer<br />
*visit the manufacturer's site and search for GNU/Linux drivers<br />
<br />
{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}<br />
<br />
==Configuring==<br />
Now that CUPS is installed, there are a variety of options on how to setup printing solutions. As always, the tried and true command line method is at your disposal. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. However, in order to make this process easy for the largest amount of users, this article will focus on the web interface provided by CUPS.<br />
<br />
If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.<br />
<br />
===Kernel modules===<br />
Before using the CUPS web interface, the appropriate kernel modules need to be installed. The following steps are from the Gentoo Printing Guide.<br />
<br />
This section may not be necessary, however, depending on which kernel is being used. The kernel module may load automatically after plugging in the printer. Use the {{ic|tail}} command (described below) to see if the printer has already been detected. The {{ic|lsmod}} utility can also be used to see what modules have been loaded.<br />
<br />
====USB printers====<br />
USB printer users may need to blacklist the {{ic|usblp}} module. Keep in mind that there seems to be a lot of [http://bbs.archlinux.org/viewtopic.php?pid=660601 uncertainty] regarding blacklisting {{ic|usblp}}, as some USB printers, including some Canon and Epson printer series, are not recognized without it. Several user reported issues with Samsung printers when using {{ic|cups}} with blacklisted {{ic|usblp}} module, the solution was to re-enable {{ic|usblp}} and install {{ic|cups-usblp}} from aur instead of regular {{ic|cups}} package (https://bbs.archlinux.org/viewtopic.php?pid=778104)<br />
<br />
To blacklist the module:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|blacklist usblp}}<br />
<br />
Custom kernel users may need to manually load the {{ic|usbcore}} module before proceeding:<br />
# modprobe usbcore<br />
<br />
Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:<br />
# tail /var/log/messages.log<br />
or<br />
# dmesg<br />
<br />
If you're using {{ic|usblp}}, the output should indicate that the printer has been detected like so:<br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
<br />
If you blacklisted {{ic|usblp}}, you will see something like:<br />
usb 3-2: new full speed USB device using uhci_hcd and address 3<br />
usb 3-2: configuration #1 chosen from 1 choice<br />
<br />
====Parallel port printers====<br />
To use a parallel port printer the configuration is pretty much the same, except for the modules:<br />
# modprobe lp<br />
# modprobe parport<br />
# modprobe parport_pc<br />
<br />
Once again, check the setup by running:<br />
# tail /var/log/messages.log<br />
It should display something like this:<br />
lp0: using parport0 (polling).<br />
<br />
If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in /etc/cups/printers.conf:<br />
DeviceID = parallel:/dev/usb/lp0<br />
<br />
====Auto-loading====<br />
It is convenient to have the system automatically load the kernel module every time the it starts up. To do so, use a text editor to open up {{ic|/etc/[[rc.conf]]}} and add the appropriate module to the {{ic|1=MODULES=()}} line. Here is an example:<br />
MODULES=(!usbserial scsi_mod sd_mod snd-ymfpci snd-pcm-oss '''lp parport parport_pc''' ide-scsi)<br />
<br />
===CUPS daemon===<br />
With the kernel modules installed, the you can now start the [[Daemon#Performing daemon actions manually|start the cupsd daemon]]. Add cupsd to your [[daemons#Starting on Boot|DAEMONS array]] so it starts automatically on boot.<br />
<br />
=== Web interface and tool-kit ===<br />
<br />
Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hosts}}).<br />
<br />
From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a user-name and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label ( e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.<br />
<br />
Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.<br />
<br />
{{Tip|See: [[#Alternative CUPS interfaces]] for other other frontends.}}<br />
{{Note|When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize your printer.}}<br />
<br />
==== CUPS administration ====<br />
<br />
A user-name and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default user-name is the one assigned in the ''sys'' group, or root (change this by editing {{ic|/etc/cups/cupsd.conf}} in the line of ''SystemGroup''). <br />
<br />
If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default user-name and password. In this case, follow [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions] on the CUPS FAQ. You might also want to read [http://bbs.archlinux.org/viewtopic.php?id=35567 this post].<br />
<br />
====Remote access to web interface====<br />
By default, the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the {{ic|/etc/cups/cupsd.conf}} file. Replace the line:<br />
Listen localhost:631<br />
with<br />
port 631<br />
so that CUPS listens to incoming requests.<br />
<br />
Three levels of access can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
<br />
To give remote hosts access to one of these levels, add an {{ic|Allow}} statement to that level's section. An {{ic|Allow}} statement can take one or more of the forms listed below:<br />
Allow all<br />
Allow host.domain.com<br />
Allow *.domain.com<br />
Allow ip-address<br />
Allow ip-address/netmask<br />
<br />
Deny statements can also be used. For example, if wanting to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file {{ic|/etc/cups/cupsd.conf}} would include this:<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
You might also need to add:<br />
<br />
DefaultEncryption Never<br />
<br />
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.<br />
<br />
==Troubleshooting==<br />
The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:<br />
LogLevel debug<br />
<br />
And then viewing the output from {{ic|/var/log/cups/error_log}} like this:<br />
# tail -n 100 -f /var/log/cups/error_log<br />
<br />
The characters at the left of the output stand for:<br />
*D=Debug<br />
*E=Error<br />
*I=Information<br />
*And so on<br />
<br />
These files may also prove useful:<br />
*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful<br />
*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity<br />
<br />
Of course, it is important to know how CUPS works if wanting to solve related issues:<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).<br />
# CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.<br />
<br />
Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.<br />
<br />
===Problems resulting from upgrades===<br />
''Issues that appeared after CUPS and related program packages underwent a version increment''<br />
<br />
====CUPS stops working====<br />
The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" my result from trying to manage CUPS via localhost:631, for example.<br />
<br />
To use the new configuration, copy /etc/cups/cupsd.conf.default to /etc/cups/cupsd.conf (backup the old the configuration if needed):<br />
# cp /etc/cups/cupsd.conf.default /etc/cups/cupsd.conf<br />
and restart CUPS to employ the new settings.<br />
<br />
====Error with gnutls====<br />
If receiving errors such as:<br />
/usr/sbin/cupsd: error while loading shared libraries: libgnutls.so.13: cannot open shared object file: No such file or directory<br />
gnutls may be in need of updating:<br />
# pacman -S gnutls<br />
<br />
After updating, there may be a file named {{ic|cupsd.conf.pacnew}} in {{ic|/etc/cups}}. This is the unmodified original configuration file that has been placed as part of the update. Compare it with the currently installed version and adjust to preference.<br />
<br />
====All jobs are "stopped"====<br />
If all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.<br />
<br />
To check the printer's settings go to ''Printers'', then ''Modify Printer''. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.<br />
<br />
====All jobs are "The printer is not responding"====<br />
On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS. E.g.<br />
If your printer's connection looks like this:<br />
lpd://BRN_020554/BINARY_P1<br />
<br />
then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS<br />
<br />
====The PPD version is not compatible with gutenprint====<br />
Run:<br />
# /usr/sbin/cups-genppdupdate<br />
<br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
===USB printers under CUPS 1.4.x===<br />
New CUPS 1.4.x introduces many changes:<br />
<br />
====Configuration file====<br />
The syntax of the configuration file cupsd.conf changed. Start with a new cupsd.conf file based on /etc/cups/cupsd.conf.default.<br />
<br />
====Blacklisting usblp====<br />
CUPS now uses libusb and printer USB devices (under /dev/bus/usb/) instead of the usblp generated /dev/usb/lpX ones. In order to get USB printers working, the usblp module needs disabling. Some users have also reported that they needed to reinstall their printer.<br />
<br />
{{hc|/etc/modprobe.d/modprobe.conf|blacklist usblp}}<br />
<br />
====Device node permissions====<br />
In addition to usblp not being loaded, CUPS also needs the ownership of the USB device file of the printer to be root:lp, and permissions to be 660. E.g.<br />
$ ls -l /dev/bus/usb/003/002<br />
crw-rw---- 1 root lp 189, 257 20. Okt 10:32 /dev/bus/usb/003/002<br />
<br />
This is supposed to be achieved by two udev rules in /lib/udev/rules.d/50-udev-default.rules:<br />
# hplip and cups 1.4+ use raw USB devices, so permissions should be similar to<br />
# the ones from the old usblp kernel module<br />
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="", IMPORT{program}="usb_id --export %p"<br />
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}==":0701*:", GROUP="lp", MODE="660"<br />
<br />
However, for some devices, in particular combined printer/scanner devices, these rules either do not trigger, or are overwritten by rules of the 'sane' package. In these cases a custom udev rule needs to be added. See below.<br />
<br />
=====Device node permission troubleshooting=====<br />
Get the printer's device file and its permissions with: <br />
$ lsusb<br />
...<br />
Bus 003 Device 002: ID 04b8:0841 Seiko Epson Corp.<br />
$ ls -l /dev/bus/usb/003/002<br />
crw-rw---- 1 root lp 189, 257 20. Okt 10:32 /dev/bus/usb/003/002<br />
<br />
If the permissions are not already root:lp 660, enforce it by creating a custom udev rule, e.g<br />
cat /etc/udev/rules.d/10-usbprinter.rules<br />
ATTR{idVendor}=="04b8", ATTR{idProduct}=="0841", MODE:="0660", GROUP:="lp"<br />
<br />
If you have a multifunction device (printer+scanner) you need to make the device detectable to sane too<br />
cat /etc/udev/rules.d/10-usbprinter.rules<br />
ATTR{idVendor}=="04b8", ATTR{idProduct}=="0841", MODE:="0660", GROUP:="lp", ENV{libsane_matched}:="yes"<br />
<br />
Note that idVendor and idProduct are from the lsusb listing above.<br><br />
Note - some printers will need permissions to be 666<br />
<br />
=====Loading firmware=====<br />
<br />
Some printers and drivers need to load firmware to the printer (such as HP LaserJet 10xx printers using foo2zjs) and do this by writing directly to the lp device, a functionality provided by usblp. A work around until this issue is resolved is to install the usblp module until the firmware is loaded, then remove the module to allow CUPS to work. This can be accomplished by manually running "$ modprobe usblp", waiting for the firmware to load, then "$ rmmod usblp". You can also not blacklist usblp, then put "rmmod usblp" to /etc/rc.local, allowing the firmware to be loaded on boot before rc.local is run, then removing usblp.<br />
<br />
In case the printer is plugged in or powered on while system is already running, /etc/rc.local does not get executed and usblp module stays loaded. A workaround is to modify the /etc/udev/rules.d/11-hpj10xx.rules provided by foo2zjs so that after the add event we wait e.g. 15 seconds for the firmware to load and then automatically remove usblp. The following example is for HP LaserJet 1018. For other models the value of ATTRS{idProduct} should be changed to match the printer model.<br />
<br />
Locate the line matching your printer in /etc/udev/rules.d/11-hpj10xx.rules:<br />
ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \<br />
ATTRS{idProduct}=="4117", RUN+="/sbin/foo2zjs-loadfw 1018 $tempnode"<br />
Add the following lines below it, make sure match the product and vendor IDs:<br />
ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \<br />
ATTRS{idProduct}=="4117", RUN+="/usr/bin/sleep 15"<br />
ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \<br />
ATTRS{idProduct}=="4117", RUN+="/sbin/rmmod usblp"<br />
<br />
===Other===<br />
<br />
=====CUPS permission errors=====<br />
*Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:<br />
smb://workgroup/username:password@hostname/printer_name<br />
<br />
*Sometimes, the block device has wrong permissions:<br />
# ls /dev/usb/<br />
lp0<br />
# chgrp lp /dev/usb/lp0<br />
<br />
====HPLIP printer sends "/usr/lib/cups/backend/hp failed" error====<br />
Make sure dbus is installed and running, e.g. check DAEMONS in {{ic|/etc/rc.conf}} or run {{ic|ls /var/run/daemons}}.<br />
<br />
The avahi-daemon might be required if this error persists and the dbus is already running.<br />
<br />
====hp-toolbox sends an error, "Unable to communicate with device"====<br />
If running hp-toolbox as a regular user results in:<br />
# hp-toolbox<br />
# error: Unable to communicate with device (code=12): hp:/usb/<printer id><br />
or, "{{ic|Unable to communicate with device"}}", then it may be needed to add the user to the lp group by running the following command:<br />
# gpasswd -a <username> lp<br />
<br />
====CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer====<br />
If receiving any of the following error messages in {{ic|/var/log/cups/error_log}} while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':<br />
Filter "foomatic-rip" for printer "<printer_name>" not available: No such file or director<br />
or:<br />
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!<br />
make sure '''hplip''' has been installed, in addition to [[#Packages|the packages mentioned above]], '''net-snmp''' is also needed. See [http://bbs.archlinux.org/viewtopic.php?id=65615 this forum post].<br />
# pacman -S hplip<br />
<br />
====Printing fails with unauthorised error====<br />
If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:<br />
AuthInfoRequired negotiate<br />
<br />
Comment it out and restart CUPS.<br />
<br />
====Print button greyed-out in GNOME print dialogs====<br />
:''<small>Source: [http://bbs.archlinux.org/viewtopic.php?id=70418 I can't print from gnome applications. - Arch Forums]</small>''<br />
<br />
Be sure the package: '''libgnomeprint''' is installed<br />
<br />
Edit {{ic|/etc/cups/cupsd.conf}} and add<br />
# HostNameLookups Double<br />
<br />
Restart CUPS:<br />
# /etc/rc.d/cupsd restart<br />
<br />
====Unknown supported format: application/postscript====<br />
Comment the lines:<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
from {{ic|/etc/cups/mime.convs}}, and:<br />
application/octet-stream<br />
in {{ic|/etc/cups/mime.types}}.<br />
<br />
====Finding URIs for Windows Print Servers====<br />
<br />
Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:<br />
$ smbtree -U ''windowsusername''<br />
This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:<br />
{{bc| WORKGROUP<br />
\\REGULATOR-PC <br />
\\REGULATOR-PC\Z <br />
\\REGULATOR-PC\Public <br />
\\REGULATOR-PC\print$ Printer Drivers<br />
\\REGULATOR-PC\G <br />
\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}<br />
What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:<br />
smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series<br />
as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.<br />
<br />
====Print-Job client-error-document-format-not-supported====<br />
Try installing the foomatic packages and use a foomatic driver.<br />
<br />
====/usr/lib/cups/backend/hp failed====<br />
Change<br />
SystemGroup sys root<br />
to<br />
SystemGroup lp root<br />
in /etc/cups/cupsd.conf<br />
<br />
<br />
====Samsung Printer won't print certain documents====<br />
<br />
Your Samsung printer may work fine with {{{ic|cups}}} refuse to print certain documents (Inkscape file with text) and even crash completely, causing a restart. The solution is to use mentioned the {{{ic|cups-usblp}}} package and to blacklist the {{{ic|usblp}}} module as described in this article. <br />
<br />
==Appendix==<br />
<br />
===Alternative CUPS interfaces===<br />
If using [[GNOME]], a possibility is to manage and configure the printer by using system-config-printer-gnome. This package is available through pacman: <br />
# pacman -S system-config-printer-gnome<br />
<br />
For system-config-printer to work as it should, running as root may be required, or alternatively set up a "normal" user to administer CUPS (if so '''follow steps 1-3''')<br />
<br />
* 1. Create group, and add a user to it<br />
# groupadd lpadmin<br />
# usermod -aG lpadmin <username><br />
<br />
* 2. Add "lpadmin" (without the quotes) to this line in {{ic|/etc/cups/cupsd.conf}}<br />
SystemGroup sys root <insert here><br />
<br />
* 3. Restart cups, log out and in again (or restart computer)<br />
{{bc|# rc.d restart cupsd}}<br />
<br />
[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
There is also [https://aur.archlinux.org/packages.php?ID=43505 gtklp] in the [[AUR]]<br />
<br />
===PDF virtual printer===<br />
CUPS-PDF is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. Obviously this package is not necessary, but it can be quite useful.<br />
<br />
Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit /etc/cups/cups-pdf.conf by changing the line<br />
#Out /var/spool/cups-pdf/${USER}<br />
<br />
to<br />
<br />
Out /home/${USER}<br />
<br />
This package can be installed by the following command:<br />
# pacman -S cups-pdf<br />
<br />
After installing the package, set it up as if it were for any other printer by using the web interface. For the Device, select '''CUPS-PDF (Virtual PDF Printer)'''; Make/Manufacturer, choose '''Generic'''; Model/Driver, select '''Generic postscript color printer''' or '''Generic Cups-PDF Printer'''. Alternatively, provide the PPD file from [http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/cups-pdf-CURRENT/extra/CUPS-PDF.ppd this link].<br />
<br />
==== Print to postscript: CUPS-PDF virtual printer trick ====<br />
<br />
Printing to PDF in most applications like OpenOffice is no problem; just hit the button. Yet when printing out to postscript, matters take a little more work. For applications like OpenOffice where printing to kprinter is nebulous at best, there has to be another way -- and there is. The CUPS-PDF (Virtual PDF Printer) actually creates a postscript file and then creates the PDF using the ps2pdf utility. To print to postscript, what needs to be done is capturing the intermediate postscript file created by CUPS-PDF. This is easily accomplished with by selecting the "print to file" option in the print dialog. (choose either .ps or .eps as the extension) After selecting the "print to file" checkbox simply enter the filename and click "print".<br />
<br />
=====Configuring CUPS-PDF virtual printer=====<br />
#Set up the cups daemon using the instructions on this page.<br />
#Install {{Pkg|cups-pdf}} from [extra].<br />
#Access the cups print manager: http://localhost:631 and select:<br />
Administration -> Add Printer<br />
Select CUPS-PDF (Virtual PDF), choose for the make and driver:<br />
Make: Generic<br />
Driver: Generic CUPS-PDF Printer<br />
<br />
Now to print to postscript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...<br />
<br />
===Another source for printer drivers===<br />
[http://www.turboprint.de/english.html Turboprint] is a proprietary driver for many printers not yet supported by GNU/Linux (Canon i*, for example). Unlike CUPS, however, high quality prints are either marked with a watermark or are a pay-only service.<br />
<br />
==Resources==<br />
* [http://localhost:631/documentation.html Official CUPS documentation], ''locally installed''<br />
* [http://www.cups.org/ Official CUPS Website]<br />
* [http://www.linuxprinting.org/ Linux Printing], ''[http://www.linuxfoundation.org The Linux Foundation]''<br />
* [http://www.gentoo.org/doc/en/printing-howto.xml Gentoo's Printing Guide], ''[http://www.gentoo.org/doc/en Gentoo Documentation Resources]''<br />
* [http://bbs.archlinux.org/ Arch Linux User Forums]</div>Oalhttps://wiki.archlinux.org/index.php?title=CUPS&diff=178511CUPS2012-01-15T18:13:06Z<p>Oal: /* Installing */</p>
<hr />
<div>[[Category:Printers (English)]]<br />
{{i18n|CUPS}}<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing and configuring CUPS}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|CUPS printer sharing}}<br />
{{Article summary wiki|CUPS printer-specific problems}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
<br />
From [http://www.cups.org/index.php CUPS' site]:<br />
:"''[[Wikipedia:CUPS|CUPS]] is the standards-based, open source printing system developed by Apple Inc. for Mac OS® X and other UNIX®-like operating systems''".<br />
<br />
Although there are other printing packages such as LPRNG, the Common Unix Printing System is the most popular choice because of its relative ease of use.<br />
<br />
==Installing==<br />
These packages are needed:<br />
# pacman -S cups ghostscript gsfonts<br />
If regular cups does not work you may try installing {{AUR|cups-usblp}} from the [[AUR]] (Recommended for Samsung USB printers).<br />
<br />
* '''cups''' - The actual CUPS software<br />
* '''ghostscript''' - Interpreter for the Postscript language<br />
* '''gsfonts''' - GhostScript standard Type1 fonts<br />
* '''hpoj''' - If you are using an HP Officejet, you should also install this package and follow the instructions to avoid problems. Read this [http://answers.launchpad.net/hplip/+question/133425 thread at launchpad/hplip] for more information.<br />
<br />
If the system is connected to a networked printer using the [[Samba]] protocol or if the system is to be a print server for Windows clients, also install Samba:<br />
# pacman -S samba<br />
<br />
===Printer driver===<br />
Here are some of the driver packages. Choosing the right driver depends on the printer:<br />
<br />
* '''gutenprint''' - A collection of high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with GhostSscript, CUPS, Foomatic, and the [[GIMP]]<br />
* '''foomatic-db, foomatic-db-engine, foomatic-db-nonfree, and foomatic-filters''' - Foomatic is a database-driven system for integrating free software printer drivers with common spoolers under Unix. Installing foomatic-filters should solve problems if the cups error_log is reporting "stopped with status 22!".<br />
* '''foo2zjs''' - Drivers for ZjStream protocol printers such as the HP Laserjet 1018. More info [http://foo2zjs.rkkda.com here], Foo2zsj is available in the {{AUR|foo2zjs}}.<br />
* '''hplip''' - HP GNU/Linux driver. Provides support for DeskJet, OfficeJet, Photosmart, Business Inkjet and some LaserJet printer models, as well as a number of Brother printers.<br />
* '''splix''' - Samsung drivers for SPL (Samsung Printer Language) printers (for USB printers use with {{AUR|cups-usblp}} from the [[AUR]])<br />
* '''ufr2''' - Canon UFR2 driver with support for LBP, iR and MF series printers. Package is available in the [[AUR]].<br />
* '''cups-pdf''' - A package that allows one to setup a virtual PDF Printer that generates a PDF out of jobs sent to it<br />
<br />
If unsure of what driver package to install or if the current driver is not working, it may be easiest to just install all of drivers, since some of the packages are misleading because printers of other makes may rely on them. For instance, the Brother HL-2140 needs the hplip driver installed.<br />
# pacman -S gutenprint foomatic-db foomatic-db-engine \<br />
foomatic-db-nonfree foomatic-filters \<br />
hplip splix cups-pdf<br />
<br />
====Download printer PPD====<br />
Depending on the printer, this step is optional and may not be needed, as the standard CUPS installation already comes with quite a few PPD (Postscript Printer Description) files. Moreover, the ''foomatic-filters'', ''gimp-print'' and ''hplip'' packages already include quite a few PPD files which will automatically be detected by CUPS.<br />
<br />
Here is an explanation of what a PPD file is from the Linux Printing website:<br />
:"''For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc.''"<br />
<br />
If the PPD for the printer is ''not'' already in CUPS, then:<br />
*check [[AUR]] to see if there are packages for the printer/manufacturer<br />
*visit the [http://www.openprinting.org/printers OpenPrinting database] and select the manufacturer and model of the printer<br />
*visit the manufacturer's site and search for GNU/Linux drivers<br />
<br />
{{Note|PPD files go in {{ic|/usr/share/cups/model/}}}}<br />
<br />
==Configuring==<br />
Now that CUPS is installed, there are a variety of options on how to setup printing solutions. As always, the tried and true command line method is at your disposal. Likewise, various desktop environments such as GNOME and KDE have useful programs that can help manage printers. However, in order to make this process easy for the largest amount of users, this article will focus on the web interface provided by CUPS.<br />
<br />
If you are planning on connecting to a network printer, rather than one that is directly connected to the computer, you might want to read the [[CUPS printer sharing]] page first. Printer sharing between GNU/Linux systems is quite easy and involves very little configuration, whereas sharing between a Windows and GNU/Linux host requires a little bit more effort.<br />
<br />
===Kernel modules===<br />
Before using the CUPS web interface, the appropriate kernel modules need to be installed. The following steps are from the Gentoo Printing Guide.<br />
<br />
This section may not be necessary, however, depending on which kernel is being used. The kernel module may load automatically after plugging in the printer. Use the {{ic|tail}} command (described below) to see if the printer has already been detected. The {{ic|lsmod}} utility can also be used to see what modules have been loaded.<br />
<br />
====USB printers====<br />
USB printer users may need to blacklist the {{ic|usblp}} module. Keep in mind that there seems to be a lot of [http://bbs.archlinux.org/viewtopic.php?pid=660601 uncertainty] regarding blacklisting {{ic|usblp}}, as some USB printers, including some Canon and Epson printer series, are not recognized without it. Several user reported issues with Samsung printers when using {{ic|cups}} with blacklisted {{ic|usblp}} module, the solution was to re-enable {{ic|usblp}} and install {{ic|cups-usblp}} from aur instead of regular {{ic|cups}} package (https://bbs.archlinux.org/viewtopic.php?pid=778104)<br />
<br />
To blacklist the module:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|blacklist usblp}}<br />
<br />
Custom kernel users may need to manually load the {{ic|usbcore}} module before proceeding:<br />
# modprobe usbcore<br />
<br />
Once the modules are installed, plug in the printer and check if the kernel detected it by running the following:<br />
# tail /var/log/messages.log<br />
or<br />
# dmesg<br />
<br />
If you're using {{ic|usblp}}, the output should indicate that the printer has been detected like so:<br />
Feb 19 20:17:11 kernel: printer.c: usblp0: USB Bidirectional<br />
printer dev 2 if 0 alt 0 proto 2 vid 0x04E8 pid 0x300E<br />
Feb 19 20:17:11 kernel: usb.c: usblp driver claimed interface cfef3920<br />
Feb 19 20:17:11 kernel: printer.c: v0.13: USB Printer Device Class driver<br />
<br />
If you blacklisted {{ic|usblp}}, you will see something like:<br />
usb 3-2: new full speed USB device using uhci_hcd and address 3<br />
usb 3-2: configuration #1 chosen from 1 choice<br />
<br />
====Parallel port printers====<br />
To use a parallel port printer the configuration is pretty much the same, except for the modules:<br />
# modprobe lp<br />
# modprobe parport<br />
# modprobe parport_pc<br />
<br />
Once again, check the setup by running:<br />
# tail /var/log/messages.log<br />
It should display something like this:<br />
lp0: using parport0 (polling).<br />
<br />
If you are using a USB to parallel port adapter, CUPS will not be able to detect the printer. As a workaround, add the printer using a different connection type and then change DeviceID in /etc/cups/printers.conf:<br />
DeviceID = parallel:/dev/usb/lp0<br />
<br />
====Auto-loading====<br />
It is convenient to have the system automatically load the kernel module every time the it starts up. To do so, use a text editor to open up {{ic|/etc/[[rc.conf]]}} and add the appropriate module to the {{ic|1=MODULES=()}} line. Here is an example:<br />
MODULES=(!usbserial scsi_mod sd_mod snd-ymfpci snd-pcm-oss '''lp parport parport_pc''' ide-scsi)<br />
<br />
===CUPS daemon===<br />
With the kernel modules installed, the you can now start the [[Daemon#Performing daemon actions manually|start the cupsd daemon]]. Add cupsd to your [[daemons#Starting on Boot|DAEMONS array]] so it starts automatically on boot.<br />
<br />
=== Web interface and tool-kit ===<br />
<br />
Once the daemon is running, open a browser and go to: http://localhost:631 (''The '''localhost''' string may need to be replaced with the hostname found in'' {{ic|/etc/hosts}}).<br />
<br />
From here, follow the various wizards to add the printer. A usual procedure is to start by clicking on ''Adding Printers and Classes'' and then ''Add Printer''. When prompted for a user-name and password, log in as root. The name assigned to the printer does not matter, the same applies for 'location' and 'description'. Next, a list of devices to select from will be presented. The actual name of the printer shows up next to the label ( e.g., next to ''USB Printer #1'' for USB printers). Finally, choose the appropriate drivers and the configuration is complete.<br />
<br />
Now test the configuration by pressing the ''Maintenance'' drop-down menu then ''Print Test Page''. If it does not print and there is certainty regarding the correctness of applied settings, then the problem is most likely due to missing a proper printer driver.<br />
<br />
{{Tip|See: [[#Alternative CUPS interfaces]] for other other frontends.}}<br />
{{Note|When setting up a USB printer, you should see your printer listed on ''Add Printer'' page. If you can only see a "SCSI printer" option, it probably means that CUPS has failed to recognize your printer.}}<br />
<br />
==== CUPS administration ====<br />
<br />
A user-name and password will be required when administering the printer in the web interface, such as: adding or removing printers, stopping print tasks, etc. The default user-name is the one assigned in the ''sys'' group, or root (change this by editing {{ic|/etc/cups/cupsd.conf}} in the line of ''SystemGroup''). <br />
<br />
If the root account has been locked (i.e. when using sudo), it is not possible to log in the CUPS administration interface with the default user-name and password. In this case, follow [http://www.cups.org/articles.php?L237+T+Qprintadmin these instructions] on the CUPS FAQ. You might also want to read [http://bbs.archlinux.org/viewtopic.php?id=35567 this post].<br />
<br />
====Remote access to web interface====<br />
By default, the CUPS web interface can only be accessed by the ''localhost''; i.e. the computer that it is installed on. To remotely access the interface, make the following changes to the {{ic|/etc/cups/cupsd.conf}} file. Replace the line:<br />
Listen localhost:631<br />
with<br />
port 631<br />
so that CUPS listens to incoming requests.<br />
<br />
Three levels of access can be granted:<br />
<Location /> #access to the server<br />
<Location /admin> #access to the admin pages<br />
<Location /admin/conf> #access to configuration files<br />
<br />
To give remote hosts access to one of these levels, add an {{ic|Allow}} statement to that level's section. An {{ic|Allow}} statement can take one or more of the forms listed below:<br />
Allow all<br />
Allow host.domain.com<br />
Allow *.domain.com<br />
Allow ip-address<br />
Allow ip-address/netmask<br />
<br />
Deny statements can also be used. For example, if wanting to give all hosts on the 192.168.1.0/255.255.255.0 subnet full access, file {{ic|/etc/cups/cupsd.conf}} would include this:<br />
# Restrict access to the server...<br />
# By default only localhost connections are possible<br />
<Location /><br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to the admin pages...<br />
<Location /admin><br />
# Encryption disabled by default<br />
#Encryption Required<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
# Restrict access to configuration files...<br />
<Location /admin/conf><br />
AuthType Basic<br />
Require user @SYSTEM<br />
Order allow,deny<br />
Allow From localhost<br />
'''Allow From 192.168.1.0/255.255.255.0'''<br />
</Location><br />
<br />
You might also need to add:<br />
<br />
DefaultEncryption Never<br />
<br />
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.<br />
<br />
==Troubleshooting==<br />
The best way to get printing working is to set 'LogLevel' in {{ic|/etc/cups/cupsd.conf}} to:<br />
LogLevel debug<br />
<br />
And then viewing the output from {{ic|/var/log/cups/error_log}} like this:<br />
# tail -n 100 -f /var/log/cups/error_log<br />
<br />
The characters at the left of the output stand for:<br />
*D=Debug<br />
*E=Error<br />
*I=Information<br />
*And so on<br />
<br />
These files may also prove useful:<br />
*{{ic|/var/log/cups/page_log}} - Echoes a new entry each time a print is successful<br />
*{{ic|/var/log/cups/access_log}} - Lists all cupsd http1.1 server activity<br />
<br />
Of course, it is important to know how CUPS works if wanting to solve related issues:<br />
# An application sends a .ps file (PostScript, a script language that details how the page will look) to CUPS when 'print' has been selected (this is the case with most programs).<br />
# CUPS then looks at the printer's PPD file (printer description file) and figures out what filters it needs to use to convert the .ps file to a language that the printer understands (like PJL, PCL), usually GhostScript.<br />
# GhostScript takes the input and figures out which filters it should use, then applies them and converts the .ps file to a format understood by the printer.<br />
# Then it is sent to the back-end. For example, if the printer is connected to a USB port, it uses the USB back-end.<br />
<br />
Print a document and watch {{ic|error_log}} to get a more detailed and correct image of the printing process.<br />
<br />
===Problems resulting from upgrades===<br />
''Issues that appeared after CUPS and related program packages underwent a version increment''<br />
<br />
====CUPS stops working====<br />
The chances are that a new configuration file is needed for the new version to work properly. Messages such as "404 - page not found" my result from trying to manage CUPS via localhost:631, for example.<br />
<br />
To use the new configuration, copy /etc/cups/cupsd.conf.default to /etc/cups/cupsd.conf (backup the old the configuration if needed):<br />
# cp /etc/cups/cupsd.conf.default /etc/cups/cupsd.conf<br />
and restart CUPS to employ the new settings.<br />
<br />
====Error with gnutls====<br />
If receiving errors such as:<br />
/usr/sbin/cupsd: error while loading shared libraries: libgnutls.so.13: cannot open shared object file: No such file or directory<br />
gnutls may be in need of updating:<br />
# pacman -S gnutls<br />
<br />
After updating, there may be a file named {{ic|cupsd.conf.pacnew}} in {{ic|/etc/cups}}. This is the unmodified original configuration file that has been placed as part of the update. Compare it with the currently installed version and adjust to preference.<br />
<br />
====All jobs are "stopped"====<br />
If all jobs sent to the printer become "stopped", delete the printer and add it again.<br />
Using the [http://localhost:631 CUPS web interface], go to Printers > Delete Printer.<br />
<br />
To check the printer's settings go to ''Printers'', then ''Modify Printer''. Copy down the information displayed, click 'Modify Printer' to proceed to the next page(s), and so on.<br />
<br />
====All jobs are "The printer is not responding"====<br />
On networked printers, you should check that the name that CUPS uses as its connection URI resolves to the printer's IP via DNS. E.g.<br />
If your printer's connection looks like this:<br />
lpd://BRN_020554/BINARY_P1<br />
<br />
then the hostname 'BRN_020554' needs to resolve to the printer's IP from the server running CUPS<br />
<br />
====The PPD version is not compatible with gutenprint====<br />
Run:<br />
# /usr/sbin/cups-genppdupdate<br />
<br />
And restart CUPS (as pointed out in gutenprint's post-install message)<br />
<br />
===USB printers under CUPS 1.4.x===<br />
New CUPS 1.4.x introduces many changes:<br />
<br />
====Configuration file====<br />
The syntax of the configuration file cupsd.conf changed. Start with a new cupsd.conf file based on /etc/cups/cupsd.conf.default.<br />
<br />
====Blacklisting usblp====<br />
CUPS now uses libusb and printer USB devices (under /dev/bus/usb/) instead of the usblp generated /dev/usb/lpX ones. In order to get USB printers working, the usblp module needs disabling. Some users have also reported that they needed to reinstall their printer.<br />
<br />
{{hc|/etc/modprobe.d/modprobe.conf|blacklist usblp}}<br />
<br />
====Device node permissions====<br />
In addition to usblp not being loaded, CUPS also needs the ownership of the USB device file of the printer to be root:lp, and permissions to be 660. E.g.<br />
$ ls -l /dev/bus/usb/003/002<br />
crw-rw---- 1 root lp 189, 257 20. Okt 10:32 /dev/bus/usb/003/002<br />
<br />
This is supposed to be achieved by two udev rules in /lib/udev/rules.d/50-udev-default.rules:<br />
# hplip and cups 1.4+ use raw USB devices, so permissions should be similar to<br />
# the ones from the old usblp kernel module<br />
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="", IMPORT{program}="usb_id --export %p"<br />
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}==":0701*:", GROUP="lp", MODE="660"<br />
<br />
However, for some devices, in particular combined printer/scanner devices, these rules either do not trigger, or are overwritten by rules of the 'sane' package. In these cases a custom udev rule needs to be added. See below.<br />
<br />
=====Device node permission troubleshooting=====<br />
Get the printer's device file and its permissions with: <br />
$ lsusb<br />
...<br />
Bus 003 Device 002: ID 04b8:0841 Seiko Epson Corp.<br />
$ ls -l /dev/bus/usb/003/002<br />
crw-rw---- 1 root lp 189, 257 20. Okt 10:32 /dev/bus/usb/003/002<br />
<br />
If the permissions are not already root:lp 660, enforce it by creating a custom udev rule, e.g<br />
cat /etc/udev/rules.d/10-usbprinter.rules<br />
ATTR{idVendor}=="04b8", ATTR{idProduct}=="0841", MODE:="0660", GROUP:="lp"<br />
<br />
If you have a multifunction device (printer+scanner) you need to make the device detectable to sane too<br />
cat /etc/udev/rules.d/10-usbprinter.rules<br />
ATTR{idVendor}=="04b8", ATTR{idProduct}=="0841", MODE:="0660", GROUP:="lp", ENV{libsane_matched}:="yes"<br />
<br />
Note that idVendor and idProduct are from the lsusb listing above.<br><br />
Note - some printers will need permissions to be 666<br />
<br />
=====Loading firmware=====<br />
<br />
Some printers and drivers need to load firmware to the printer (such as HP LaserJet 10xx printers using foo2zjs) and do this by writing directly to the lp device, a functionality provided by usblp. A work around until this issue is resolved is to install the usblp module until the firmware is loaded, then remove the module to allow CUPS to work. This can be accomplished by manually running "$ modprobe usblp", waiting for the firmware to load, then "$ rmmod usblp". You can also not blacklist usblp, then put "rmmod usblp" to /etc/rc.local, allowing the firmware to be loaded on boot before rc.local is run, then removing usblp.<br />
<br />
In case the printer is plugged in or powered on while system is already running, /etc/rc.local does not get executed and usblp module stays loaded. A workaround is to modify the /etc/udev/rules.d/11-hpj10xx.rules provided by foo2zjs so that after the add event we wait e.g. 15 seconds for the firmware to load and then automatically remove usblp. The following example is for HP LaserJet 1018. For other models the value of ATTRS{idProduct} should be changed to match the printer model.<br />
<br />
Locate the line matching your printer in /etc/udev/rules.d/11-hpj10xx.rules:<br />
ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \<br />
ATTRS{idProduct}=="4117", RUN+="/sbin/foo2zjs-loadfw 1018 $tempnode"<br />
Add the following lines below it, make sure match the product and vendor IDs:<br />
ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \<br />
ATTRS{idProduct}=="4117", RUN+="/usr/bin/sleep 15"<br />
ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \<br />
ATTRS{idProduct}=="4117", RUN+="/sbin/rmmod usblp"<br />
<br />
===Other===<br />
<br />
=====CUPS permission errors=====<br />
*Some users fixed 'NT_STATUS_ACCESS_DENIED' (Windows clients) errors by using a slightly different syntax:<br />
smb://workgroup/username:password@hostname/printer_name<br />
<br />
*Sometimes, the block device has wrong permissions:<br />
# ls /dev/usb/<br />
lp0<br />
# chgrp lp /dev/usb/lp0<br />
<br />
====HPLIP printer sends "/usr/lib/cups/backend/hp failed" error====<br />
Make sure dbus is installed and running, e.g. check DAEMONS in {{ic|/etc/rc.conf}} or run {{ic|ls /var/run/daemons}}.<br />
<br />
The avahi-daemon might be required if this error persists and the dbus is already running.<br />
<br />
====hp-toolbox sends an error, "Unable to communicate with device"====<br />
If running hp-toolbox as a regular user results in:<br />
# hp-toolbox<br />
# error: Unable to communicate with device (code=12): hp:/usb/<printer id><br />
or, "{{ic|Unable to communicate with device"}}", then it may be needed to add the user to the lp group by running the following command:<br />
# gpasswd -a <username> lp<br />
<br />
====CUPS returns '"foomatic-rip" not available/stopped with status 3' with a HP printer====<br />
If receiving any of the following error messages in {{ic|/var/log/cups/error_log}} while using a HP printer, with jobs appearing to be processed while they all end up not being completed with their status set to 'stopped':<br />
Filter "foomatic-rip" for printer "<printer_name>" not available: No such file or director<br />
or:<br />
PID 5771 (/usr/lib/cups/filter/foomatic-rip) stopped with status 3!<br />
make sure '''hplip''' has been installed, in addition to [[#Packages|the packages mentioned above]], '''net-snmp''' is also needed. See [http://bbs.archlinux.org/viewtopic.php?id=65615 this forum post].<br />
# pacman -S hplip<br />
<br />
====Printing fails with unauthorised error====<br />
If the user has been added to the lp group, and allowed to print (set in {{ic|cupsd.conf}}), then the problem lies in {{ic|/etc/cups/printers.conf}}. This line could be the culprit:<br />
AuthInfoRequired negotiate<br />
<br />
Comment it out and restart CUPS.<br />
<br />
====Print button greyed-out in GNOME print dialogs====<br />
:''<small>Source: [http://bbs.archlinux.org/viewtopic.php?id=70418 I can't print from gnome applications. - Arch Forums]</small>''<br />
<br />
Be sure the package: '''libgnomeprint''' is installed<br />
<br />
Edit {{ic|/etc/cups/cupsd.conf}} and add<br />
# HostNameLookups Double<br />
<br />
Restart CUPS:<br />
# /etc/rc.d/cupsd restart<br />
<br />
====Unknown supported format: application/postscript====<br />
Comment the lines:<br />
application/octet-stream application/vnd.cups-raw 0 -<br />
from {{ic|/etc/cups/mime.convs}}, and:<br />
application/octet-stream<br />
in {{ic|/etc/cups/mime.types}}.<br />
<br />
====Finding URIs for Windows Print Servers====<br />
<br />
Sometimes Windows is a little less than forthcoming about exact device URIs (device locations). If having trouble specifying the correct device location in CUPS, run the following command to list all shares available to a certain windows username:<br />
$ smbtree -U ''windowsusername''<br />
This will list every share available to a certain Windows username on the local area network subnet, as long as Samba is set up and running properly. It should return something like this:<br />
{{bc| WORKGROUP<br />
\\REGULATOR-PC <br />
\\REGULATOR-PC\Z <br />
\\REGULATOR-PC\Public <br />
\\REGULATOR-PC\print$ Printer Drivers<br />
\\REGULATOR-PC\G <br />
\\REGULATOR-PC\EPSON Stylus CX8400 Series EPSON Stylus CX8400 Series}}<br />
What is needed here is first part of the last line, the resource matching the printer description. So to print to the EPSON Stylus printer, one would enter:<br />
smb://username.password@REGULATOR-PC/EPSON Stylus CX8400 Series<br />
as the URI into CUPS. Notice that whitespaces are allowed in URIs, whereas backslashes get replaced with forward slashes.<br />
<br />
====Print-Job client-error-document-format-not-supported====<br />
Try installing the foomatic packages and use a foomatic driver.<br />
<br />
====/usr/lib/cups/backend/hp failed====<br />
Change<br />
SystemGroup sys root<br />
to<br />
SystemGroup lp root<br />
in /etc/cups/cupsd.conf<br />
<br />
==Appendix==<br />
<br />
===Alternative CUPS interfaces===<br />
If using [[GNOME]], a possibility is to manage and configure the printer by using system-config-printer-gnome. This package is available through pacman: <br />
# pacman -S system-config-printer-gnome<br />
<br />
For system-config-printer to work as it should, running as root may be required, or alternatively set up a "normal" user to administer CUPS (if so '''follow steps 1-3''')<br />
<br />
* 1. Create group, and add a user to it<br />
# groupadd lpadmin<br />
# usermod -aG lpadmin <username><br />
<br />
* 2. Add "lpadmin" (without the quotes) to this line in {{ic|/etc/cups/cupsd.conf}}<br />
SystemGroup sys root <insert here><br />
<br />
* 3. Restart cups, log out and in again (or restart computer)<br />
{{bc|# rc.d restart cupsd}}<br />
<br />
[[KDE]] users can modify their printers from the Control Center. Both should refer to those desktop environments' documentation for more information on how to use the interfaces.<br />
<br />
There is also [https://aur.archlinux.org/packages.php?ID=43505 gtklp] in the [[AUR]]<br />
<br />
===PDF virtual printer===<br />
CUPS-PDF is a nice package that allows one to setup a virtual printer that will generate a PDF from anything sent to it. Obviously this package is not necessary, but it can be quite useful.<br />
<br />
Find generated PDF documents in a sub-directory located at {{ic|/var/spool/cups-pdf}}. Normally, the subdirectory is named after the user who performed the job. A little tweak helps you to find your printed PDF documents more easily. Edit /etc/cups/cups-pdf.conf by changing the line<br />
#Out /var/spool/cups-pdf/${USER}<br />
<br />
to<br />
<br />
Out /home/${USER}<br />
<br />
This package can be installed by the following command:<br />
# pacman -S cups-pdf<br />
<br />
After installing the package, set it up as if it were for any other printer by using the web interface. For the Device, select '''CUPS-PDF (Virtual PDF Printer)'''; Make/Manufacturer, choose '''Generic'''; Model/Driver, select '''Generic postscript color printer''' or '''Generic Cups-PDF Printer'''. Alternatively, provide the PPD file from [http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/cups-pdf-CURRENT/extra/CUPS-PDF.ppd this link].<br />
<br />
==== Print to postscript: CUPS-PDF virtual printer trick ====<br />
<br />
Printing to PDF in most applications like OpenOffice is no problem; just hit the button. Yet when printing out to postscript, matters take a little more work. For applications like OpenOffice where printing to kprinter is nebulous at best, there has to be another way -- and there is. The CUPS-PDF (Virtual PDF Printer) actually creates a postscript file and then creates the PDF using the ps2pdf utility. To print to postscript, what needs to be done is capturing the intermediate postscript file created by CUPS-PDF. This is easily accomplished with by selecting the "print to file" option in the print dialog. (choose either .ps or .eps as the extension) After selecting the "print to file" checkbox simply enter the filename and click "print".<br />
<br />
=====Configuring CUPS-PDF virtual printer=====<br />
#Set up the cups daemon using the instructions on this page.<br />
#Install {{Pkg|cups-pdf}} from [extra].<br />
#Access the cups print manager: http://localhost:631 and select:<br />
Administration -> Add Printer<br />
Select CUPS-PDF (Virtual PDF), choose for the make and driver:<br />
Make: Generic<br />
Driver: Generic CUPS-PDF Printer<br />
<br />
Now to print to postscript, just print as usual, in the print dialog choose "CUPS-PDF" as the printer, then select the checkbox for "print to file", hit print, enter the filename.ps and click save. This is handy for faxes, etc...<br />
<br />
===Another source for printer drivers===<br />
[http://www.turboprint.de/english.html Turboprint] is a proprietary driver for many printers not yet supported by GNU/Linux (Canon i*, for example). Unlike CUPS, however, high quality prints are either marked with a watermark or are a pay-only service.<br />
<br />
==Resources==<br />
* [http://localhost:631/documentation.html Official CUPS documentation], ''locally installed''<br />
* [http://www.cups.org/ Official CUPS Website]<br />
* [http://www.linuxprinting.org/ Linux Printing], ''[http://www.linuxfoundation.org The Linux Foundation]''<br />
* [http://www.gentoo.org/doc/en/printing-howto.xml Gentoo's Printing Guide], ''[http://www.gentoo.org/doc/en Gentoo Documentation Resources]''<br />
* [http://bbs.archlinux.org/ Arch Linux User Forums]</div>Oalhttps://wiki.archlinux.org/index.php?title=Talk:PKGBUILD&diff=149991Talk:PKGBUILD2011-07-26T19:41:58Z<p>Oal: /* check / checkdepends */</p>
<hr />
<div>This needs to be updated for split packages. [[User:Daenyth|Daenyth]] 22:55, 4 December 2009 (EST)<br />
<br />
== Variables/noextract about zip? ==<br />
<br />
Isn't this information outdated? It seems bsdtar can now perfectly handle zip-files.<br />
<br />
--[[User:Paolo|Paolo]] 11:03, 8 September 2010 (EDT)<br />
<br />
== Installing the package ==<br />
<br />
It might be helpful for beginners to know how to install the package after building it. <br />
Maybe it should be explicity mentioned that one can install it with '''sudo pacman -U yourpackage.pkg.tar.??'''<br />
<br />
where ?? can be xz, gz or something else.<br />
<br />
[[User:Slopjong|Slopjong]] 12:00, June 9th 2010 (CET)<br />
::1. It's a package - you install it as any other package. The introduction clearly states that ''The resulting package contains binary files and installation instructions; readily installed with pacman.'' and a link to the pacman article.<br />
::2. pacman can install uncompressed <tt>.pkg.tar</tt> archives too.<br />
::3. 'makepkg -i' will install the compiled package.<br />
::-- [[User:Karol|Karol]] 06:52, 9 June 2011 (EDT)<br />
<br />
== External links ==<br />
<br />
One of the two links is redundant, is the same mentioned here<br />
Tip: A prototype .install is provided at /usr/share/pacman/proto.install.<br />
the second one should be added to proto installed by pacman package.<br />
<br />
== check / checkdepends ==<br />
<br />
the default ''PKGBUILD'' in ''/usr/share/pacman'' now contains a ''check'' function and a ''checkdepends'' array. Some explanation would be nice.<br />
--[[User:Oal|Oal]] 15:41, 26 July 2011 (EDT)</div>Oalhttps://wiki.archlinux.org/index.php?title=Talk:PKGBUILD&diff=149990Talk:PKGBUILD2011-07-26T19:41:51Z<p>Oal: /* check / checkdepends */</p>
<hr />
<div>This needs to be updated for split packages. [[User:Daenyth|Daenyth]] 22:55, 4 December 2009 (EST)<br />
<br />
== Variables/noextract about zip? ==<br />
<br />
Isn't this information outdated? It seems bsdtar can now perfectly handle zip-files.<br />
<br />
--[[User:Paolo|Paolo]] 11:03, 8 September 2010 (EDT)<br />
<br />
== Installing the package ==<br />
<br />
It might be helpful for beginners to know how to install the package after building it. <br />
Maybe it should be explicity mentioned that one can install it with '''sudo pacman -U yourpackage.pkg.tar.??'''<br />
<br />
where ?? can be xz, gz or something else.<br />
<br />
[[User:Slopjong|Slopjong]] 12:00, June 9th 2010 (CET)<br />
::1. It's a package - you install it as any other package. The introduction clearly states that ''The resulting package contains binary files and installation instructions; readily installed with pacman.'' and a link to the pacman article.<br />
::2. pacman can install uncompressed <tt>.pkg.tar</tt> archives too.<br />
::3. 'makepkg -i' will install the compiled package.<br />
::-- [[User:Karol|Karol]] 06:52, 9 June 2011 (EDT)<br />
<br />
== External links ==<br />
<br />
One of the two links is redundant, is the same mentioned here<br />
Tip: A prototype .install is provided at /usr/share/pacman/proto.install.<br />
the second one should be added to proto installed by pacman package.<br />
<br />
== check / checkdepends ==<br />
<br />
the default ''PKGBUILD'' in ''/usr/share/pacman'' now contains a ''check'' function and a ''checkdepends'' array. Some explanation would be nice.</div>Oalhttps://wiki.archlinux.org/index.php?title=Talk:PKGBUILD&diff=149989Talk:PKGBUILD2011-07-26T19:40:42Z<p>Oal: /* check / checkdepends */ new section</p>
<hr />
<div>This needs to be updated for split packages. [[User:Daenyth|Daenyth]] 22:55, 4 December 2009 (EST)<br />
<br />
== Variables/noextract about zip? ==<br />
<br />
Isn't this information outdated? It seems bsdtar can now perfectly handle zip-files.<br />
<br />
--[[User:Paolo|Paolo]] 11:03, 8 September 2010 (EDT)<br />
<br />
== Installing the package ==<br />
<br />
It might be helpful for beginners to know how to install the package after building it. <br />
Maybe it should be explicity mentioned that one can install it with '''sudo pacman -U yourpackage.pkg.tar.??'''<br />
<br />
where ?? can be xz, gz or something else.<br />
<br />
[[User:Slopjong|Slopjong]] 12:00, June 9th 2010 (CET)<br />
::1. It's a package - you install it as any other package. The introduction clearly states that ''The resulting package contains binary files and installation instructions; readily installed with pacman.'' and a link to the pacman article.<br />
::2. pacman can install uncompressed <tt>.pkg.tar</tt> archives too.<br />
::3. 'makepkg -i' will install the compiled package.<br />
::-- [[User:Karol|Karol]] 06:52, 9 June 2011 (EDT)<br />
<br />
== External links ==<br />
<br />
One of the two links is redundant, is the same mentioned here<br />
Tip: A prototype .install is provided at /usr/share/pacman/proto.install.<br />
the second one should be added to proto installed by pacman package.<br />
<br />
== check / checkdepends ==<br />
<br />
the default PKGBUILD in {{{ /usr/share/pacman }}} now contains a {{{check}}} function and a {{{checkdepends}}} array. Some explanation would be nice.</div>Oalhttps://wiki.archlinux.org/index.php?title=Talk:Kernel_Compilation_without_ABS_for_New_Users&diff=148755Talk:Kernel Compilation without ABS for New Users2011-07-10T11:23:38Z<p>Oal: /* linux_kernel.sh */ new section</p>
<hr />
<div>== linux_kernel.sh ==<br />
<br />
I fail to see the usefulness of the ''linux_kernel.sh'' script. It does nothing a PKGBUILD doesn't do better and it installs the kernel without integration into pacman. I suggest we get rid of it.</div>Oalhttps://wiki.archlinux.org/index.php?title=Gitweb&diff=148671Gitweb2011-07-09T14:22:40Z<p>Oal: /* Gitweb config */</p>
<hr />
<div>Gitweb is the default web interface provided with [[git]] itself and is the basis for other git scripts like cgit, gitosis and others.<br />
=Installation=<br />
To install gitweb you first have to install git and a webserver. For this example we use apache but you can also use others:<br />
pacman -S git apache<br />
<br />
Next you need to link the current gitweb default to your webserver location. In this example i use the default folder locations:<br />
ln -s /usr/share/gitweb /srv/http/gitweb<br />
<br />
That's it for the "installation". Next is the configuration.<br />
<br />
=Configuration=<br />
==Apache==<br />
Add the following to the end of you /etc/httpd/conf/httpd.conf<br />
<Directory "/srv/http/gitweb"><br />
DirectoryIndex gitweb.cgi<br />
Allow from all<br />
AllowOverride all<br />
Order allow,deny<br />
Options ExecCGI<br />
<Files gitweb.cgi><br />
SetHandler cgi-script<br />
</Files><br />
SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf<br />
</Directory><br />
<br />
You can put the configuration in it's own config file in /etc/httpd/conf/extra/ but that's up to you to decide.<br />
<br />
==Lighttpd==<br />
If you're using lighttpd, make sure mod_alias, mod_redirect, mod_cgi and mod_setenv are loaded. Add the following to /etc/lighttpd/lighttpd.conf:<br />
setenv.add-environment = ( "GITWEB_CONFIG" => "/etc/conf.d/gitweb.conf" )<br />
url.redirect += ( "^/gitweb$" => "/gitweb/" )<br />
alias.url += ( "/gitweb/" => "/usr/share/gitweb/" )<br />
$HTTP["url"] =~ "^/gitweb/" {<br />
cgi.assign = (".cgi" => "")<br />
server.indexfiles = ("gitweb.cgi")<br />
}<br />
<br />
==Gitweb config==<br />
Next we need to make a gitweb config file. Open (or create if not existing) the file /etc/conf.d/gitweb.conf and place this in it:<br />
<pre><br />
$git_temp = "/tmp";<br />
<br />
# The directories where your projects are. Must not end with a slash.<br />
$projectroot = "/path/to/your/repositories"; <br />
<br />
# Base URLs for links displayed in the web interface.<br />
our @git_base_url_list = qw(git://<your_server> http://git@<your_server>); <br />
</pre><br />
<br />
Now the the configuration is done, please restart your webserver.<br />
For apache:<br />
/etc/rc.d/httpd restart<br />
<br />
Or for lighttpd:<br />
/etc/rc.d/lighttpd restart<br />
<br />
=Adding repositories=<br />
To add a repository go to your repository folder. There make your repository like so:<br />
mkdir my_repository.git<br />
git init --bare my_repository.git/<br />
cd my_repository.git/<br />
touch git-daemon-export-ok<br />
echo "Short project's description" > description<br />
<br />
Next open the "config" file and add this:<br />
[gitweb]<br />
owner = Your Name<br />
<br />
This will fill in the "Owner" field in gitweb. It's not required.<br />
<br />
I assumed that you want to have this repository as "central" repository storage where you push your commits to so the git-daemon-export-ok and --bare are here to have minimal overhead and to allow the git daemon to be used on it.<br />
<br />
That is all for making a repository. You can now see it on your http://localhost/gitweb (assuming everything went fine). You don't need to restart apache for new repositories since the gitweb cgi script simply reads your repository folder.<br />
<br />
=Git daemon=<br />
{{Merge|Git}}<br />
{{Note|Merge note. This section should belong in [[Git]] and this article should link to that page.}}<br />
{{Note|The git daemon only allows read access. For write access look at "Git SSH".}}<br />
This will allow url's like "git clone git://localhost/my_repository.git".<br />
<br />
Edit configuration file for git-dameon /etc/conf.d/git-daemon.conf (GIT_REPO is a place with your git projects), then start git-daemon with root privileges:<br />
/etc/rc.d/git-daemon start<br />
<br />
To run the git-daemon every time at boot, just append git-deamon to DAEMONS line in /etc/rc.conf file.<br />
<br />
Clients can now simply use:<br />
git clone git://localhost/my_repository.git<br />
<br />
=Git SSH=<br />
{{Merge|Git}}<br />
{{Note|Merge note. This section should belong in [[Git]] and this article should link to that page.}}<br />
You first need to have a public SSH key. For that follow the guide at [[Using SSH Keys]]. To setup SSH itself you need to follow the [[SSH]] guide. I assume you have a public SSH key now and your SSH is working.<br />
Open your SSH key in your favorite editor (default public key name is id_rsa.pub and is located in ~/.ssh) and copy it's content (CTRL + C).<br />
Now go to your user where you have made your git repository, since we now need to allow that SSH key to login on that user to access the GIT repository.<br />
Open this file in your favorite editor (i use nano)<br />
nano ~/.ssh/authorized_keys<br />
and paste the contents of id_rsa.pub in it. Be sure it is all on one line! That is important! It should look somewhat like this:<br />
{{Warning|Do not copy the line below! It is an example! It will not work if you use that line!}}<br />
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCboOH6AotCh4OcwJgsB4AtXzDo9Gzhl+BAHuEvnDRHNSYIURqGN4CrP+b5Bx/iLrRFOBv58TcZz1jyJ2PaGwT74kvVOe9JCCdgw4nSMBV44cy+6cTJiv6f1tw8pHRS2H6nHC9SCSAWkMX4rpiSQ0wkhjug+GtBWOXDaotIzrFwLw== username@hostname<br />
Now you can checkout your git repo this way (change where needed. Here it's using the git username and localhost):<br />
git clone git@localhost:my_repository.git<br />
You should now get an SSH yes/no question. Type yes followed by enter. Then you should have your repository checked out. Since this is with SSH you also do have commit rights now. For that look at [[Git]] and [[Super Quick Git Guide]].<br />
<br />
=Git HTTP=<br />
{{Merge|Git}}<br />
{{Note|Merge note. This section should belong in [[Git]] and this article should link to that page.}}<br />
This section will explain how to do a git clone over http. For now this is only reading (cloning), not writing (pushing).<br />
First you need to make your Git repositories accessable over your web server. So lets assume your git repositories are outside of the default apache documentroot. You can skip this part if they are within your apache documentroot.<br />
<br />
==Read access==<br />
Lets assume your git repositories are in /usr/git. You need to add an Alias to apache and a Directory section to make it accessable.<br />
Append the following to your /etc/httpd/conf/httpd/conf (change where your paths differ. the /git-repos is how it will be accessible in your browser like : http://localhost/git-repos):<br />
Alias /git-repos /usr/git<br />
<Directory "/usr/git"><br />
Options Indexes FollowSymLinks MultiViews ExecCGI<br />
AllowOverride All<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
<br />
Save it and restart apache:<br />
/etc/rc.d/httpd restart<br />
<br />
Now you should see your git repositories at http://localhost/git-repos or whatever you choose as "git-repos" name in the above alias name.<br />
Next we need to do a "git update-server-info" in your local git repository. Note that you must do that where the actual git repo is created, not where you cloned it. So run this in your git repository:<br />
git update-server-info<br />
<br />
That command is needed to be able to clone over http so it's better to make a post-update hook for it so this command always runs when you do a push to the repository. To get that done go to your git repository in the "hooks" folder and run this:<br />
mv post-update.sample post-update<br />
<br />
We can do this because the default post-update.sample hook is doing exactly what we want (running git update-server-info after a commit).<br />
<br />
Last we need to make a change to gitweb.conf to show the url for http cloning. Open gitweb.conf in your favorite editor (i use nano):<br />
nano /etc/conf.d/gitweb.conf<br />
<br />
Find the line (the dots resamble some content in that line:<br />
our @git_base_url_list = qw(...)<br />
Add something like this (again depends on what you did with the Alias in Apache):<br />
our @git_base_url_list = qw(... http://localhost/git-repos)<br />
That will result in clone lines like so:<br />
git clone http://localhost/git-repos/your_repository.git<br />
<br />
==Write access==<br />
{{Note|Someone has to fill this one in. It's with DAV..?}}<br />
Possible sources for this part:<br />
http://kaeso.wordpress.com/2008/02/02/git-repository-with-apache-via-webdav-and-gitweb/<br />
http://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt<br />
<br />
=Thanx to...=<br />
This howto was mainly based on the awesome howto from howtoforge: http://www.howtoforge.com/how-to-install-a-public-git-repository-on-a-debian-server I only picked the parts that are needed to get it working and left the additional things out.</div>Oal