https://wiki.archlinux.org/api.php?action=feedcontributions&user=Hachre&feedformat=atomArchWiki - User contributions [en]2024-03-28T09:21:35ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Bluetooth&diff=252488Bluetooth2013-03-31T16:55:05Z<p>Hachre: /* Pairing */ added dbus-glib to dependencies</p>
<hr />
<div>[[Category:Bluetooth]]<br />
[[cs:Bluetooth]]<br />
[[de:Bluetooth]]<br />
[[es:Bluetooth]]<br />
[[fr:Bluetooth]]<br />
[[it:Bluetooth]]<br />
[[ru:Bluetooth]]<br />
[[zh-CN:Bluetooth]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers the installation and use of Bluetooth on Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Bluetooth mouse configuration}}<br />
{{Article summary end}}<br />
<br />
[http://www.bluetooth.org/ Bluetooth] is a standard for the short-range wireless interconnection of cellular phones, computers, and other electronic devices. In Linux, the canonical implementation of the Bluetooth protocol stack is [http://www.bluez.org/ BlueZ].<br />
<br />
== Installation ==<br />
To use Bluetooth, [[pacman|install]] {{Pkg|bluez}}, available in the [[Official Repositories]]. The {{ic|dbus}} daemon(start automatically by systemd) is used to read settings and for PIN pairing, while the {{ic|bluetooth}} daemon is required for the Bluetooth protocol.<br />
<br />
Start the bluetooth service:<br />
# systemctl start bluetooth.service<br />
<br />
Enable the bluetooth service at system boot up:<br />
# systemctl enable bluetooth.service<br />
<br />
== Graphical front-ends ==<br />
<br />
The following packages allow for a graphical interface to customize Bluetooth.<br />
<br />
=== Blueman ===<br />
<br />
[http://blueman-project.org Blueman] is a full featured Bluetooth manager written in [[GTK+]] and, as such, is recommended for [[GNOME]] or [[Xfce]]. You can install Blueman with the package {{Pkg|blueman}}, available in the [[Official Repositories]].<br />
<br />
Be sure that {{ic|bluetooth}} daemon is running as described above, and execute {{ic|blueman-applet}}. To make the applet run on login add {{ic|blueman-applet}} either under ''System -> Preferences -> Startup Applications'' (GNOME) or ''Xfce Menu -> Settings -> Session and Startup'' (Xfce).<br />
<br />
In order for a user to add and manage Bluetooth devices using Blueman, the user must be added to the 'lp' group. See /etc/dbus-1/system.d/bluetooth.conf for the section that enables users of the 'lp' group to communicate with the Bluetooth daemon.<br />
<br />
{{Note|If you are running Blueman outside GNOME/GDM (e.g., in Xfce using the {{ic|startx}} command) you should add {{ic|. /etc/X11/xinit/xinitrc.d/*}} on top of your {{ic|~/.xinitrc}} to make Nautilus capable to browse your devices.}}<br />
<br />
To receive files don't forget to right click on the ''Blueman tray icon -> Local Services -> Transfer -> File Receiving" and tick the square box next to "Enabled".<br />
<br />
==== Script for Thunar ====<br />
If you are not using Nautilus (for example Thunar) you may find the following script useful:<br />
{{hc|obex_thunar.sh|<br />
#!/bin/bash<br />
fusermount -u ~/bluetooth<br />
obexfs -b $1 ~/bluetooth<br />
thunar ~/bluetooth<br />
}}<br />
Now you will need to move the script to an appropriate location (e.g., {{ic|/usr/bin}}). After that, mark it as executable:<br />
{{bc|chmod +x /usr/bin/obex_thunar.sh}}<br />
The last step is to change the line in ''Blueman tray icon -> Local Services -> Transfer -> Advanced'' to {{ic|obex_thunar.sh %d}}.<br />
<br />
=== GNOME Bluetooth ===<br />
<br />
[http://live.gnome.org/GnomeBluetooth GNOME Bluetooth] is a fork of the old ''bluez-gnome'' and is focused on integration with the [[GNOME]] desktop environment. GNOME Bluetooth is required by {{Pkg|gnome-shell}}, so you should already have it installed if you are running GNOME 3. Otherwise, it can be installed with the package {{Pkg|gnome-bluetooth}}.<br />
<br />
Run {{ic|bluetooth-applet}} for a nice Bluetooth applet. You should now be able to setup devices and send files by right-clicking the Bluetooth icon. To make the applet run on login, add it to ''System -> Preferences -> Startup Applications''.<br />
<br />
To add a Bluetooth entry to the ''SendTo'' menu in Thunar's file properties menu, see instructions [http://thunar.xfce.org/pwiki/documentation/sendto_menu here].<br />
<br />
=== BlueDevil ===<br />
<br />
The Bluetooth tool for [[KDE]] is [https://projects.kde.org/projects/extragear/base/bluedevil BlueDevil]. It can be installed with the package {{Pkg|bluedevil}}, available in the [[Official Repositories]].<br />
<br />
Make sure {{ic|bluetooth}} daemon is running, as described above. You should get a Bluetooth icon both in Dolphin and in the system tray, from which you can configure BlueDevil and detect Bluetooth devices by clicking the icon. You can also configure BlueDevil from the KDE System Settings<br />
<br />
=== Fluxbox, Openbox, other WM ===<br />
Of course you can still use the preceding applications even if GNOME, Xfce or KDE are not your desktop manager. This list should help you figuring out which application does what:<br />
* bluetooth-applet -- tray icon with access to settings, pairing wizard, management of known devices<br />
* /usr/lib/gnome-user-share/gnome-user-share -- needs to be running if you're about to receive files via obexBT from a paired/bonded device<br />
<br />
if you're receiving an error during transmission and/or there's no file received add this into<br />
<br />
{{ic|/etc/dbus-1/system.d/bluetooth.conf}}<br />
<policy user="your_user_id"><br />
<allow own="org.bluez"/><br />
<allow send_destination="org.bluez"/><br />
<allow send_interface="org.bluez.Agent"/><br />
</policy><br />
<br />
* bluetooth-wizard -- for new devices to be paired<br />
* bluetooth-properties -- accessible also via bluetooth-applet icon<br />
* gnome-file-share-properties -- permissions on receiving files via bluetooth<br />
* bluez-sendto -- gui for sending files to a remote device<br />
<br />
== Manual configuration ==<br />
<br />
To configure BlueZ manually, you may need to edit the configuration files in {{ic|/etc/bluetooth}}. These are:<br />
audio.conf<br />
input.conf<br />
main.conf<br />
network.conf<br />
rfcomm.conf<br />
<br />
The default configuration should work for most purposes. Most configuration options are well-documented in these files, so customization is a simple matter of reading the option descriptions. For general options, start with {{ic|main.conf}}.<br />
<br />
<br />
=== Audio Streaming ===<br />
<br />
You can use {{aur|bluez-tools}} from the [[AUR]] with pulseaudio to stream audio to a bluetooth headset. <br />
Find the MAC of the headset:<br />
$ hcitool scan<br />
Connect to the headset:<br />
$ bt-audio -c XX:XX:XX:XX:XX:XX<br />
Open pulseaudio volume control:<br />
$ pavucontrol<br />
The headset should show up in the Configuration tab.<br />
<br />
== Pairing ==<br />
Many bluetooth devices require [http://en.wikipedia.org/wiki/Bluetooth#Pairing pairing].<br />
The exact procedure depends on the devices involved and their input functionality.<br />
<br />
The procedure on a mobile may be as follows:<br />
* The computer sends a connect request to the mobile. <br />
* A pin, determined by the computer, is prompted for at the mobile<br />
* The same key must be re-entered at the computer.<br />
<br />
To pair with a device without using the gnome-bluez package, the ''bluez-simple-agent'' utility that comes with the bluez package can be used. This utility depends on three packages from [extra]:<br />
<br />
# pacman -S python2-dbus python2-gobject dbus-glib<br />
<br />
First, scan for external devices:<br />
$ hcitool scan<br />
<br />
Run the script as root:<br />
<br />
# bluez-simple-agent<br />
<br />
The message "Agent registered" should be returned, press control-c to quit. <br />
<br />
Below is a basic example of pairing with a specific device. The script will ask for the passcode, enter the code and confirm with enter.<br />
<br />
# bluez-simple-agent hci0 00:11:22:33:AA:BB<br />
<br />
{{note|bluez-simple-agent is only needed once for pairing a device, not every time you want to connect.}}<br />
<br />
See the Examples section below for pairing examples with various devices.<br />
<br />
== Using Obex for sending and receiving files ==<br />
Another option, rather than using KDE or Gnome Bluetooth packages, is Obexfs which allows you to mount your phone and treat it as part of your filesystem. Note that to use Obexfs, you need a device that provides an Obex FTP service.<br />
<br />
To install;<br />
# pacman -S obexfs<br />
<br />
and then your phone can then be mounted running as root <br />
# obexfs -b <devices mac address> /mountpoint<br />
<br />
For more mounting options see http://dev.zuckschwerdt.org/openobex/wiki/ObexFs<br />
<br />
For devices don't support Obex FTP service, check if Obex Object Push is supported.<br />
<br />
# sdptool browse XX:XX:XX:XX:XX:XX<br />
<br />
Read the output, look for Obex Object Push, remember the channel for this service. If supported, you can use ussp-push to send files to this device:<br />
<br />
# ussp-push XX:XX:XX:XX:XX:XX@CHANNEL file wanted_file_name_on_phone<br />
<br />
== Examples ==<br />
<br />
=== Siemens S55 ===<br />
<br />
This is what I did to connect to my S55. (I have not figured out how to initiate the connection from the phone)<br />
* The steps under installation<br />
* <br />
$> hcitool scan<br />
Scanning ...<br />
XX:XX:XX:XX:XX:XX NAME<br />
$> B=XX:XX:XX:XX:XX:XX<br />
Start the simple-agent in a second terminal<br />
$> su -c bluez-simple-agent <br />
Password: <br />
Agent registered<br />
Back to the first console <br />
$> obexftp -b $B -l "Address book"<br />
# Phone ask for pin, I enter it and answer yes when asked if I want to save the device<br />
...<br />
<file name="5F07.adr" size="78712" modified="20030101T001858" user-perm="WD" group-perm="" /><br />
...<br />
$> obexftp -b 00:01:E3:6B:FF:D7 -g "Address book/5F07.adr"<br />
Browsing 00:01:E3:6B:FF:D7 ...<br />
Channel: 5<br />
Connecting...done<br />
Receiving "Address book/5F07.adr"... Sending "Address book"... done<br />
Disconnecting...done<br />
$> obexftp -b 00:01:E3:6B:FF:D7 -p a <br />
...<br />
Sending "a"... done<br />
Disconnecting...done<br />
<br />
=== Logitech Mouse MX Laser / M555b ===<br />
<br />
To quickly test the connection:<br />
<br />
$> hidd --connect XX:XX:XX:XX:XX:XX<br />
<br />
For automated reconnection, use your desktop wizard to configure the bluetooth mouse.<br />
If your desktop environment doesn't includes support for this task, see the [[Bluetooth mouse manual configuration]] guide.<br />
<br />
=== Motorola V900 ===<br />
<br />
After installing blueman and running blueman-applet, click "find me" under connections -> bluetooth in motorla device. In blueman-applet, scan devices, find the motorola, click "add" in blueman-applet. Click "bond" in blueman-applet, enter some pin, enter the same pin in motorola when it asks. In terminal:<br />
<br />
cd ~/<br />
mkdir bluetooth-temp<br />
obexfs -n xx:yy:zz:... ~/bluetooth-temp<br />
cd ~/bluetooth-temp<br />
<br />
and browse... Only audio, video, and pictures are available when you do this.<br />
<br />
=== Motorola RAZ ===<br />
<br />
> pacman -S obextool obexfs obexftp openobex bluez<br />
<br />
> lsusb<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 002 Device 002: ID 03f0:171d Hewlett-Packard Wireless (Bluetooth + WLAN) Interface [Integrated Module]<br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
> hciconfig hci0 up<br />
<br />
> hciconfig<br />
hci0: Type: BR/EDR Bus: USB<br />
BD Address: 00:16:41:97:BA:5E ACL MTU: 1017:8 SCO MTU: 64:8<br />
UP RUNNING<br />
RX bytes:348 acl:0 sco:0 events:11 errors:0<br />
TX bytes:38 acl:0 sco:0 commands:11 errors:0<br />
<br />
> hcitool dev<br />
Devices:<br />
hci0 00:16:41:97:BA:5E<br />
<br />
'''Attention: make sure that bluetooth on your phone is enabled and your phone is visible! <br />
'''<br />
<br />
> hcitool scan<br />
Scanning ...<br />
00:1A:1B:82:9B:6D [quirxi]<br />
<br />
> hcitool inq<br />
Inquiring ...<br />
00:1A:1B:82:9B:6D clock offset: 0x1ee4 class: 0x522204<br />
<br />
> l2ping 00:1A:1B:82:9B:6D<br />
Ping: 00:1A:1B:82:9B:6D from 00:16:41:97:BA:5E (data size 44) ...<br />
44 bytes from 00:1A:1B:82:9B:6D id 0 time 23.94ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 1 time 18.85ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 2 time 30.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 3 time 18.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 4 time 17.88ms<br />
44 bytes from 00:1A:1B:82:9B:6D id 5 time 17.88ms<br />
6 sent, 6 received, 0% loss<br />
<br />
> hcitool name 00:1A:1B:82:9B:6D<br />
[quirxi]<br />
<br />
# hciconfig -a hci0<br />
hci0: Type: BR/EDR Bus: USB<br />
BD Address: 00:16:41:97:BA:5E ACL MTU: 1017:8 SCO MTU: 64:8<br />
UP RUNNING<br />
RX bytes:9740 acl:122 sco:0 events:170 errors:0<br />
TX bytes:2920 acl:125 sco:0 commands:53 errors:0<br />
Features: 0xff 0xff 0x8d 0xfe 0x9b 0xf9 0x00 0x80<br />
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3<br />
Link policy:<br />
Link mode: SLAVE ACCEPT<br />
Name: 'BCM2045'<br />
Class: 0x000000<br />
Service Classes: Unspecified<br />
Device Class: Miscellaneous,<br />
HCI Version: 2.0 (0x3) Revision: 0x204a<br />
LMP Version: 2.0 (0x3) Subversion: 0x4176<br />
Manufacturer: Broadcoml / Corporation (15)<br />
<br />
> hcitool info 00:1A:1B:82:9B:6D<br />
Requesting information ...<br />
BD Address: 00:1A:1B:82:9B:6D<br />
Device Name: [quirxi]<br />
LMP Version: 1.2 (0x2) LMP Subversion: 0x309<br />
Manufacturer: Broadcom Corporation (15)<br />
Features: 0xff 0xfe 0x0d 0x00 0x08 0x08 0x00 0x00<br />
<3-slot packets> <5-slot packets> <encryption> <slot offset><br />
<timing accuracy> <role switch> <hold mode> <sniff mode><br />
<RSSI> <channel quality> <SCO link> <HV2 packets><br />
<HV3 packets> <A-law log> <CVSD> <power control><br />
<transparent SCO> <AFH cap. slave> <AFH cap. master><br />
<br />
'''Edit your main.conf and enter the proper class for your phone ( Class = 0x100100 ):'''<br />
> vim /etc/bluetooth/main.conf<br />
<br />
# Default device class. Only the major and minor device class bits are<br />
# considered.<br />
#Class = 0x000100<br />
Class = 0x100100<br />
<br />
> /etc/rc.d/dbus start<br />
:: Starting D-BUS system messagebus <br />
[DONE]<br />
<br />
> /etc/rc.d/bluetooth start<br />
:: Stopping bluetooth subsystem: pand dund rfcomm hidd bluetoothd<br />
[DONE]<br />
:: Starting bluetooth subsystem: bluetoothd<br />
<br />
'''Pairing with bluez-simple-agent only has to be done once. On your motorola-phone give 0000 in as your pin when phone asks for it !!'''<br />
> /usr/bin/bluez-simple-agent hci0 00:1A:1B:82:9B:6D<br />
RequestPinCode (/org/bluez/10768/hci0/dev_00_1A_1B_82_9B_6D)<br />
Enter PIN Code: 0000<br />
Release<br />
New device (/org/bluez/10768/hci0/dev_00_1A_1B_82_9B_6D)<br />
<br />
'''Now you can browse the filesystem of your phone with obexftp:'''<br />
> obexftp -v -b 00:1A:1B:82:9B:6D -B 9 -l<br />
Connecting..\done<br />
Tried to connect for 448ms<br />
Receiving "(null)"...-<?xml version="1.0" ?><br />
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"><br />
<folder-listing><br />
<parent-folder /><br />
<folder name="audio" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
<folder name="video" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
<folder name="picture" size="0" type="folder" modified="20101010T132323Z" user-perm="RW" /><br />
</folder-listing><br />
done<br />
Disconnecting..\done<br />
<br />
'''Or you can mount your phone into a directory on your computer and treat it like a normal file system:'''<br />
<br />
> groupadd bluetooth<br />
> mkdir /mnt/bluetooth<br />
> chown root:bluetooth /mnt/bluetooth<br />
> chmod 775 /mnt/bluetooth<br />
> usermod -a -G bluetooth arno<br />
<br />
> obexfs -b 00:1A:1B:82:9B:6D /mnt/bluetooth/<br />
> l /mnt/bluetooth/<br />
total 6<br />
drwxr-xr-x 1 root root 0 10. Okt 13:25 .<br />
drwxr-xr-x 5 root root 4096 10. Okt 10:08 ..<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 audio<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 picture<br />
drwxr-xr-x 1 root root 0 10. Okt 2010 video<br />
<br />
=== Pairing with an iPhone using bluez-simple-agent ===<br />
<br />
Assuming a bluetooth device called hci0 and an iPhone that showed up in a hcitool scan as '00:00:DE:AD:BE:EF':<br />
<br />
# bluez-simple-agent hci0 00:00:DE:AD:BE:EF<br />
Passcode:<br />
<br />
=== Headset and Alsa Devices ===<br />
1. First if you have not already, install bluez<br />
# pacman -S bluez<br />
2. Scan for your device<br />
$ hcitool (-i <optional hci#>***) scan<br />
3. Pair your headset with your device<br />
$ bluez-simple-agent (optional hci# ***) XX:XX:XX:XX:XX:XX<br />
and put in your pin (0000 or 1234, etc)<br />
4. Add this to your/etc/asound.conf file<br />
#/etc/asound.conf<br />
<br />
pcm.btheadset {<br />
type plug<br />
slave {<br />
pcm {<br />
type bluetooth<br />
device XX:XX:XX:XX:XX:XX <br />
profile "auto"<br />
} <br />
} <br />
hint {<br />
show on<br />
description "BT Headset"<br />
} <br />
}<br />
ctl.btheadset {<br />
type bluetooth<br />
} <br />
<br />
5. Check to see if it has been added to alsa devices<br />
$ aplay -L<br />
<br />
6. Now play with aplay:<br />
$ aplay -D btheadset /path/to/audio/file<br />
<br />
or Mplayer:<br />
$ mplayer -ao alsa:device=btheadset /path/to/audio/or/video/file<br />
<br />
*** To find hci# for a usb dongle, type in <br />
$ hcitool dev<br />
<br />
=== Microsoft Bluetooth Mobile Keyboard 6000 ===<br />
<br />
1. Scan for your device<br />
$ hcitool (-i <optional hci#>***) scan<br />
Scanning ...<br />
00:11:22:33:44:55 Microsoft Bluetooth Mobile Keyboard 6000<br />
<br />
<br />
2. On second console run as root (do not terminate):<br />
# bluez-simple-agent<br />
Agent registered<br />
<br />
3. Back on first console run:<br />
$ bluez-simple-agent hci0 00:11:22:33:44:55<br />
Enter PIN Code: 1234<br />
(now enter that pin on the keyboard and press enter)<br />
Release<br />
New device (/org/bluez/5373/hci0/dev_00_11_22_33_44_55)<br />
<br />
4.<br />
$ bluez-test-device trusted 00:11:22:33:44:55<br />
<br />
5.<br />
$ bluez-test-input connect 00:11:22:33:44:55<br />
<br />
No your keyboard should work. You can terminate bluez-simple-agent on second console with Ctrl-C<br />
<br />
== Troubleshooting ==<br />
<br />
=== Segfaults in Bluez 4.95 ===<br />
If bluetoothd stops working after enabling or disabling your bluetooth device via rfkill or gnome-bluetooth applet, look at your dmesg output. If it looks like:<br />
<br />
bluetoothd[2330]: segfault at 1 ip 00007fcef2327b75 sp 00007fff9f769cb0 error 4 in libglib-2.0.so.0.2800.8[7fcef22ca000+e9000]<br />
<br />
then you should consider downgrading to 4.94 (just grab the PKGBUILD/etc from arch and change version to 4.94 and correct the md5sum for bluez) or wait for an update of bluez. [https://bugs.archlinux.org/task/25088?project=1&openedfrom=-1+week Here] is a (arch) bug report about it.<br />
<br />
=== passkey-agent ===<br />
$> passkey-agent --default 1234<br />
Can't register passkey agent<br />
The name org.bluez was not provided by any .service files<br />
You probably started {{ic|/etc/rc.d/bluetooth}} before {{ic|/etc/rc.d/dbus}}<br />
$> hciconfig dev<br />
# (no listing)<br />
Try running {{ic|hciconfig hc0 up}}<br />
<br />
=== Blueman ===<br />
If blueman-applet fails to start, try removing the entire ''/var/lib/bluetooth'' directory and restarting the machine (or just the hal, dbus, and bluetooth services).<br />
# rm -rf /var/lib/bluetooth<br />
# reboot<br />
<br />
=== gnome-bluetooth ===<br />
If you see this when trying to enable receiving files in bluetooth-properties:<br />
Bluetooth OBEX start failed: Invalid path<br />
Bluetooth FTP start failed: Invalid path<br />
Then run:<br />
# pacman -S xdg-user-dirs<br />
$ xdg-user-dirs-update<br />
You can edit the paths using:<br />
$ vi ~/.config/user-dirs.dirs<br />
<br />
=== Bluetooth USB Dongle ===<br />
If you are using a USB dongle, you should check that your Bluetooth dongle is recognized. You can do that by inspecting {{ic|/var/log/messages.log}} when plugging in the USB dongle (or running {{ic|journalctl -f}} with systemd). It should look something like the following (look out for hci):<br />
<br />
# tail -f /var/log/messages.log<br />
Feb 20 15:00:24 hostname kernel: [ 2661.349823] usb 4-1: new full-speed USB device number 3 using uhci_hcd<br />
Feb 20 15:00:24 hostname bluetoothd[4568]: HCI dev 0 registered<br />
Feb 20 15:00:24 hostname bluetoothd[4568]: Listening for HCI events on hci0<br />
Feb 20 15:00:25 hostname bluetoothd[4568]: HCI dev 0 up<br />
Feb 20 15:00:25 hostname bluetoothd[4568]: Adapter /org/bluez/4568/hci0 has been enabled<br />
<br />
For a list of supported hardware please refer to the [[Bluetooth#Resources|resources]] section on this page.<br />
<br />
If you only get the first two lines, you may see that it found the device but you need to bring it up.<br />
Example:<br />
<br />
hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0<br />
DOWN <br />
RX bytes:0 acl:0 sco:0 events:0 errors:0<br />
TX bytes:0 acl:0 sco:0 commands:0 errors:<br />
sudo hciconfig hci0 up<br />
hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:02:72:C4:7C:06 ACL MTU: 377:10 SCO MTU: 64:8<br />
UP RUNNING <br />
RX bytes:348 acl:0 sco:0 events:11 errors:0<br />
TX bytes:38 acl:0 sco:0 commands:11 errors:0<br />
<br />
If this fails with an error like:<br />
Operation not possible due to RF-kill<br />
it could be due either to the {{ic|rfkill}} utility, in which case it should be resolved with<br />
# rfkill unblock all<br />
or, it could simply be the hardware switch of the computer. The hardware bluetooth switch (at least sometimes) controls access to USB bluetooth dongles also. Flip/press this switch and try bringing the device up again.<br />
<br />
To verify that the device was detected you can use {{ic|hcitool}} which is part of the {{ic|bluez-utils}}. You can get a list of available devices and their identifiers and their MAC address by issuing:<br />
<br />
$ hcitool dev<br />
Devices:<br />
hci0 00:1B:DC:0F:DB:40<br />
<br />
More detailed informations about the device can be retrieved by using {{ic|hciconfig}}.<br />
<br />
$ hciconfig -a hci0<br />
hci0: Type: USB<br />
BD Address: 00:1B:DC:0F:DB:40 ACL MTU: 310:10 SCO MTU: 64:8<br />
UP RUNNING PSCAN ISCAN <br />
RX bytes:1226 acl:0 sco:0 events:27 errors:0<br />
TX bytes:351 acl:0 sco:0 commands:26 errors:0<br />
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80<br />
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 <br />
Link policy: RSWITCH HOLD SNIFF PARK <br />
Link mode: SLAVE ACCEPT <br />
Name: 'BlueZ (0)'<br />
Class: 0x000100<br />
Service Classes: Unspecified<br />
Device Class: Computer, Uncategorized<br />
HCI Ver: 2.0 (0x3) HCI Rev: 0xc5c LMP Ver: 2.0 (0x3) LMP Subver: 0xc5c<br />
Manufacturer: Cambridge Silicon Radio (10)<br />
<br />
=== Logitech Bluetooth USB Dongle ===<br />
There are Logitech dongles (ex. Logitech MX5000) that can work in two modes Embedded and HCI. In embedded mode dongle emulates a USB device so it seems to your PC that your using a normal USB mouse/keyoard.<br />
<br />
If you hold the little red Button on the USB BT mini-receiver it will enable the other mode. Hold the red button on the BT dongle and plug it into the computer, and after 3-5 seconds of holding the button, the Bluetooth icon will appear in the system tray. [http://ubuntuforums.org/showthread.php?t=1332197 Discussion]<br />
<br />
=== hcitool scan: Device not found ===<br />
* On some Dell laptops (e.g. Studio 15) you have to switch the Bluetooth mode from HID to HCI using<br />
# hid2hci<br />
<br />
{{Note|hid2hci is no longer in the $PATH, it is under /lib/udev/hid2hci, but udev should run it automatically for you.}}<br />
<br />
* If the device won't show up and you have a Windows operating system on your machine, try booting it and enable the bluetooth adapter from windows.<br />
<br />
* Sometimes also this simple command helps:<br />
# hciconfig hci0 up<br />
<br />
=== My computer isn't visible ===<br />
Can't discover computer from your phone? Enable PSCAN and ISCAN:<br />
# enable PSCAN and ISCAN<br />
$ hciconfig hci0 piscan <br />
# check it worked<br />
$ hciconfig <br />
hci0: Type: USB<br />
BD Address: 00:12:34:56:78:9A ACL MTU: 192:8 SCO MTU: 64:8<br />
'''UP RUNNING PSCAN ISCAN'''<br />
RX bytes:20425 acl:115 sco:0 events:526 errors:0<br />
TX bytes:5543 acl:84 sco:0 commands:340 errors:0<br />
<br />
{{Note | Check DiscoverableTimeout and PairableTimeout in /etc/bluetooth/main.conf}}<br />
<br />
Try changing device class in /etc/bluetooth/main.conf as following<br />
# Default device class. Only the major and minor device class bits are<br />
# considered.<br />
#Class = 0x000100 (from default config)<br />
Class = 0x100100<br />
<br />
This was the only solution to make my computer visible for my phone. <br />
<br />
=== Nautilus cannot browse files ===<br />
If nautilus doesn't open and show this error:<br />
Nautilus cannot handle obex: locations. Couldn't display "obex://[XX:XX:XX:XX:XX:XX]/".<br />
Install gvfs-obexftp package:<br />
# pacman -S gvfs-obexftp<br />
<br />
=== Bluetooth is disabled when starting GNOME ===<br />
If you have {{ic|dbus}} and {{ic|bluetooth}} backgrounded (@) in your {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}, it might happen that {{ic|bluetooth}} will be disabled when starting up GNOME. To solve this, make sure {{ic|dbus}} is not backgrounded.<br />
<br />
=== Sennheiser MM400 Headset connection problems ===<br />
If your {{ic|Sennheiser MM400 Headset}} immediately disconnects after connecting as {{ic|Headset Service}} with Blueman, try to connect it as {{ic|Audio Sink}}. Afterwards you can change the headset's {{ic|Audio Profile}} to {{ic|Telephony Duplex}} with a right click in Blueman.<br />
With this option headset functionality will be available although the headset was only connected as {{ic|Audio Sink}} in first place and no disconnection will happen (tested with bluez 4.96-3, pulseaudio 1.1-1 and blueman 1.23-2).<br />
<br />
=== My device is paired but no sound is played from it ===<br />
Try to first inspect '''/var/log/messages.log'''<br />
{{bc|# tail /var/log/messages.log<br />
Jan 12 20:08:58 localhost pulseaudio[1584]: [pulseaudio] module-bluetooth-device.c: Service not connected<br />
Jan 12 20:08:58 localhost pulseaudio[1584]: [pulseaudio] module-bluetooth-device.c: Bluetooth audio service not available}}<br />
<br />
If you see such messages, try first:<br />
{{bc|# pactl load-module module-bluetooth-device}}<br />
<br />
If the module fails to work, do this workaround:<br />
Open '''/etc/bluetooth/audio.conf''' and add after '''[General]''' (on a new line)<br />
{{bc|Enable&#61;Socket}}<br />
Then restart the bluetooth daemon with {{ic|/etc/rc.d/bluetooth restart}}.<br />
Pair again your device, and you should find it in the pulseaudio settings (advanced settings for the sound)<br />
<br />
[http://wiki.gentoo.org/index.php?title=Bluetooth_Headset&redirect=no More information on Gentoo Wiki]<br />
<br />
If after fixing this you still can't get sound, try using blueman (this is the only one that works for me), make sure that notify-osd is installed or it might show you weird error messages like this one: "Stream setup failed"<br />
<br />
fail (/usr/lib/python2.7/site-packages/blueman/gui/manager/ManagerDeviceMenu.py:134)<br />
fail (DBusException(dbus.String(u'Stream setup failed'),),)<br />
<br />
== See also ==<br />
*[http://www.gentoo.org/doc/en/bluetooth-guide.xml Gentoo Linux Bluetooth Guide]<br />
*[http://en.opensuse.org/HCL:Bluetooth openSUSE Bluetooth Hardware Compatibility List]<br />
*[http://linuxgazette.net/109/oregan3.html Accessing a Bluetooth phone (Linux Gazette)]<br />
*[http://www.adamish.com/blog/#a000361 Bluetooth computer visibility]</div>Hachrehttps://wiki.archlinux.org/index.php?title=Netctl&diff=250327Netctl2013-03-12T08:42:51Z<p>Hachre: /* Configuration */ Changed the wording</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
Netctl is currently in [testing]. Users are encouraged to download it from their favorite mirror.<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
Netctl uses simple text profiles. Example profiles are provided for users to use as a template under {{ic|/etc/netctl/examples}}. Common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy it to {{ic|/etc/netctl/<profile>}} and edit:<br />
# cp /etc/netctl/examples/ethernet-static /etc/netctl/my-static-network<br />
<br />
After your profile has been created make sure to enable it by running {{ic|netctl enable <profile>}}.<br />
<br />
[[Important]]: If you decide to change the interface name in your profile you'll have to run {{ic|netctl disable <profile>}} followed by {{ic|netctl enable <profile>}} to apply this change. Simply editing the profile file is not enough!<br />
<br />
===For Users Migrating from Netcfg===<br />
Netctl uses {{ic|/etc/netctl}} to store its profiles whereas netcfg used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
Users ''not'' wishing to have their passwords stored in ''plain text'' have the option of generating a 256-bit Encrypted PSK.<br />
<br />
If you have not done so already, install {{pkg|wpa_actiond}} from the {{ic|core}} repository using [[pacman]]<br />
$ [[pacman]] -Syu {{pkg|wpa_actiond}}<br />
<br />
Next, generate your 256-bit Encrypted PSK using [[WPA_supplicant#Configuration_file|wpa_passphrase]]:<br />
{{hc|Usage: [[WPA_supplicant#Configuration_file|wpa_passphrase]] [ssid] [passphrase]|<br />
2=$ [[WPA_supplicant#Configuration_file|wpa_passphrase]] archlinux freenode|<br />
network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
}}<br />
<br />
In a second terminal window copy the example file {{ic|wireless-wpa}} from {{ic|/etc/netctl/examples/}} to {{ic|/etc/netctl/}}.<br />
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/wireless-wpa<br />
<br />
You will then need to edit {{ic|/etc/netctl/wireless-wpa}} using your favorite text editor and add the ''Encrypted Pre-shared Key'' that was generated early using [[WPA_supplicant#Configuration_file|wpa_passphrase]] to the {{ic|'''Key'''}} variable of this profile.<br />
<br />
Once completed your network profile {{ic|wireless-wpa}} containing a 256-bit Encrypted PSK should resemble:<br />
{{hc|/etc/netctl/wireless-wpa|<br />
2={{Note|1=Make sure to use the '''special non-quoted rules''' for Key= that are explained at the end of netctl.profile(5)}}<br />
Description='A simple WPA encrypted wireless connection using 256-bit Encrypted PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa<br />
IP=dhcp<br />
ESSID=archlinux<br />
Key=\"64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}}<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Hachrehttps://wiki.archlinux.org/index.php?title=Netctl&diff=250326Netctl2013-03-12T08:40:54Z<p>Hachre: /* Configuration */ resubmitting my previous edit, I had put it into the wrong section</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
Netctl is currently in [testing]. Users are encouraged to download it from their favorite mirror.<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
Netctl uses simple text profiles. Example profiles are provided for users to use as a template under {{ic|/etc/netctl/examples}}. Common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy it to {{ic|/etc/netctl/<profile>}} and edit:<br />
# cp /etc/netctl/examples/ethernet-static /etc/netctl/my-static-network<br />
<br />
After your profile has been created make sure to enable it by running {{ic|netctl enable <profile>}}.<br />
<br />
Important: If you have changed the interface name in your profile you have to run {{ic|netctl disable <profile>}} followed by {{ic|netctl enable <profile>}} to apply this change.<br />
<br />
===For Users Migrating from Netcfg===<br />
Netctl uses {{ic|/etc/netctl}} to store its profiles whereas netcfg used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
Users ''not'' wishing to have their passwords stored in ''plain text'' have the option of generating a 256-bit Encrypted PSK.<br />
<br />
If you have not done so already, install {{pkg|wpa_actiond}} from the {{ic|core}} repository using [[pacman]]<br />
$ [[pacman]] -Syu {{pkg|wpa_actiond}}<br />
<br />
Next, generate your 256-bit Encrypted PSK using [[WPA_supplicant#Configuration_file|wpa_passphrase]]:<br />
{{hc|Usage: [[WPA_supplicant#Configuration_file|wpa_passphrase]] [ssid] [passphrase]|<br />
2=$ [[WPA_supplicant#Configuration_file|wpa_passphrase]] archlinux freenode|<br />
network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
}}<br />
<br />
In a second terminal window copy the example file {{ic|wireless-wpa}} from {{ic|/etc/netctl/examples/}} to {{ic|/etc/netctl/}}.<br />
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/wireless-wpa<br />
<br />
You will then need to edit {{ic|/etc/netctl/wireless-wpa}} using your favorite text editor and add the ''Encrypted Pre-shared Key'' that was generated early using [[WPA_supplicant#Configuration_file|wpa_passphrase]] to the {{ic|'''Key'''}} variable of this profile.<br />
<br />
Once completed your network profile {{ic|wireless-wpa}} containing a 256-bit Encrypted PSK should resemble:<br />
{{hc|/etc/netctl/wireless-wpa|<br />
2={{Note|1=Make sure to use the '''special non-quoted rules''' for Key= that are explained at the end of netctl.profile(5)}}<br />
Description='A simple WPA encrypted wireless connection using 256-bit Encrypted PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa<br />
IP=dhcp<br />
ESSID=archlinux<br />
Key=\"64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}}<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Hachrehttps://wiki.archlinux.org/index.php?title=Netctl&diff=250325Netctl2013-03-12T08:40:08Z<p>Hachre: Undo revision 250324 by Hachre (talk)</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
Netctl is currently in [testing]. Users are encouraged to download it from their favorite mirror.<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
Netctl uses simple text profiles. Example profiles are provided for users to use as a template under {{ic|/etc/netctl/examples}}. Common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy it to {{ic|/etc/netctl/<profile>}} and edit:<br />
# cp /etc/netctl/examples/ethernet-static /etc/netctl/my-static-network<br />
<br />
===For Users Migrating from Netcfg===<br />
Netctl uses {{ic|/etc/netctl}} to store its profiles whereas netcfg used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
Users ''not'' wishing to have their passwords stored in ''plain text'' have the option of generating a 256-bit Encrypted PSK.<br />
<br />
If you have not done so already, install {{pkg|wpa_actiond}} from the {{ic|core}} repository using [[pacman]]<br />
$ [[pacman]] -Syu {{pkg|wpa_actiond}}<br />
<br />
Next, generate your 256-bit Encrypted PSK using [[WPA_supplicant#Configuration_file|wpa_passphrase]]:<br />
{{hc|Usage: [[WPA_supplicant#Configuration_file|wpa_passphrase]] [ssid] [passphrase]|<br />
2=$ [[WPA_supplicant#Configuration_file|wpa_passphrase]] archlinux freenode|<br />
network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
}}<br />
<br />
In a second terminal window copy the example file {{ic|wireless-wpa}} from {{ic|/etc/netctl/examples/}} to {{ic|/etc/netctl/}}.<br />
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/wireless-wpa<br />
<br />
You will then need to edit {{ic|/etc/netctl/wireless-wpa}} using your favorite text editor and add the ''Encrypted Pre-shared Key'' that was generated early using [[WPA_supplicant#Configuration_file|wpa_passphrase]] to the {{ic|'''Key'''}} variable of this profile.<br />
<br />
Once completed your network profile {{ic|wireless-wpa}} containing a 256-bit Encrypted PSK should resemble:<br />
{{hc|/etc/netctl/wireless-wpa|<br />
2={{Note|1=Make sure to use the '''special non-quoted rules''' for Key= that are explained at the end of netctl.profile(5)}}<br />
Description='A simple WPA encrypted wireless connection using 256-bit Encrypted PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa<br />
IP=dhcp<br />
ESSID=archlinux<br />
Key=\"64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}}<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Hachrehttps://wiki.archlinux.org/index.php?title=Netctl&diff=250324Netctl2013-03-12T08:38:24Z<p>Hachre: /* Configuration */ Added explanation on how to activate a profile and switch the interface name in a profile.</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[es:Netcfg]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ja:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Article summary start}}<br />
{{Article summary text|A guide to configuring the network using netctl and network profile scripts.}}<br />
{{Article summary end}}<br />
Netctl is a new Arch project slated to replace [[netcfg]]. Users should regard it as the future of CLI-based network management on Arch Linux.<br />
<br />
==Installation==<br />
Netctl is currently in [testing]. Users are encouraged to download it from their favorite mirror.<br />
<br />
==Recommended Reading==<br />
Considerable effort has gone into the construction of quality man pages. Users are encouraged to read the following man pages prior to using netctl:<br />
*netctl<br />
*netctl.profile<br />
*netctl.special<br />
<br />
==Configuration==<br />
Netctl uses simple text profiles. Example profiles are provided for users to use as a template under {{ic|/etc/netctl/examples}}. Common configurations include:<br />
*ethernet-dhcp<br />
*ethernet-static<br />
*wireless-wpa-static<br />
<br />
To use an example profile, simply copy it to {{ic|/etc/netctl/<profile>}} and edit:<br />
# cp /etc/netctl/examples/ethernet-static /etc/netctl/my-static-network<br />
<br />
===For Users Migrating from Netcfg===<br />
Netctl uses {{ic|/etc/netctl}} to store its profiles whereas netcfg used {{ic|/etc/network.d}} for the same purpose.<br />
<br />
In order to migrate from netcfg, at least the following is needed:<br />
*Move network profile files to the new directory.<br />
*Rename variables therein according to netctl.profile(5) (most have only become CamelCase i.e CONNECTION= becomes Connection=).<br />
*Unquote interface variables and other variables that don't strictly need quoting (this is mainly a style thing).<br />
*Run {{ic|netctl enable <profile>}} for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).<br />
*Use {{ic|netctl list}} / {{ic|netctl start <profile>}} instead of netcfg-menu. wifi-menu remains available.<br />
<br />
===Password Encryption (256-bit PSK)===<br />
Users ''not'' wishing to have their passwords stored in ''plain text'' have the option of generating a 256-bit Encrypted PSK.<br />
<br />
If you have not done so already, install {{pkg|wpa_actiond}} from the {{ic|core}} repository using [[pacman]]<br />
$ [[pacman]] -Syu {{pkg|wpa_actiond}}<br />
<br />
Next, generate your 256-bit Encrypted PSK using [[WPA_supplicant#Configuration_file|wpa_passphrase]]:<br />
{{hc|Usage: [[WPA_supplicant#Configuration_file|wpa_passphrase]] [ssid] [passphrase]|<br />
2=$ [[WPA_supplicant#Configuration_file|wpa_passphrase]] archlinux freenode|<br />
network={<br />
ssid="archlinux"<br />
#psk="freenode"<br />
psk=64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}<br />
{{Note|This information will be used in your profile so do not close the terminal}}<br />
}}<br />
<br />
In a second terminal window copy the example file {{ic|wireless-wpa}} from {{ic|/etc/netctl/examples/}} to {{ic|/etc/netctl/}}.<br />
# cp /etc/netctl/examples/wireless-wpa /etc/netctl/wireless-wpa<br />
<br />
You will then need to edit {{ic|/etc/netctl/wireless-wpa}} using your favorite text editor and add the ''Encrypted Pre-shared Key'' that was generated early using [[WPA_supplicant#Configuration_file|wpa_passphrase]] to the {{ic|'''Key'''}} variable of this profile.<br />
<br />
Once completed your network profile {{ic|wireless-wpa}} containing a 256-bit Encrypted PSK should resemble:<br />
{{hc|/etc/netctl/wireless-wpa|<br />
2={{Note|1=Make sure to use the '''special non-quoted rules''' for Key= that are explained at the end of netctl.profile(5)}}<br />
Description='A simple WPA encrypted wireless connection using 256-bit Encrypted PSK'<br />
Interface=wlp2s2<br />
Connection=wireless<br />
Security=wpa<br />
IP=dhcp<br />
ESSID=archlinux<br />
Key=\"64cf3ced850ecef39197bb7b7b301fc39437a6aa6c6a599d0534b16af578e04a<br />
}}<br />
<br />
After your profile has been created make sure to enable it by running {{ic|netctl enable <profile>}}.<br />
<br />
Important: If you have changed the interface name in your profile you have to run {{ic|netctl disabled <profile>}} followed by {{ic|netctl enable <profile>}} to apply this change.<br />
<br />
==Support==<br />
Official announcement thread: https://bbs.archlinux.org/viewtopic.php?id=157670</div>Hachrehttps://wiki.archlinux.org/index.php?title=Talk:Installation_guide&diff=250188Talk:Installation guide2013-03-11T04:41:52Z<p>Hachre: /* add netctl to the mentioned ways of configuring network */ new section</p>
<hr />
<div>== Read this first before add new suggestion ==<br />
* Point of this page is to ''not'' become another Beginner's guide. It's meant to be a ''concise'' checklist of things to be done. So detailed install instruction should go to [[Beginners' Guide]]. <br />
* If there is something to discuss which should also affect the Beginner's guide, then do it on [[Talk:Beginners%27_Guide/Installation]]. An advanced user will find this page less bloated and easier to read, so let's KISS.<br />
<br />
== Prominently link to [[Beginners' Guide]] ==<br />
<br />
From http://www.archlinux.org new users who want to install Arch are likely to end up here, while for them the [[Beginners' Guide]] is a much better fit. IMHO this should be noted in the introductionary paragraphs. --[[User:Raboof|Raboof]] ([[User talk:Raboof|talk]]) 18:14, 3 March 2013 (UTC)<br />
<br />
== update "Configure the bootloader" part ==<br />
to install grub-bios: install guide say:<br />
<br />
''Configure the bootloader: refer back to the appropriate article from the bootloader installation section.''<br />
<br />
at [[Installation_Guide#Configure_system]]<br />
<br />
At this point I did:<br />
grub-mkconfig > /boot/grub/grub.cfg<br />
<br />
then:<br />
grub-install /dev/sda<br />
<br />
--[[User:Nilzao|Nilzao]]<br />
<br />
:: I agree, although I use grub-mkconfig -o /boot/grub/grub.cfg, these two commands are enough to install grub on most machines so might as well be part of the actual guide. As with all other commands, problems or alternative configurations can be explained at the linked detailed pages. [[User:Spider.007|Spider.007]] ([[User talk:Spider.007|talk]]) 11:48, 8 January 2013 (UTC)<br />
<br />
: I suggest to add a tip to follow instructions in https://wiki.archlinux.org/index.php/Grub2#Install_to_440-byte_MBR_boot_code_region - I must do it at every installation --[[User:Loper|Loper]]<br />
<br />
:: Instead of the link suggested by Loper, I'd go for the following: https://wiki.archlinux.org/index.php/Grub#Install_grub-bios_boot_files<br />
:: As there are several places to install grub, might as well show that. This is something that needs to be fixed sometime soon as there are instructions to install grub2 after chrooting. These instructions link to the '#Configure the system' section, which fails to mention installation of the bootloader. This is where I suggest posting the link.<br />
:: --[[User:Ryeguy146|Ryeguy146]] ([[User talk:Ryeguy146|talk]]) 12:57, 18 December 2012 (UTC)<br />
<br />
I just went through an Arch installation following this guide. Please at least mention the need to initialize the MBR with a link to the appropriate section in the Grub article. It was frustrating to reboot to see an "Operating system not found" message. --[[User:Takaitra|Takaitra]] ([[User talk:Takaitra|talk]]) 16:24, 14 February 2013 (UTC)<br />
<br />
== Link Elinks to wiki ==<br />
<br />
Just read that elinks is included on install iso, maybe add an alias/script to allow loading of wiki guide installation guide? --[[User:Mr Green|Mr Green]]<br />
:It's included in the /root directory. [[User:Thestinger|thestinger]] ([[User talk:Thestinger|talk]]) 18:08, 27 October 2012 (UTC)<br />
<br />
== Change section "Connect to the internet" ==<br />
<br />
Since the installation guide is now part of the iso image, I'd like to see a few references to the manpages of the necessary tools here, since you cannot open the network related wiki pages. Maybe something like this would be acceptable:<br />
Assuming a wired ethernet connection, running dhclient or dhcpcd is <br />
sufficient to get a lease. Otherwise set up the connection manually<br />
using ip add, wpa_supplicant (WLAN with WPA), pppoe-setup (DSL), etc.<br />
You can also create and use netcfg profiles. Read more in the manpages:<br />
ip(8), wpa_supplicant(8), pppoe(8), netcfg(8), netcfg-profiles(5)<br />
A reminder to install the packages for the internet connection in the pacstrap section would also be nice. -- [[User:progandy|progandy]]<br />
<br />
== Suggestions to update this guide as part of ISO ==<br />
Since this guide is now being included as 'install.txt' in the ISO, it might be beneficial to incorporate the following changes:<br />
* Entirely remove the '''1. Download''' section and move it to the Download area of the archlinux.org page. This document here is about installing, not downloading, checking, burning discs or dd'ing. The majority of users reading this have likely already booted up the install medium.<br />
* Begin or end the document by mentioning the new archlinux(7) man page which explains the location of important system configuration files<br />
# man archlinux<br />
* Slightly expand the '''6. Connect to the internet''' section to include the most basic examples of setting up a private network using a dynamic and static IP address. (Right now it's only a single paragraph/line.) It's a vital installation step and should actually be moved to the top as one of the first actions during system setup. This fact should be emphasized.<br />
<br />
Obtain dynamic IP <br />
# dhcpcd<br />
<br />
Set static IP<br />
# ip link set dev eth0 up<br />
# ip addr add 192.168.1.2/24 dev eth0<br />
# ip route add default via 192.168.1.1<br />
# echo "nameserver 8.8.8.8" >> /etc/resolv.conf<br />
<br />
--[[User:MajorTom|MajorTom]]<br />
<br />
:* I can agree to all your suggestions, I wonder why no one is modifying the wiki. Internet connection setup is the most important part and should be covered more extensively. In addition to your changes, mention the manpages and configuration templates for netcfg and pppoe-setup/connect. The boot medium must at least contain easy accesible information in order to read all pages referenced in the installation guide. There should also be mentioned that elinks is installed and can be used to access the wiki. --[[User:Progandy|Progandy]] ([[User talk:Progandy|talk]]) 21:50, 24 August 2012 (UTC)<br />
<br />
:* The {{ic|dhcpcd}} network daemon is started automatically: [http://www.archlinux.org/news/install-media-20120804-available/], [https://wiki.archlinux.org/index.php/Beginners%27_Guide#Network_setup], so there's no reason to start it manually. --[[User:DSpider|DSpider]] ([[User talk:DSpider|talk]]) 08:17, 25 August 2012 (UTC)<br />
<br />
== Keymaps ==<br />
<br />
As this guide mentions the loading of keymaps using loadkeys there should be at least a very small example about /etc/vconsole.conf<br />
<br />
Either not talk about keymaps or tell how to make it correct. When this is used as a checklist, the setup of the keymap should not be missing.<br />
: [[KEYMAP]] page link added. Close. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 04:03, 4 September 2012 (UTC)<br />
<br />
:: The section on keymaps and fonts links only to the KEYMAP page. An additional link regarding setting default console font should be added to:<br />
https://wiki.archlinux.org/index.php/Fonts#Console_fonts<br />
<br />
== add a step: setting the clock ==<br />
<br />
Lots of things care about the clock being more-or-less correct, e.g. pacman-key will not work at all if the clock is too far out. Lots of brand new computers come with the clock set to something in the distant past, which causes weird problems during the install. [[User:Thetrivialstuff|Thetrivialstuff]] ([[User talk:Thetrivialstuff|talk]]) 23:14, 31 July 2012 (UTC)<br />
<br />
I agree, the instructions in "Installation Guide" leaves you without a /etc/adjtime file.<br />
The following should be added (taken from beginners guide, but shortened):<br />
Set the hardware clock and generate a {{ic|/etc/adjtime}} file with {{ic|# hwclock --systohc --utc}} or {{ic|# hwclock --systohc --localtime}}<br />
[[User:Bwid|Bwid]] ([[User talk:Bwid|talk]]) 08:03, 3 March 2013 (UTC)<br />
<br />
== pacman-key --init / populate? ==<br />
<br />
Isn't this a required step? pacstrap does not seem to do it on its own. [[User:Thetrivialstuff|Thetrivialstuff]] ([[User talk:Thetrivialstuff|talk]]) 23:15, 31 July 2012 (UTC)<br />
:Edit: Ah; I think this was related to the "set the clock" step -- I see that there is a pacman keyring init in the boot sequence of the latest media, but it (silently?) fails if the local clock is wrong.<br />
::https://mailman.archlinux.org/pipermail/arch-releng/2012-July/002708.html --[[User:Bluewind|Bluewind]] ([[User talk:Bluewind|talk]]) 09:10, 1 August 2012 (UTC)<br />
<br />
== Link to UEFI Bootloaders page ==<br />
<br />
Instead of telling the user to install GRUB(2) alone in case of UEFI, direct the reader to the [[UEFI_Bootloaders]] page which provides info about all the UEFI bootloaders capable of booting linux kernel. Also how can I edit the guide, there is no "edit" tab shown on top of the page. Is this page restricted to few authors only? -- [[User:The.ridikulus.rat|Keshav P R]] ([[User talk:The.ridikulus.rat|talk]]) 15:31, 19 August 2012 (UTC)<br />
<br />
==Styling==<br />
<br />
* The "'''Install a bootloader'''" section should be a bullet point above "Configure the bootloader: refer back to the appropriate ...", no need to have them separate. Using pacstrap to install the bootloader just seems silly (especially since they were also merged in the Beginner's Guide). Also, commands after {{ic|arch-chroot}} would look better if they were indented with "<nowiki>: {{bc|# <command>}}</nowiki>", kinda like how {{ic|# pacman-key -v <iso-file>.sig}} is at the beginning of the article. Would look much cleaner. --[[User:DSpider|DSpider]] ([[User talk:DSpider|talk]]) 16:33, 20 August 2012 (UTC)<br />
<br />
==Proposed changes to Beginners' Guide and link to Post-Installation==<br />
Some major changes are under discussion in [[Talk:Beginners'_Guide#Guide_restructuring]]: some of them would require adjustments to this very guide, see for example [https://wiki.archlinux.org/index.php?title=Talk%3ABeginners%27_Guide&diff=224578&oldid=224567 this post].<br />
<br />
Please reply in the linked discussion, '''not''' here.<br />
<br />
-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 12:15, 22 September 2012 (UTC)<br />
<br />
:I've added the steps in [[Beginners' Guide/Post-Installation]] to this guide, which now directly sends users to [[Beginners' Guide/Extra]].<br />
:If however [[Talk:Beginners' Guide#Guide restructuring]] will be implemented as planned, the [[Beginners' Guide]] will have a slightly different installation procedure than this guide, unless this one is updated too.<br />
:-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 14:08, 24 September 2012 (UTC)<br />
<br />
::Shouldn't the information be added ''before'' "Unmount leftovers and reboot" ? By the way, the title should mention rebooting, because most likely a kernel update was involved. --[[User:DSpider|DSpider]] ([[User talk:DSpider|talk]]) 14:41, 24 September 2012 (UTC)<br />
<br />
:::The link to Post-Installation was the last step of the guide, so that's the line I've replaced with the instructions from Post-Installation.<br />
:::About rebooting in case of a kernel upgrade, I don't think it's necessary to state that since this guide is aimed at experienced users.<br />
:::In any case, any reordering or modification of the various steps should better be approved by a Developer, and probably the forum or the mailing lists are better places than this talk page to involve them in such discussions.<br />
:::-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 14:59, 24 September 2012 (UTC)<br />
<br />
::::Yeah, but at this point, you were instructed to reboot. In order to edit {{ic|pacman.conf}}, you need to mount the root partition. And to update your system, you need to chroot into it. It would be better if "Unmount leftovers" was renamed "Unmount leftovers and reboot", and added at the end (before the suggestion to read the instructions from '''Extra'''). --[[User:DSpider|DSpider]] ([[User talk:DSpider|talk]]) 15:07, 24 September 2012 (UTC)<br />
<br />
:::::You are still instructed to reboot, aren't you? The "Unmount leftovers" section currently tells you to ''"reboot and then login into the new system with the root account"''. In the "new system", the correct partition is already mounted at /.<br />
:::::Whether or not configuring pacman, updating the system and adding a user would be better done in the chroot before rebooting, it's something that should be discussed with a Developer. I too think that it would make more sense, requiring one less reboot in case of a kernel upgrade.<br />
:::::-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 15:18, 24 September 2012 (UTC)<br />
:::::Renaming "Unmount leftovers" to "Unmount leftovers and reboot" is safe anyway, so I've done that. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 15:37, 24 September 2012 (UTC)<br />
:::::@DSpider: you're quite active on the forum, why don't you propose your idea there? I think it would be interesting to discuss it. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 14:11, 25 September 2012 (UTC)<br />
:::::Ok, after reading [https://wiki.archlinux.org/index.php?title=Talk%3AInstallation_Guide&diff=226203&oldid=225070 this] I realize that maybe I haven't been clear enough, so I'll try to explain everything more thoroughly.<br />
:::::#The current procedure makes you [[Installation_Guide#Configure_the_system|configure the system]] in the '''chroot''' environment from the '''live''' system.<br />
:::::#Then, still in the '''live''' system, it [[Installation_Guide#Unmount and reboot|asks]] you to '''exit''' the chroot, unmount the partitions for the '''new''' system, '''reboot''' and login into the '''new''' system. Now, I refuse to write more explicitly in the guide that you should boot into the '''new''' system, and not again in the '''live''' system, in order to login into the new system.<br />
:::::#Since you are now into the '''new''' system ('''not''' the live system), the root partition is mounted at {{ic|/}}, not at {{ic|/mnt/}}, so you should be able to configure pacman, update the system and add a user wihtout chrooting. Now, if you've tested the procedure and really noticed that for some obscure-to-me reason you still need to chroot to /mnt in order to do those operations, please ask for clarifications in the forum because I wouldn't be able to answer any more.<br />
:::::Last thing, and I think this is the 3rd or 4th time I write it, I '''agree''' with you that configuring pacman etc. could easily be done in the chroot environment at step 1, but you should '''propose''' that change '''in the forum''' first, since it would be a change in the official installation procedure and I won't take responsibility for that.<br />
:::::I think this is the best I can do here, the next step to explain all this could be making a movie or a five-act play, but I hope it's not necessary :)<br />
:::::-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 05:56, 30 September 2012 (UTC)<br />
<br />
== "Configure the network" is missing ==<br />
<br />
Basically, you establish an internet connection, but you also need to configure the network, so that you can connect after rebooting. The Beginners' Guide [[Beginners'_Guide#Configure_the_network|mentions]] it: ''You need to configure the network again, but this time for your newly installed environment. The procedure and prerequisites are very similar to the one described above, except we are going to make it persistent and automatically run at boot.'' And this information seems to be missing from the installation guide. --[[User:DSpider|DSpider]] ([[User talk:DSpider|talk]]) 13:51, 3 October 2012 (UTC)<br />
<br />
:I don't think that any Developer is watching this talk page, you'd better report this in the forum or mailing list. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 10:43, 4 October 2012 (UTC)<br />
<br />
::I'm not sure if this should be a part of the installation guide. -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 15:20, 29 October 2012 (UTC)<br />
<br />
:::Of course it should. Because after rebooting (which you are instructed to), you're left with a borked machine. You need to boot the installation media again, establish an internet connection, mount the partitions and chroot into your system, and only THEN install the required packages. There should at least be a line that mentions [[netcfg]]. Because I read that it can handle both wired and wireless connections, and it's included in {{Grp|base}} now. --[[User:DSpider|DSpider]] ([[User talk:DSpider|talk]]) 07:04, 30 October 2012 (UTC)<br />
::::I'm sorry if I'm missing something, but there is [https://wiki.archlinux.org/index.php/Installation_Guide#Connect_to_the_internet a line about netcfg already] and was there a month ago when this discussion was started. If you want to add a note that after rebooting the user has to enable dhcpcd service etc. (so he should have all the needed packages installed beforehand) that's fine with me. -- [[User:Karol|Karol]] ([[User talk:Karol|talk]]) 10:09, 30 October 2012 (UTC)<br />
<br />
== Install a bootloader ==<br />
<br />
Make it more visible that it is a choise between Grub/Syslinux.<br />
<br />
== 2 amendments to do ==<br />
<br />
In '''Configure the system''':<br />
<br />
There is only one link on<br />
''Add console keymap and font preferences in /etc/vconsole.conf''<br />
This link should apply only to "console keymap".<br><br />
"font preferences" should link to [[Fonts#Console_fonts]]<br />
<br />
<br />
There is also:<br />
''Uncomment the selected locale in /etc/locale.gen and generate it with locale-gen.''<br />
This should be removed as it has been already done during this step:<br />
''Set locale preferences in /etc/locale.conf.''<br />
<br />
Thanks and regards,<br />
[[User:Boism|Boism]] ([[User talk:Boism|talk]]) 21:10, 11 October 2012 (UTC)<br />
<br />
== The configuration and installation of GRUB in the boot sector is absent ==<br />
<br />
In the GRUB section the guide says:<br />
<br />
"Install GRUB after chrooting (refer to the #Configure the system section). "<br />
<br />
But isn't, and following the guide my system fail in the first startup, the lines to add in "Configure the system section" are:<br />
<br />
In the chroot:<br />
# grub-mkconfig > /boot/grub/grub.cfg<br />
# grub-install <device><br />
<br />
Or a comment like:<br />
<br />
* Configure and install GRUB using grub-mkconfig and grub-install, see [[Grub|GRUB page]] for more info<br />
<br />
== Mount the partitions ==<br />
<br />
Please also mention that if using a swap partition the user should execute swapon at the "Mount to partitions" step. It is important to do this so that the swap partition is included when generating the fstab later on in the guide.--[[User:Takaitra|Takaitra]] ([[User talk:Takaitra|talk]]) 17:13, 14 February 2013 (UTC)<br />
<br />
== add netctl to the mentioned ways of configuring network ==<br />
<br />
Since netctl is on it's way to replace netcfg we should at least mention its existance in the appropriate section.</div>Hachrehttps://wiki.archlinux.org/index.php?title=Chromium/Tips_and_tricks&diff=250000Chromium/Tips and tricks2013-03-09T20:13:06Z<p>Hachre: /* Profile in tmpfs */ Removed mention of chromium-tmpfs because it has been discontinued and is no longer available in AUR.</p>
<hr />
<div>[[Category:Web Browser]]<br />
[[zh-CN:Chromium Tips and Tweaks]]<br />
{{Article summary start}}<br />
{{Article summary text|Tips and Tweaks for Chromium are captured in this article.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Chromium}}<br />
{{Article summary wiki|Firefox Tweaks}}<br />
{{Article summary end}}<br />
<br />
== Browsing experience ==<br />
=== about:xxx ===<br />
A number of tweaks can be accessed via typing ''about:xxx'' in the URL field. A complete list is available by typing '''about:chrome-urls''' into the URL field. Some of note are listed below:<br />
<br />
* '''about:flags''' - access experimental features such as WebGL and rendering webpages with GPU, etc.<br />
* '''about:plugins''' - view, enable and disable the currently used Chromium plugins.<br />
* '''about:gpu-internals''' - status of different GPU options.<br />
* '''about:sandbox''' - indicate sandbox status.<br />
* '''about:version''' - display version and switches used to invoke the active {{ic|/usr/bin/chromium}}.<br />
<br />
An automatically updated, complete listing of Chromium switches is available [http://peter.sh/experiments/chromium-command-line-switches/ here].<br />
<br />
=== Broken icons in Download Tab ===<br />
If Chromium shows icon placeholders (icons representing broken documents) instead of appropriate icons in its download tab, the likely cause is that the {{Pkg|gnome-icon-theme}} package is not installed.<br />
<br />
=== Chromium overrides/overwrites Preferences file ===<br />
<br />
If you enabled syncing with a Google Account, then Chromium will tend to override any edits made by hand to the Preferences file found under {{ic|$HOME/.config/google-chrome/Default/Preferences}}. To work around this, start Chromium with the {{ic|--disable-sync-preferences}} switch:<br />
$ chromium --disable-sync-preferences<br />
<br />
If Chromium is started in the background when you login to your desktop environment, make sure the command your desktop environment uses is<br />
$ chromium --disable-sync-preferences --no-startup-window<br />
<br />
=== Memory usage ===<br />
Chromium offers some command-line options to help control how efficient it is with system memory, by determining how often it should release memory back to the operating system. It is done with the flag {{ic|1=--memory-model=X}}, where X is one of the following:<br />
<br />
* '''high''' - Never voluntarily relinquish memory.<br />
* '''medium''' - Voluntarily reduce working set when switching tabs.<br />
* '''low''' - Voluntarily reduce working set when switching tabs and also when the browser is not actively being used.<br />
<br />
It is also possible to manually force Chromium to purge its memory. The flag {{ic|--purge-memory-button}} enables a button in the task manager (available in ''Tools > Task Manager'', or by pressing {{keypress|Shift+Esc}}) to do this.<br />
<br />
=== Scroll speed of mouse wheel ===<br />
{{Note|1=As of 22-Feb-2013, this method is deprecate upstream. See [https://code.google.com/p/chromium/issues/detail?id=154776 this].}}<br />
{{AUR|chromium-scroll-pixels}} in the AUR reverses this patch.<br />
<br />
[https://wiki.archlinux.org/index.php/User:Graysky Graysky] provides this package compiled for x86_64 only on his unofficial repo, [[Repo-ck]].<br />
<br />
The following switch can be used to set the scroll speed of the wheel mouse: {{ic|--scroll-pixels&#61;X}}<br />
<br />
$ chromium --scroll-pixels=320<br />
<br />
=== Search Engines ===<br />
Make sites like wiki.archlinux.org and wikipedia.org easily searchable by first executing a search on those pages, then going to ''Settings > Search'' and click the ''Manage search engines..'' button. From there, "Edit" the Wikipedia entry and change its keyword to "w" (or some other shortcut you prefer). Now searching Wikipedia for "Arch Linux" from the address bar is done simply by entering "w arch linux".<br />
<br />
{{Note| Google search is used automatically when typing something into the URL bar. A hard-coded keyword trigger is also available using the '''?''' prefix.}}<br />
<br />
=== Tmpfs ===<br />
==== Cache in tmpfs ====<br />
{{Note|Chromium actually keeps its cache directory '''separate''' from its browser profile directory.}}<br />
<br />
To limit Chromium from writing its cache to a physical disk, one can define an alternative location via the {{ic|1=--disk-cache-dir=/foo/bar}} flag:<br />
$ chromium --disk-cache-dir=/tmp/cache<br />
<br />
Cache should be considered temporary and will '''not''' be saved after a reboot or hard lock.<br />
<br />
Alternative way, in {{ic|/etc/fstab}}:<br />
tmpfs /home/<USER>/.cache tmpfs noatime,nodev,nosuid,size=400M 0 0<br />
<br />
{{Note|Adjust the size as needed.}}<br />
<br />
==== Profile in tmpfs ====<br />
Relocate the browser profile to a [[Wikipedia:Tmpfs|tmpfs]] filesystem, including {{ic|/tmp}}, or {{ic|/dev/shm}} for improvements in application response as the entire profile is now stored in RAM.<br />
<br />
Use an active profile management script for maximal reliability and ease of use.<br />
<br />
{{AUR|profile-sync-daemon}} is such a script and is directly available from the [[AUR]]. It symlinks and syncs the browser profile directories to RAM. Refer to the [[Profile-sync-daemon]] wiki article for additional information on it.<br />
<br />
==Profile Maintenance ==<br />
Chromium uses [[Sqlite]] databases to manage history and the like. Sqlite databases become fragmented over time and empty spaces appear all around. But, since there are no managing processes checking and optimizing the database, these factors eventually result in a performance hit. A good way to improve startup and some other bookmarks and history related tasks is to defragment and trim unused space from these databases.<br />
<br />
{{AUR|profile-cleaner}} and {{AUR|browser-vacuum}} in the [[AUR]] do just this.<br />
<br />
== Security ==<br />
=== Run in a Sandbox ===<br />
Run chromium in a sandbox for added security:<br />
$ chromium --enable-seccomp-sandbox<br />
<br />
=== User Agent===<br />
By default Chromium already sends an excessively detailed User Agent, as is viewable via the EFF's [https://panopticlick.eff.org/ Panopticlick] test. That alone makes each browser readily identifiable with high accuracy — and is further exacerbated by the use of non-stable versions, ones not recently provided by Google's release channels, ones customized e.g. by a distribution (such as the AUR's {{AUR|chromium-browser-ppa}}), etc.<br />
<br />
However, this User Agent can be arbitrarily modified at the start of Chromium's base instance via its {{Ic|<nowiki>--user-agent="[string]"</nowiki>}} parameter.<br />
<br />
For the same User Agent as the stable Chrome release for Linux i686 (at the time of writing the most popular Linux edition of Chrome) one would use:<br />
--user-agent="Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11"<br />
<br />
An official, automatically updated listing of Chromium releases which also shows the included WebKit version is available as the [https://omahaproxy.appspot.com/ OmahaProxy Viewer].<br />
<br />
=== Making it all persistent ===<br />
You can export your flags from {{ic|~/.profile}}:<br />
export CHROMIUM_USER_FLAGS="--disk-cache-dir=/tmp --disk-cache-size=50000000"<br />
<br />
Or add them to {{ic|/etc/chromium/default}}:<br />
{{bc|<nowiki><br />
# Default settings for chromium. This file is sourced by /usr/bin/chromium<br />
#<br />
# Options to pass to chromium<br />
CHROMIUM_FLAGS="--scroll-pixels=200"</nowiki><br />
}}<br />
<br />
Chromium will prefer the user defined flags in {{ic|CHROMIUM_USER_FLAGS}} to those defined in {{ic|/etc/chromium/default}}.<br />
<br />
=== SSL Certificates ===<br />
Unfortunately, Chromium doesn't have a SSL certificate manager. It relies on the NSS Shared DB {{ic|~/.pki.nssdb}}. In order to add SSL certificates to the database, users will have to use the shell. <br />
<br />
==== Adding CAcert Certificates for Self-Signed Certificates ====<br />
Grab the CAcerts and create a nssdb if one does not already exist. To do this, first install the {{Pkg|nss}} package, then complete these steps:<br />
{{bc|<nowiki>[[ ! -e $HOME/.pki/nssdb ]] && mkdir -p $HOME/.pki/nssdb && cd $HOME/.pki/nssdb && certutil -N -d sql:.</nowiki>}}<br />
{{Note|Users will need to create a password for the database should it not exist.}}<br />
<br />
{{bc|<nowiki>curl -k -o "cacert-root.crt" "http://www.cacert.org/certs/root.crt"<br />
curl -k -o "cacert-class3.crt" "http://www.cacert.org/certs/class3.crt"<br />
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org" -i cacert-root.crt <br />
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "CAcert.org Class 3" -i cacert-class3.crt<br />
</nowiki>}}<br />
<br />
{{Note|Users will need to create a password for the database should it not exist.}}<br />
<br />
Now users may manually import a self-signed certificate.<br />
<br />
==== Example 1: Using a Shell Script Isolate the Certificate from TomatoUSB ====<br />
Below is a simple script that will extract and add a certificate to the user's nssdb:<br />
<br />
#!/bin/sh<br />
#<br />
# usage: import-cert.sh remote.host.name [port]<br />
#<br />
REMHOST=$1<br />
REMPORT=${2:-443}<br />
exec 6>&1<br />
exec > $REMHOST<br />
echo | openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 |sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'<br />
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "$REMHOST" -i $REMHOST <br />
exec 1>&6 6>&-<br />
<br />
Syntax is advertised in the commented lines.<br />
<br />
Reference:<br />
*http://blog.avirtualhome.com/adding-ssl-certificates-to-google-chrome-linux-ubuntu<br />
<br />
==== Example 2: Using Firefox to Isolate the Certificate from TomatoUSB ====<br />
The {{Pkg|firefox}} browser can used to save the certificate to a file for manunal import into the DB.<br />
<br />
Using firefox:<br />
#Browse to the target URL.<br />
#Upon seeing the "This Connection is Untrusted" warning screen, click I understand the Risks>Add Exception...<br />
#Click View>Details>Export and save the certificate to a temporary location ({{ic|/tmp/easy.pem}} in this example).<br />
<br />
Now import the certificate for use in Chromium:<br />
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "easy" -i /tmp/easy.pem<br />
<br />
{{Note|Adjust the name to match that of the certificate. In the example above, "easy" is the name on the certificate.}}<br />
<br />
Reference:<br />
*http://sahissam.blogspot.com/2012/06/new-ssl-certificates-for-tomatousb-and.html</div>Hachrehttps://wiki.archlinux.org/index.php?title=Pacman/Tips_and_tricks&diff=249922Pacman/Tips and tricks2013-03-08T15:20:13Z<p>Hachre: /* Removing orphaned packages */: Alias example didn't escape a $ sign in the sed command</p>
<hr />
<div>[[Category:Package management]]<br />
[[es:Pacman Tips]]<br />
[[it:Pacman Tips]]<br />
[[ru:Pacman Tips]]<br />
[[tr:Pacman_ipuçları]]<br />
[[zh-CN:Pacman Tips]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|This is a collection of common tips for new pacman users.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|pacman}}<br />
{{Article summary wiki|Mirrors}}<br />
{{Article summary wiki|Creating Packages}}<br />
{{Article summary wiki|Custom local repository}}<br />
{{Article summary end}}<br />
<br />
== Cosmetic and Convienence ==<br />
<br />
=== Color output ===<br />
<br />
The most effective method of colorizing pacman is installing {{AUR|pacman-color}} from the [[AUR]].<br />
<br />
{{Note|The package installs a separate pacman binary patched for colored output ({{ic|pacman-color}})}}<br />
<br />
=== Shortcuts ===<br />
<br />
The following instructions allow users to run some of the more common pacman commands without the need to type them fully via a script alias.<br />
<br />
==== Configure the shell ====<br />
<br />
Add the following examples, which work in both [[Bash]] and [[Zsh]]:<br />
{{bc|<nowiki> # Pacman alias examples<br />
alias pacupg='sudo pacman -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.<br />
alias pacin='sudo pacman -S' # Install specific package(s) from the repositories<br />
alias pacins='sudo pacman -U' # Install specific package not from the repositories but from a file <br />
alias pacre='sudo pacman -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies<br />
alias pacrem='sudo pacman -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies<br />
alias pacrep='pacman -Si' # Display information about a given package in the repositories<br />
alias pacreps='pacman -Ss' # Search for package(s) in the repositories<br />
alias pacloc='pacman -Qi' # Display information about a given package in the local database<br />
alias paclocs='pacman -Qs' # Search for package(s) in the local database<br />
<br />
# Additional pacman alias examples<br />
alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories<br />
alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package<br />
alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist<br />
</nowiki>}}<br />
<br />
==== Usage ====<br />
<br />
Perform the respective commands by simply typing the alias name. For example, to synchronize with repositories before upgrading packages that are out of date on the local system:<br />
$ pacupg<br />
Install packages from repositories:<br />
$ pacin <package1> <package2> <package3><br />
Install a custom built package:<br />
$ pacins /path/to/<package><br />
Completely remove a locally installed package:<br />
$ pacrem <package><br />
Search for available packages in the repositories:<br />
$ pacreps <keywords><br />
Display information about a package (e.g. size, dependencies) in the repositories:<br />
$ pacrep <keywords><br />
<br />
==== Notes ====<br />
<br />
The aliases used above are merely examples. By following the syntax samples above, rename the aliases as convenient. For example:<br />
<br />
alias pacrem='sudo pacman -Rns'<br />
alias pacout='sudo pacman -Rns'<br />
<br />
In the case above, the commands {{ic|pacrem}} and {{ic|pacout}} both call your shell to execute the same command.<br />
<br />
=== Operations and Bash syntax ===<br />
<br />
In addition to pacman's standard set of features, there are ways to extend its usability through rudimentary [[Bash]] commands/syntax.<br />
<br />
* To install a number of packages sharing similar patterns in their names -- not the entire group nor all matching packages; eg. {{Pkg|kde}}:<br />
<br />
# pacman -S kde-{applets,theme,tools}<br />
<br />
* Of course, that is not limited and can be expanded to however many levels needed:<br />
<br />
# pacman -S kde-{ui-{kde,kdemod},kdeartwork}<br />
<br />
* Sometimes, {{Ic|-s}}'s builtin ERE can cause a lot of unwanted results, so it has to be limited to match the package name only; not the description nor any other field:<br />
<br />
# pacman -Ss '^vim-'<br />
<br />
* pacman has the {{ic|-q}} operand to hide the version column, so it is possible to query and reinstall packages with "compiz" as part of their name:<br />
<br />
# pacman -S $(pacman -Qq | grep compiz)<br />
<br />
== Maintenance ==<br />
<br />
''House keeping, in the interest of keeping a clean system and following [[The Arch Way]]''<br />
<br />
=== Selectively clean cache ===<br />
<br />
* Use {{ic|paccache}} from {{pkg|pacman-contrib}} to clean the {{ic|/var/cache/pacman/pkg}} directory while allowing to specify how many package versions should be retained (default is 3):<br />
<br />
paccache -rv<br />
<br />
To list all the options:<br />
<br />
{{ic|paccache -h}}<br />
<br />
=== Listing all installed packages with size ===<br />
<br />
* You may want to get the list of installed packages sorted by size, which may be useful when freeing space on your hard drive.<br />
pacman -Qi | awk '/^Name/ {pkg=$3} /Size/ {print $4$5,pkg}' | sort -n<br />
* Use {{ic|pacsysclean}} from {{Pkg|pacman-contrib}} package.<br />
* Install {{Pkg|expac}} and run {{ic| expac -s "%-30n %m" | sort -rhk 2}}<br />
* Invoke pacgraph with the -c option to produce a list of all installed packages with their respective sizes on the system. Pacgraph is available from [community].<br />
<br />
=== Identify files not owned by any package ===<br />
<br />
Periodic checks for files outside of pacman database are recommended. These files are often some 3rd party applications installed using the usual procedure (e.g. {{ic|./configure && make && make install}}). Search the file-system for these files (or symlinks) using this simple script:<br />
<br />
{{hc|pacman-disowned|<nowiki><br />
#!/bin/sh<br />
<br />
tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$<br />
db=$tmp/db<br />
fs=$tmp/fs<br />
<br />
mkdir "$tmp"<br />
trap 'rm -rf "$tmp"' EXIT<br />
<br />
pacman -Qlq | sort -u > "$db"<br />
<br />
find /bin /etc /lib /sbin /usr \<br />
! -name lost+found \<br />
\( -type d -printf '%p/\n' -o -print \) | sort > "$fs"<br />
<br />
comm -23 "$fs" "$db"</nowiki>}}<br />
<br />
To generate the list:<br />
<br />
$ pacman-disowned > non-db.txt<br />
<br />
Note that one should '''not''' delete all files listed in {{ic|non-db.txt}} without confirming each entry. There could be various configuration files, logs, etc., so use this list responsibly and only proceed after extensively searching for cross-references using {{Ic|grep}}.<br />
<br />
=== Removing orphaned packages ===<br />
<br />
For ''recursively'' removing orphans:<br />
<br />
{{bc|# pacman -Rs $(pacman -Qtdq)}}<br />
<br />
The following '''alias''' is easily inserted into {{ic|~/.bashrc}} and removes orphans if found:<br />
<br />
{{hc|~/.bashrc|<nowiki># '[r]emove [o]rphans' - recursively remove ALL orphaned packages<br />
alias pacro="/usr/bin/pacman -Qtdq &gt; /dev/null &amp;&amp; sudo /usr/bin/pacman -Rs \$(/usr/bin/pacman -Qtdq | sed -e ':a;N;\$!ba;s/\n/ /g')"</nowiki>}}<br />
<br />
The following '''function''' is easily inserted into {{ic|~/.bashrc}} and removes orphans if found:<br />
<br />
{{hc|~/.bashrc|<nowiki><br />
orphans() {<br />
if [[ ! -n $(pacman -Qdt) ]]; then<br />
echo "No orphans to remove."<br />
else<br />
sudo pacman -Rs $(pacman -Qdtq)<br />
fi<br />
}</nowiki>}}<br />
<br />
=== Removing everything but base group ===<br />
<br />
If it is ever necessary to remove all packages except the base group, try this one liner:<br />
<br />
# pacman -Rs $(comm -23 <(pacman -Qeq|sort) <((for i in $(pacman -Qqg base); do pactree -ul $i; done)|sort -u|cut -d ' ' -f 1))<br />
<br />
Source: [https://bbs.archlinux.org/viewtopic.php?id=130176 Look at discussion here]<br />
<br />
Notes:<br />
<br />
# {{ic|comm}} requires sorted input otherwise you get e.g. {{ic|comm: file 1 is not in sorted order}}.<br />
# {{ic|pactree}} prints the package name followed by what it provides. For example:<br />
<br />
{{hc|$ pactree -lu logrotate|<br />
logrotate<br />
popt<br />
glibc<br />
linux-api-headers<br />
tzdata<br />
dcron cron<br />
bash<br />
readline<br />
ncurses<br />
gzip}}<br />
<br />
The {{ic|dcron cron}} line seems to cause problems, that is why {{ic|cut -d ' ' -f 1}} is needed - to keep just the package name.<br />
<br />
=== Listing official installed packages only ===<br />
<br />
pacman -Qq |grep -Fv -f <(pacman -Qqm)<br />
<br />
=== Getting the dependencies list of several packages ===<br />
<br />
Dependencies are alphabetically sorted and doubles are removed.<br />
Note that you can use {{ic|pacman -Qi}} to improve response time a little. But<br />
you won't be able to query as many packages. Unfound packages are simply skipped<br />
(hence the {{ic|2>/dev/null}}).<br />
You can get dependencies of AUR packages as well if you use {{ic|yaourt -Si}},<br />
but it will slow down the queries.<br />
<br />
$ pacman -Si $@ 2>/dev/null | awk -F ": " -v filter="^Depends" \ '$0 ~ filter {gsub(/[>=<][^ ]*/,"",$2) ; gsub(/ +/,"\n",$2) ; print $2}' | sort -u<br />
<br />
Alternatively, you can use {{ic|expac}}: {{ic|expac -l '\n' %E -S $@ &#124; sort -u}}.<br />
<br />
=== Getting the size of several packages ===<br />
<br />
You can use (and tweak) this little shell function:<br />
<br />
{{hc|~/.bashrc|<nowiki><br />
pacman-size()<br />
{<br />
CMD="pacman -Si"<br />
SEP=": "<br />
TOTAL_SIZE=0<br />
<br />
RESULT=$(eval "${CMD} $@ 2>/dev/null" | awk -F "$SEP" -v filter="^Size" -v pkg="^Name" \<br />
'$0 ~ pkg {pkgname=$2} $0 ~ filter {gsub(/\..*/,"") ; printf("%6s KiB %s\n", $2, pkgname)}' | sort -u -k3)<br />
<br />
echo "$RESULT"<br />
<br />
## Print total size.<br />
echo "$RESULT" | awk '{TOTAL=$1+TOTAL} END {printf("Total : %d KiB\n",TOTAL)}'<br />
}</nowiki>}}<br />
<br />
As told for the dependencies list, you can use {{ic|pacman -Qi}} instead, but<br />
not [[yaourt]] since AUR's PKGBUILD do not have size information.<br />
<br />
A nice one-liner:<br />
<br />
$ pacman -Si "$@" 2>/dev/null" | awk -F ": " -v filter="Size" -v pkg="Name" \ '$0 ~ pkg {pkgname=$2} $0 ~ filter {gsub(/\..*/,"") ; printf("%6s KiB %s\n", $2, pkgname)}' | sort -u -k3 \ | tee >(awk '{TOTAL=$1+TOTAL} END {printf("Total : %d KiB\n",TOTAL)}')<br />
<br />
You should replace "$@" with packages, or put this line in a shell function.<br />
<br />
=== Listing changed configuration files ===<br />
If you want to backup your system configuration files you could copy all files in {{ic|/etc/}}, but usually you're only interested in the files that you have changed. In this case you want to list those changed configuration files, we can do this with the following command:<br />
# pacman -Qii | awk '/^MODIFIED/ {print $2}'<br />
The following script does the same. You need to run it as root or with sudo.<br />
{{hc|changed-files.sh|<nowiki><br />
#!/bin/bash<br />
for package in /var/lib/pacman/local/*; do<br />
sed '/^%BACKUP%$/,/^%/!d' $package/files | tail -n+2 | grep -v '^$' | while read file hash; do<br />
[ "$(md5sum /$file | (read hash file; echo $hash))" != "$hash" ] && echo $(basename $package) /$file<br />
done<br />
done<br />
</nowiki>}}<br />
<br />
=== Listing all packages that nothing else depends on ===<br />
If you want to generate a list of all installed packages that nothing else depends on, you can use the following script. This is very helpful if you are trying to free hard drive space and have installed a lot of packages that you may not remember. You can browse through the output to find packages which you no longer need.<br />
<br />
{{hc|clean|<nowiki><br />
#!/bin/bash<br />
<br />
# This script is designed to help you clean your computer from unneeded<br />
# packages. The script will find all packages that no other installed package<br />
# depends on. It will output this list of packages excluding any you have<br />
# placed in the ignore list. You may browse through the script's output and<br />
# remove any packages you do not need.<br />
<br />
# Enter groups and packages here which you know you wish to keep. They will<br />
# not be included in the list of unrequired packages later.<br />
ignoregrp="base base-devel"<br />
ignorepkg=""<br />
<br />
# Temporary file locations<br />
tmpdir=/tmp<br />
ignored=$tmpdir/ignored<br />
installed=$tmpdir/installed<br />
<br />
# Generate list of installed packages and packages you wish to keep.<br />
echo $(pacman -Sg $ignoregrp | awk '{print $2}') $ignorepkg | tr ' ' '\n' | sort | uniq > $ignored<br />
pacman -Qq | sort > $installed<br />
<br />
# Do not loop packages you are keeping<br />
loop=$(comm -13 $ignored $installed)<br />
<br />
# Check each remaining package. If package is not required by anything and<br />
# is not on your ignore list, print the package name to the screen.<br />
for line in $loop; do<br />
check=$(pacman -Qi $line | awk '/Required By/ {print $4}')<br />
if [ "$check" == 'None' ]; then echo $line; fi<br />
done<br />
<br />
# Clean up $tmpdir<br />
rm $ignored $installed<br />
</nowiki>}}<br />
<br />
If you install {{pkg|expac}} you can run {{ic|<nowiki>expac "%n %N" -Q $(expac "%n %G" | grep -v ' base') | awk '$2 == "" {print $1}'</nowiki>}} which should give the same results but much faster.<br />
<br />
=== Backing up Local database with Systemd ===<br />
<br />
[https://wiki.archlinux.org/index.php/Systemd Systemd] can take snapshots of the pacman local database everytime it is modified.<br />
<br />
{{Tip| Save the following script as {{ic|/usr/lib/systemd/scripts/pakbak_script}}.}}<br />
{{Note| Change the value of {{ic|$pakbak}} to modify where the backed up database is stored.}}<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
declare -r pakbak="/pakbak.bz2"; ## set backup location<br />
tar -cjf "$pakbak" "/var/lib/pacman/local"; ## compress & store pacman local database in $pakbak<br />
</nowiki>}}<br />
<br />
{{Tip|Save the following [https://wiki.archlinux.org/index.php/Systemd#Writing_custom_.service_files service file] as {{ic|/usr/lib/systemd/system/pakbak.service}}.}}<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=Back up pacman database<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/bin/bash /usr/lib/systemd/scripts/pakbak_script<br />
RemainAfterExit=no<br />
</nowiki>}}<br />
<br />
{{Tip|Save the following [https://wiki.archlinux.org/index.php/Systemd#Writing_custom_.service_files path] file as {{ic|/usr/lib/systemd/system/pakbak.path}}.}}<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=Back up pacman database<br />
<br />
[Path]<br />
PathChanged=/var/lib/pacman/local<br />
Unit=pakbak.service<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{Tip|To start the backup service :<br />
{{bc|<nowiki><br />
# systemctl start pakbak.path<br />
</nowiki>}}<br />
To enable the backup service automatically on reboot :<br />
{{bc|<nowiki><br />
# systemctl enable pakbak.path<br />
</nowiki>}}<br />
}}<br />
<br />
== Installation and recovery ==<br />
<br />
''Alternative ways of getting and restoring packages.''<br />
<br />
=== Installing packages from a CD/DVD or USB stick ===<br />
<br />
To download packages, or groups of packages:<br />
<br />
# cd ~/Packages<br />
# pacman -Syw base base-devel grub-bios xorg gimp --cachedir .<br />
# repo-add ./custom.db.tar.gz ./*<br />
<br />
Then you can burn the "Packages" folder to a CD/DVD or transfer it to a USB stick, external HDD, etc.<br />
<br />
To install:<br />
<br />
'''1.''' Mount the media:<br />
<br />
# mkdir /mnt/repo<br />
# mount /dev/sr0 /mnt/repo #For a CD/DVD.<br />
# mount /dev/sdxY /mnt/repo #For a USB stick.<br />
<br />
'''2.''' Edit {{ic|pacman.conf}} and add this repository ''before'' the other ones (e.g. extra, core, etc.). This is important. Don't just uncomment the one on the bottom. This way it ensures that the files from the CD/DVD/USB take precedence over those in the standard repositories:<br />
<br />
{{hc|# nano /etc/pacman.conf|2=<br />
[custom]<br />
SigLevel = PackageRequired<br />
Server = file:///mnt/repo/Packages}}<br />
<br />
'''3.''' Finally, synchronize the pacman database to be able to use the new repository:<br />
<br />
# pacman -Sy<br />
<br />
=== Custom local repository ===<br />
<br />
pacman 3 introduced a new script named {{ic|repo-add}} which makes generating a database for a personal repository much easier. Use {{ic|repo-add --help}} for more details on its usage.<br />
<br />
Simply store all of the built packages to be included in the repository in one directory, and execute the following command (where ''repo'' is the name of the custom repository):<br />
<br />
$ repo-add /path/to/repo.db.tar.gz /path/to/*.pkg.tar.xz<br />
<br />
Note that when using {{ic|repo-add}}, the database and the packages do not need to be in the same directory. But when using pacman with that database, they should be together.<br />
<br />
To add a new package (and remove the old if it exists), run:<br />
<br />
$ repo-add /path/to/repo.db.tar.gz /path/to/packagetoadd-1.0-1-i686.pkg.tar.xz<br />
<br />
{{Note|If there is a package that needs to be removed from the repository, read up on {{Ic|repo-remove}}.}}<br />
<br />
Once the local repository has been made, add the repository to {{ic|pacman.conf}}. The name of the {{ic|db.tar.gz}} file is the repository name. Reference it directly using a {{ic|file://}} url, or access it via FTP using ftp://localhost/path/to/directory.<br />
<br />
If willing, add the custom repository to the [[Unofficial user repositories|list of unofficial user repositories]], so that the community can benefit from it.<br />
<br />
=== Network shared pacman cache ===<br />
<br />
{{Tip|See [http://xyne.archlinux.ca/projects/pacserve/ pacserve] for an alternative (and probably simpler) solution.}}<br />
<br />
In order to share packages between multiple computers, simply share {{ic|/var/cache/pacman/}} using any network-based mount protocol. This section shows how to use shfs or sshfs to share a package cache plus the related library-directories between multiple computers on the same local network. Keep in mind that a network shared cache can be slow depending on the file-system choice, among other factors.<br />
<br />
First, install any network-supporting filesystem; for example [[sshfs]], [[shfs]], [[ftpfs]], [[smbfs]] or [[nfs]].<br />
<br />
{{Tip|To use sshfs or shfs, consider reading [[Using SSH Keys]].}}<br />
<br />
Then, to share the actual packages, mount {{ic|/var/cache/pacman/pkg}} from the server to {{ic|/var/cache/pacman/pkg}} on every client machine.<br />
<br />
To have shared package databases, mount {{ic|/var/lib/pacman/sync/{core,extra,testing,community} }} in the same way. Proceed to place the appropriate lines in {{ic|/etc/fstab}}.<br />
<br />
==== Preventing unwanted cache purges ====<br />
<br />
By default, {{Ic|pacman -Sc}} removes package tarballs from the cache that correspond to packages that are not installed on the machine the command was issued on. Because pacman cannot predict what packages are installed on all machines that share the cache, it will end up deleting files that should not be.<br />
<br />
To clean up the cache so that only ''outdated'' tarballs are deleted, add this entry in the {{ic|[options]}} section of {{ic|/etc/pacman.conf}}:<br />
<br />
CleanMethod = KeepCurrent<br />
<br />
=== Backing up and retrieving a list of installed packages ===<br />
<br />
It is good practice to keep periodic backups of all pacman-installed packages. In the event of a system crash which is unrecoverable by other means, pacman can then easily reinstall the very same packages onto a new installation.<br />
<br />
* First, backup the current list of non-local packages:<br />
<br />
: $ comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) > pkglist.txt<br />
<br />
* Store the {{ic|pkglist.txt}} on a USB key or other convenient medium or gist.github.com or Evernote, Dropbox, etc.<br />
<br />
* Copy the {{ic|pkglist.txt}} file to the new installation, and navigate to the directory containing it.<br />
<br />
* Issue the following command to install from the backup list:<br />
<br />
: # pacman -S $(< pkglist.txt)<br />
<br />
In the case you have a list which was not generated like mentioned above, there may be foreign packages in it (i.e. packages not belonging to any repos you have configured, or packages from the AUR).<br />
<br />
In such a case, you may still want to install all available packages from that list:<br />
<br />
# pacman -S --needed $(comm -12 <(pacman -Slq|sort) <(sort badpkdlist) )<br />
<br />
Explanation:<br />
<br />
* {{ic|pacman -Slq}} lists all available softwares, but the list is sorted by repository first, hence the {{ic|sort}} command.<br />
* Sorted files are required in order to make the {{ic|comm}} command work.<br />
* The {{ic|-12}} parameter display lines common to both entries.<br />
* The {{ic|--needed}} switch is used to skip already installed packages.<br />
<br />
You may also try to install all unavailable packages (those not in the repos) from the AUR using [[yaourt]] (not recommended unless you know exactly what you are doing):<br />
<br />
$ yaourt -S --needed $(comm -13 <(pacman -Slq|sort) <(sort badpkdlist) )<br />
<br />
Finally, you may want to remove all the packages on your system that are not mentioned in the list.<br />
<br />
{{Warning|Use this command wisely, and always check the result prompted by pacman.}}<br />
<br />
# pacman -Rsu $(comm -23 <(pacman -Qq|sort) <(sort pkglist))<br />
<br />
=== List downloaded packages that are not in base or base-devel ===<br />
<br />
The following command will list any installed packages that are not in base/base-devel, and as such were likely installed manually by the user:<br />
<br />
$ comm -23 <(pacman -Qeq|sort) <(pacman -Qgq base base-devel|sort)<br />
<br />
=== Reinstalling all installed packages ===<br />
<br />
If you mess up your system ({{ic|rm -rf}}) you can repair by having pacman reinstall all of your packages. <br />
<br />
If your system does not contain any foreign (AUR) packages you can run:<br />
<br />
# pacman -Qeq | pacman -S -<br />
<br />
Pacman preserves the installation reason by default.<br />
<br />
If you have foreign packages this will error as packages will not be found in the repositories. The following will make a list of all packages and remove the foreign packages seen with {{ic|pacman -Qmq}}. Combining a command to list all packages, and another to hide the list of foreign packages is required.<br />
<br />
The following will reinstall every package found in the repositories:<br />
<br />
# comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) | pacman -S -<br />
<br />
=== Restore pacman's local database ===<br />
<br />
Signs that pacman needs a local database restoration:<br />
<br />
* {{ic|pacman -Q}} gives absolutely no output, and {{Ic|pacman -Syu}} erroneously reports that the system is up to date.<br />
* When trying to install a package using {{ic|pacman -S package}}, and it outputs a list of already satisfied dependencies.<br />
* When {{ic|testdb}} (part of {{Pkg|pacman}}) reports database inconsistency.<br />
<br />
Most likely, pacman's database of installed software, {{ic|/var/lib/pacman/local}}, has been corrupted or deleted. While this is a serious problem, it can be restored by following the instructions below.<br />
<br />
Firstly, make sure pacman's log file is present:<br />
<br />
$ ls /var/log/pacman.log<br />
<br />
If it does not exist, it is ''not'' possible to continue with this method. You may be able to use [https://bbs.archlinux.org/viewtopic.php?pid=670876 Xyne's package detection script] to recreate the database. If not, then the likely solution is to re-install the entire system.<br />
<br />
==== Log filter script ====<br />
<br />
You need to install '''paclog-pkglist''' from {{Pkg|pacman-contrib}} and create following script:<br />
<br />
{{hc|pacrecover|<nowiki><br />
#!/bin/bash -e<br />
<br />
. /etc/makepkg.conf<br />
<br />
PKGCACHE=$((grep -m 1 '^CacheDir' /etc/pacman.conf || echo 'CacheDir = /var/cache/pacman/pkg') | sed 's/CacheDi$<br />
<br />
pkgdirs=("$@" "$PKGDEST" "$PKGCACHE")<br />
<br />
while read -r -a parampart; do<br />
pkgname="${parampart[0]}-${parampart[1]}-*.pkg.tar.xz"<br />
for pkgdir in ${pkgdirs[@]}; do<br />
pkgpath="$pkgdir"/$pkgname<br />
[ -f $pkgpath ] && { echo $pkgpath; break; };<br />
done || echo ${parampart[0]} 1>&2<br />
done<br />
</nowiki>}}<br />
<br />
Make the script executable:<br />
<br />
$ chmod +x pacrecover<br />
<br />
==== Generating the package recovery list ====<br />
<br />
{{Warning|If for some reason your [[pacman]] cache or [[makepkg]] package destination contain packages for other architectures, remove them before continuation.}}<br />
<br />
Run the script (optionally passing additional directories with packages as parameters):<br />
<br />
$ paclog-pkglist /var/log/pacman.log | ./pacrecover >files.list 2>pkglist.orig<br />
<br />
This way two files will be created: {{Ic|files.list}} with package files, still present on machine and {{Ic|pkglist.orig}}, packages from which should be downloaded. Later operation may result in mismatch between files of older versions of package, still present on machine, and files, found in new version. Such mismatches will have to be fixed manually.<br />
<br />
Here is a way to automatically restrict second list to packages available in a repository:<br />
<br />
$ { cat pkglist.orig; pacman -Slq; } | sort | uniq -d > pkglist<br />
<br />
Check if some important ''base'' package are missing, and add them to the list:<br />
<br />
$ comm -23 <(pacman -Sgq base) pkglist.orig >> pkglist<br />
<br />
Proceed once the contents of both lists are satisfactory, since they will be used to restore pacman's installed package database; {{ic|/var/lib/pacman/local/}}.<br />
<br />
==== Performing the recovery ====<br />
<br />
Define bash alias for recovery purposes:<br />
<br />
# recovery-pacman() {<br />
pacman "$@" \<br />
--log /dev/null \<br />
--noscriptlet \<br />
--dbonly \<br />
--force \<br />
--nodeps \<br />
--needed \<br />
#<br />
}<br />
<br />
{{ic|--log /dev/null}} allows to avoid needless pollution of pacman log, {{Ic|--needed}} will save some time by skipping packages, already present in database, {{Ic|--nodeps}} will allow installation of cached packages, even if packages being installed depend on newer versions. Rest of options will allow '''pacman''' to operate without reading/writing filesystem.<br />
<br />
Populate the sync database:<br />
<br />
# pacman -Sy<br />
<br />
Start database generation by installing locally available package files from {{ic|files.list}}:<br />
<br />
# recovery-pacman -U $(< files.list)<br />
<br />
Install the rest from {{ic|pkglist}}:<br />
<br />
# recovery-pacman -S $(< pkglist)<br />
<br />
Update the local database so that packages that are not required by any other package are marked as explicitly installed and the other as dependences. You will need be extra careful in the future when removing packages, but with the original database lost is the best we can do.<br />
<br />
# pacman -D --asdeps $(pacman -Qq)<br />
# pacman -D --asexplicit $(pacman -Qtq)<br />
<br />
Optionally check all installed packages for corruption:<br />
<br />
# pacman -Qk<br />
<br />
Optionally [[#Identify files not owned by any package]].<br />
<br />
Update all packages:<br />
<br />
# pacman -Su<br />
<br />
=== Recovering a USB key from existing install ===<br />
<br />
If you have Arch installed on a USB key and manage to mess it up (e.g. removing it while it is still being written to), then it is possible to re-install all the packages and hopefully get it back up and working again (assuming USB key is mounted in /newarch)<br />
<br />
# pacman -S $(pacman -Qq --dbpath /newarch/var/lib/pacman) --root /newarch --dbpath /newarch/var/lib/pacman<br />
<br />
=== Extracting contents of a .pkg file ===<br />
<br />
The {{ic|.pkg}} files ending in {{ic|.xz}} are simply tar'ed archives that can be decompressed with:<br />
<br />
$ tar xvf package.tar.xz<br />
<br />
If you want to extract a couple of files out of a {{ic|.pkg}} file, this would be a way to do it.<br />
<br />
=== Viewing a single file inside a .pkg file ===<br />
<br />
For example, if you want to see the contents of {{ic|/etc/conf.d/ntpd.conf}} supplied within the {{Pkg|ntp}} package:<br />
<br />
$ tar -xOf /var/cache/pacman/pkg/ntp-4.2.6.p5-6-i686.pkg.tar.xz etc/conf.d/ntpd.conf<br />
Or you can use vim, then browse the archive:<br />
$ vim /var/cache/pacman/pkg/ntp-4.2.6.p5-6-i686.pkg.tar.xz</div>Hachre