Warning: THE VOID WIKI IS DEPRECATED. It is no longer being maintained, contains outdated and incorrect information, and will eventually be shut down. Please refer to the Void Handbook, https://docs.voidlinux.org/, for the official documentation. If you can't find the information you're seeking, please raise an issue at https://github.com/void-linux/void-docs/issues

Difference between revisions of "Post Installation"

From Void Linux Wiki
Jump to navigation Jump to search
(→‎Updates: Emphasized the fact that 'xbps-install -Suv' should be issued repeteadly until no more updates appear.)
(Style guide related changes and some typos.)
Line 1: Line 1:
[[Category:Installation]]
 
 
This article provides a list of basic functions to perform after finishing the [[Installation|installation]] of Void.
 
This article provides a list of basic functions to perform after finishing the [[Installation|installation]] of Void.
  
(If you cannot login after doing an install from a GUI Live ISO you may need to create an account from a virtual console first. CTRL-ALT F2 should get you to one where you will be able to execute the adduser command below. After that you should see that user account listed on the login page.)
+
(If you cannot login after doing an install from a GUI Live ISO, you may need to create an account from a virtual console first. CTRL-ALT-F2 should get you to one where you will be able to [[#User Account|create the account]] as documented below. After that you should see that user account listed on the login page.)
  
 +
== Updates ==
 +
 +
After installation, the first thing you should do on your new void system is update your remote repository information and update your installed packages. This is especially important if you used the '''Local''' source during installation -- it is highly likely that at least some of your packages will be out of date.  To update all packages to the most recent version, run:
  
=Updates=
 
After installation, the first thing you should do on your new void system is update your remote repository information and update your installed packages. This is especially important if you used the '''Local''' source during installation -- it is highly likely that at least some of your packages will be out of date.
 
To update all packages to the most recent version, run:
 
 
  # xbps-install -Suv
 
  # xbps-install -Suv
 +
 
'''Repeat this command until there are no more updates'''.  After updating your system, you may want to reboot depending on the updates installed (such as kernel updates).
 
'''Repeat this command until there are no more updates'''.  After updating your system, you may want to reboot depending on the updates installed (such as kernel updates).
  
=Keymap=
+
== Setting a keymap ==
{{Box GREEN
+
 
|NOTE:
+
{{Note|The following information may be irrelevant/innecessary for you if your Void installation includes a DE with a suitable keyboard config editor. The [[MATE]] flavour of Void Linux comes with such an editor, whereby you can easily pick your keymap with a GUI based application instead of editing config files directly.}}
|The following information may be irrelevant/innecessary for you if your DE of choice has a suitable keyboard config editor. The [[MATE]] flavour of Void Linux comes with such an editor, whereby you can easily pick your keymap with a GUI based application instead of fiddling with config files directly.}}
 
  
 
To see all available keymaps on your system, run:
 
To see all available keymaps on your system, run:
  
  $ find /usr/share/kbd/keymaps/ -type f
+
  $ find /usr/share/kbd/keymaps/ -type f
  
To configure the keymap console keymap, modify <code>/etc/rc.conf</code> with your keymap code. Using the results from the above command,  remove the .map.gz and assign it like this (for example, using the Español keymap):  
+
To configure the '''console''' keymap, modify <code>/etc/rc.conf</code> with your keymap code. Using the results from the above command,  remove the .map.gz and assign it like this (for example, using the "Español" keymap):  
  
 
  # sed -i -e "s|#\?KEYMAP=.*|KEYMAP=es|" /etc/rc.conf
 
  # sed -i -e "s|#\?KEYMAP=.*|KEYMAP=es|" /etc/rc.conf
  
which becomes active after next reboot. If you just want to change the keymap ad hoc the <code>loadkeys</code> utility can be used:
+
which becomes active after the next reboot. If you just want to change the keymap ad hoc, the <code>loadkeys</code> utility can be used:
  
 
  $ loadkeys es
 
  $ loadkeys es
  
===Xorg keymap===
+
=== Xorg keymap ===
If you [[Post_Installation#Install_Xorg|install Xorg]] then that has its own settings for keyboard layout.
 
  
While the default keyboard layout can be overriden by running setxkbmap in a user's .xinitrc, or during session startup (depending on DE/WM used) this can be globally set by adding configuration snippets to <code>/etc/X11/xorg.conf.d/</code> (thus should work regardless of whether one uses a login manager or starts X from a logged-in console.)
+
If you [[Post_Installation#Install_Xorg|install Xorg]], then that has its own settings for keyboard layout.
 +
 
 +
While the default keyboard layout can be overriden by running '''setxkbmap''' in a user's <code>.xinitrc</code>, or during session startup (depending on DE/WM used), this can be globally set by adding configuration snippets to <code>/etc/X11/xorg.conf.d/</code> (thus should work regardless of whether one uses a login manager or starts X from a logged-in console).
  
 
  # cat /etc/X11/xorg.conf.d/10-keyboard.conf
 
  # cat /etc/X11/xorg.conf.d/10-keyboard.conf
Line 43: Line 43:
 
  # Option "XkbVariant" "dvorak"
 
  # Option "XkbVariant" "dvorak"
 
  EndSection
 
  EndSection
'''A note on the Driver''' option: In recent xorg versions, it seems that this is not necessary. If a driver ''is'' listed, then Xorg will use it if it exists, otherwise it will use whatever module is available for keyboards. The layout settings will still be applied.  (Previously, incorrectly selecting the driver could leave you without keyboard input in Xorg).
+
 
 +
'''A note on the ''Driver'' option''': In recent Xorg versions, it seems that this is not necessary. If a driver ''is'' listed, then Xorg will use it if it exists, otherwise it will use whatever module is available for keyboards. The layout settings will still be applied.  (Previously, incorrectly selecting the driver could leave you without keyboard input in Xorg).
  
 
Also note that if multiple keyboard layouts are to be switched between, the line
 
Also note that if multiple keyboard layouts are to be switched between, the line
Option "XkbOptions" "grp:shift_toggle"
+
 
will allow you to switch between multple layouts by pressing both Left and Right Shift keys simultaneously.
+
Option "XkbOptions" "grp:shift_toggle"
 +
 
 +
will allow you to switch between multple layouts by pressing both {{key|Left Shift}} and {{key|Right Shift}} keys simultaneously.
  
 
Keyboard layouts are defined in <code>/usr/share/X11/xkb/symbols/</code> and multiple variants of a language/layout are defined in one file.
 
Keyboard layouts are defined in <code>/usr/share/X11/xkb/symbols/</code> and multiple variants of a language/layout are defined in one file.
  
=Services=
+
== Services ==
Now is a good time to customize the running services. Void uses [[Runit]] as an init and service supervisor. Since the settings were most likely copied from the live system, there are possibly a few services running that you do not really need. Check the contents of ''/var/service'' and consider if you need each service. If you do not know or are unsure about a particular service better leave it in place. These are relatively safe bets:
+
 
 +
Now is a good time to customize the running services. Void uses [[Runit]] as an init and service supervisor. Since the settings were most likely copied from the live system, there are possibly a few services running that you do not really need. Check the contents of <code>/var/service</code> and consider if you need each service. If you do not know or are unsure about a particular service, better leave it in place. These are relatively safe bets:
  
* You probably won't need 6 TTYs so you can safely delete some of the higher-numbered ''agetty-ttyX'' entries. Just make sure you leave at least ''agetty-tty1''
+
* You probably won't need 6 TTYs, so you can safely delete some of the higher-numbered ''agetty-ttyX'' entries. Just make sure you leave at least ''agetty-tty1''
 
* You only need ''mdadm'' if you are using software RAID
 
* You only need ''mdadm'' if you are using software RAID
* If you do not plan to connect to this system via SSH from another computer you can remove ''sshd''
+
* If you do not plan to connect to this system via SSH from another computer, you can remove ''sshd''
 
* If you are using a static network configuration you can (and should) remove ''dhcpcd''
 
* If you are using a static network configuration you can (and should) remove ''dhcpcd''
  
'''''Note''': You can always re-enable removed services later should you need them.''
+
{{Note|You can always re-enable removed services later should you need them.}}
 +
 
 +
== Network ==
  
=Network=
+
If your network provides configuration via DHCP, the default setup should already work fine. If not you may need to enable the ''dhcpcd'' service first:
If your network provides configuration via DHCP the default setup should already work fine. If not you may need to enable the ''dhcpcd'' service first:
 
  
 
  # ln -s /etc/sv/dhcpcd /var/service/dhcpcd
 
  # ln -s /etc/sv/dhcpcd /var/service/dhcpcd
Line 68: Line 73:
 
Should you need a static configuration, first get the necessary data:
 
Should you need a static configuration, first get the necessary data:
  
* Network interface name. I'll be using "enp0s3" in my example. The name can be obtained from the output of <code>ip link</code> on your system.
+
* Network interface name. We'll be using "enp0s3" in this example. The name can be obtained from the output of <code>ip link</code> on your system.
 
* IP-Address, eg "192.168.1.2"
 
* IP-Address, eg "192.168.1.2"
 
* Network mask, eg "255.255.255.0"  
 
* Network mask, eg "255.255.255.0"  
* Broadcast Address. eg "192.168.1.255"
+
* Broadcast Address, eg "192.168.1.255"
* Gateway address. eg "192.168.1.1" in my example
+
* Gateway address, eg "192.168.1.1" in this example
  
When you have the data, put these lines into''/etc/rc.local'' and adapt them to your settings:
+
When you have the data, put these lines into <code>/etc/rc.local</code> and adapt them to your settings:
  
  # ip link set dev enp0s3 up
+
# ip link set dev enp0s3 up
    # ip addr add 192.168.1.2/24 brd + dev enp0s3
+
# ip addr add 192.168.1.2/24 brd + dev enp0s3
    # ip route add default via 192.168.1.1
+
# ip route add default via 192.168.1.1
  
 
Now, after you reboot, you should have a working network connection.
 
Now, after you reboot, you should have a working network connection.
  
 +
=== Wireless-only access ===
  
 +
If you only have access to wireless, you will have to connect through ''wpa_supplicant''.
  
 +
First you need to find the wireless interface name. It is most likely ''wlp2s0'', and that name will be used for the following examples. However you can check the interface name with:
  
'''''If you only have access to wireless''''' you will have to connect through ''wpa_supplicant.''
+
  $ ip addr
 
 
First you need to find the wireless interface name. It is most likely ''wlp2s0'', and that name will be used for the following examples. However you can check the interface name with:
 
 
 
  ip addr
 
  
 
Next you need to find the ssid (the name) of the available wireless networks:
 
Next you need to find the ssid (the name) of the available wireless networks:
  
  sudo iw dev wlp2s0 scan | grep -i ssid
+
  $ sudo iw dev wlp2s0 scan | grep -i ssid
  
After you have picked the network you want me must generate a configuration for it and add that to ''/etc/wpa_supplicant/wpa_supplicant.conf''
+
After you have picked the network you want, we must generate a configuration for it and add that to <code>/etc/wpa_supplicant/wpa_supplicant.conf</code>
  
 
To generate a new configuration you must run:
 
To generate a new configuration you must run:
  
  wpa_passphrase {ssid} {password} | sudo tee -a /etc/wpa_supplicant/wpa_supplicant.conf
+
  $ wpa_passphrase {ssid} {password} | sudo tee -a /etc/wpa_supplicant/wpa_supplicant.conf
  
Where {ssid} is replaced by the actual network name, and {password} is replaced by the real password.
+
where {ssid} is replaced by the actual network name, and {password} is replaced by the real password.
  
 
Finally, to actually connect you must run:
 
Finally, to actually connect you must run:
  
  sudo wpa_supplicant -B -D wext -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant.conf  
+
  $ sudo wpa_supplicant -B -D wext -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant.conf  
 +
$ sudo iw wlp2s0 link
  
And
+
You should now have a working wireless connection.
  
sudo iw wlp2s0 link
+
See also: ''[[Network Configuration]]''
  
You should now have a working wireless connection.
+
== User Account ==
  
=User Account=
+
The next step, if only the root account exists, is to create an additional user account, put it into all the appropriate groups and set a password for it.
  
The next step is to create a user account, put it into all the appropriate groups and set a password for it.
+
First, create a user using the <code>useradd</code> command. The below example creates a user named ''voiduser'', sets the user's default shell to {{wp|Bash (Unix shell)|bash}}, and adds the user to the ''wheel'', ''users'', ''audio'', ''video'', ''cdrom'', and ''input'' groups:
  
First, create a user using the <code>useradd</code> command. The below example creates a user named ''voiduser'', sets the user's default shell to [https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29 bash], and adds the user to the ''wheel'', ''users'', ''audio'', ''video'', ''cdrom'', and ''input'' groups:
 
 
  # useradd -m -s /bin/bash -U -G wheel,users,audio,video,cdrom,input voiduser   
 
  # useradd -m -s /bin/bash -U -G wheel,users,audio,video,cdrom,input voiduser   
''Note: the 'wheel' user group allows the user to escalate to root if they have the root password. It is also generally used to allow <code>sudo</code> privileges (see below).  
+
 
 +
{{Note|The 'wheel' user group allows the user to escalate to root if they have the root password. It is also generally used to allow <code>sudo</code> privileges (see below).}}
  
 
Next, set the user's password using <code>passwd</code>:
 
Next, set the user's password using <code>passwd</code>:
 +
 
  # passwd voiduser
 
  # passwd voiduser
  
'''''Note:''' Use your own shell instead of bash if you want, but you may need to install it first since only bash and [https://en.wikipedia.org/wiki/Almquist_shell dash] are installed by default.''
+
{{Note|Use your own shell instead of bash if you want, but you may need to install it first since only bash and {{wp|Almquist shell|dash}} are installed by default.}}
  
To allow this user (and other administrators) system access via the <code>sudo</code> you need to to configure that behaviour. Edit /etc/sudoers:
+
To allow this user (and other administrators) system access via the <code>sudo</code>, you need to configure that behaviour. Edit <code>/etc/sudoers</code> by running
  
 
  # visudo
 
  # visudo
  
and uncomment the line:
+
and uncomment this line:
  
 
  # %wheel ALL=(ALL) ALL
 
  # %wheel ALL=(ALL) ALL
  
=Graphical User Interface=
+
== Graphical User Interface ==
At this point you have a fully functional Void Linux environment and a user account to use it. The next step is generally to setup a GUI. Void uses [[Xorg]] to provide a graphical environment. Please see the [[Xorg]] page for more information on installing and configuring Xorg.
+
 
 +
At this point you have a fully functional Void Linux environment and a regular user account to use it. Unless you installed Void with a DE already on top (in which case you can skip this section altogether), the next step is generally to setup a GUI. Void uses [[Xorg]] to provide a graphical environment. Please see the [[Xorg]] page for more information on installing and configuring Xorg.
  
This will help you get a basic XFCE setup running. You can chose any desktop environment or window manager you want; the steps are essentially the same for each one. The following commands assume you are logged in as root.
+
The following steps will help you get a basic XFCE setup running. You can choose any desktop environment or window manager you want; the steps are essentially the same for each one. The following commands assume you are logged in as root.
  
==Install Xorg==
+
=== Install Xorg ===
The ''_xorg_'' package is a metapackage that installs pretty much everything closely related to Xorg. This will give you a quick start but will also clobber your system with many unneeded packages. [https://github.com/voidlinux/void-packages/blob/master/srcpkgs/xorg-minimal/template xorg-minimal] is another metapackage with fewer dependencies, e.g. without any video drivers.
+
 
 +
The {{pkg|xorg}} package is a metapackage that installs pretty much everything closely related to Xorg. This will give you a quick start but will also clobber your system with many unneeded packages. [https://github.com/voidlinux/void-packages/blob/master/srcpkgs/xorg-minimal/template xorg-minimal] is another metapackage with fewer dependencies, e.g. without any video drivers.
 +
 
 +
Quick start with ''Xorg'':
  
Quick start with ''xorg'':
 
 
  # xbps-install -S xorg xterm
 
  # xbps-install -S xorg xterm
Example with ''xorg-minimal'' for an Intel-based notebook, enough to continue with installation of a desktop environment:
+
 
 +
Or, you can install ''xorg-minimal'' instead if you own e.g. an Intel-based notebook. This will suffice to continue with installation of a desktop environment:
 +
 
 
  # xbps-install -S xorg-minimal xorg-fonts xf86-input-synaptics xf86-video-intel
 
  # xbps-install -S xorg-minimal xorg-fonts xf86-input-synaptics xf86-video-intel
  
==Install a Desktop Environment==
+
=== Install a Desktop Environment ===
Note: The heavyweight desktop environments like Gnome and KDE increasingly rely on systemd, so they are likely outdated.
+
 
 +
{{Note|The heavyweight desktop environments like Gnome and KDE increasingly rely on systemd, so they are likely outdated.}}
  
 
In this example we will install xfce4. Other options include LXQT, Mate or even just a window manager like OpenBox.
 
In this example we will install xfce4. Other options include LXQT, Mate or even just a window manager like OpenBox.
  
 
As root (or sudo):
 
As root (or sudo):
 +
 
  # xbps-install -S xfce4
 
  # xbps-install -S xfce4
  
Line 164: Line 177:
 
  exec startxfce4 /*Adapt for your chosen DE/WM */
 
  exec startxfce4 /*Adapt for your chosen DE/WM */
  
Lastly run <code>startx</code> to start an Xfce4 session. If you did not override the global X keymap, then you may simply run <code>startxfce4</code>. Some DEs will work this way, some will not (for instance, LXQT should be launched via your .xinitrc if not launching from a GUI login manager).
+
Lastly, run <code>startx</code> to start an Xfce4 session. If you did not override the global X keymap, then you may simply run <code>startxfce4</code>. Some DEs will work this way, some will not (for instance, LXQT should be launched via your .xinitrc if not launching from a GUI login manager).
  
==Display Manager==
+
== Display Manager ==
  
'''''Note:''' Single user autologin without a display manager is described in the [[Automatic Login to Graphical Environment]]'' article.
+
{{Note|Single user autologin without a display manager is described in the ''[[Automatic Login to Graphical Environment]]'' article.}}
  
Now that you have such a pretty GUI, you might find it tedious or ugly to login on the console and run <code>startx</code> every time. In that case, you can install a display manager that takes care of that much more fashionably. In this example I will use LightDM. For this to work you also need to enable the ''dbus'' service:
+
Now that you have such a pretty GUI, you might find it tedious or ugly to login on the console and run <code>startx</code> every time. In that case, you can install a display manager that takes care of that much more fashionably. In this example we will use LightDM. For this to work you also need to enable the ''dbus'' service:
  
 
  # xbps-install -S lightdm lightdm-gtk3-greeter
 
  # xbps-install -S lightdm lightdm-gtk3-greeter
Line 176: Line 189:
 
  # ln -s /etc/sv/lightdm /var/service/lightdm
 
  # ln -s /etc/sv/lightdm /var/service/lightdm
  
'''''Note:''' In case you have problems logging in you may need to reboot, forcibly if necessary''
+
{{Note|In case you have problems logging in you may need to reboot, forcibly if necessary.}}
  
 
==Allow users to shutdown without a password==
 
==Allow users to shutdown without a password==
 +
 
===via ConsoleKit/Polkit===
 
===via ConsoleKit/Polkit===
If you are using a Desktop Environment/Session Manager that makes use of ConsoleKit such as XFCE, Cinnamon, or LXQT, then you have the ability to shutdown by using those environments' builtin logout/shutdown interfaces.
 
  
The default Polkit rules for ConsoleKit actions '''already allow any user to perform shutdown/suspend''' actions without any extra privileges on single-user systems (when other users are not logged in). On systems with multiple users logged in, the default is that only root can do this (and thus end all users' login sessions). These defaults can be overriden by rules added to {{Path|/etc/polkit-1/rules.d/}}. See Polkit documentation for rules syntax at [https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html FDO] or, in a terminal, type <code>man 8 polkit</code>.
+
If you are using a Desktop Environment/Session Manager that makes use of ConsoleKit -such as XFCE, Cinnamon, or LXQT- then you have the ability to shutdown by using those environments' built-in logout/shutdown interfaces.
+
 
 +
The default Polkit rules for ConsoleKit actions '''already allow any user to perform shutdown/suspend''' actions without any extra privileges on single-user systems (when other users are not logged in). On systems with multiple users logged in, the default is that only root can do this (and thus end all users' login sessions). These defaults can be overriden by rules added to {{Path|/etc/polkit-1/rules.d/}}. See Polkit documentation for rules syntax at [https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html FDO] or, in a terminal, type <code>man 8 polkit</code>.
 
   
 
   
 
'''''If using a login manager''''' such as lightdm or lxdm, the login manager will usually launch your chosen DE with ConsoleKit support, and things should "just work" out of the box.
 
'''''If using a login manager''''' such as lightdm or lxdm, the login manager will usually launch your chosen DE with ConsoleKit support, and things should "just work" out of the box.
 
   
 
   
+
However, '''if starting your DE from a console login ''without a DM''''', you may need special setup or command options for your DE's session to connect to ConsoleKit. ''This will vary between DEs''.
However, '''if starting your DE from a console login ''without a DM''''', you may need special setup or command options for your DE's session to connect to ConsoleKit. ''This will vary between DEs.''
 
  
For instance, XFCE4 should be launched with the command <code>startxfce4 --with-ck-launch</code> or by having XFCE4_SESSION_WITH_CK in your environment when you run startxfce4. LXQT can be launched by adding <code>exec ck-launch-session startlxqt</code> to the end of your .xinitrc and running startx.
+
For instance, XFCE4 should be launched with the command <code>startxfce4 --with-ck-launch</code> or by having XFCE4_SESSION_WITH_CK in your environment when you run '''startxfce4'''. LXQT can be launched by adding <code>exec ck-launch-session startlxqt</code> to the end of your <code>.xinitrc</code> and running '''startx'''.
  
'''Note:''' This functionality requires that the dbus service be enabled and running (either as a system service, or launched by a Consolekit2 session).
+
{{Note|This functionality requires that the dbus service be enabled and running (either as a system service, or launched by a Consolekit2 session).}}
  
 
===via sudo===
 
===via sudo===
This is the simplest method to give any group of users the ability to shutdown/restart without entering a password and can be useful for simpler WMs that don't talk to ConsoleKit2, but instead allow users to customize menu actions such as OpenBox.  This requires commands be prepended with "sudo."
 
  
'''Warning:''' ''Never edit /etc/sudoers directly!'' Always use the <code>visudo</code> command, which will run vital sanity checks before exiting.
+
This is the simplest method to give any group of users the ability to shutdown/restart without entering a password and can be useful for simpler WMs that don't talk to ConsoleKit2, but instead allow users to customize menu actions, such as OpenBox.  This requires commands be prepended with '''sudo'''.
 +
 
 +
{{Warning|Never edit <code>/etc/sudoers</code> directly! Always use the '''visudo''' command, which will run vital sanity checks before exiting.}}
  
 
To allow members of the group "wheel" to shutdown without a password, use this line:
 
To allow members of the group "wheel" to shutdown without a password, use this line:
 +
 
  %wheel ALL=(ALL) NOPASSWD: /usr/bin/halt, /usr/bin/poweroff, /usr/bin/reboot, \
 
  %wheel ALL=(ALL) NOPASSWD: /usr/bin/halt, /usr/bin/poweroff, /usr/bin/reboot, \
 
  /usr/bin/shutdown, /usr/bin/zzz, /usr/bin/ZZZ
 
  /usr/bin/shutdown, /usr/bin/zzz, /usr/bin/ZZZ
''See the sudo documentation'' <code>man sudoers</code> ''for more information on the /etc/sudoers file.''
 
  
'''Note:''' It is also possible, if you ''really'' wanted to, to use Consolekit in these instances as well by using less-friendly (and less memorable) dbus-send commands for poweroff actions instead of sudo commands (not covered here).
+
{{Note|See the sudo documentation (<code>man sudoers</code>) for more information on the /etc/sudoers file.}}
 +
 
 +
{{Note|It is also possible, if you ''really'' wanted to, to use Consolekit in these instances as well by using less-friendly (and less memorable) dbus-send commands for poweroff actions instead of sudo commands (not covered here).}}
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== My hardware isn't showing up! ===
  
=Troubleshooting=
+
If you have issues with hardware and it doesn't appear in <code>dmesg</code>, you may need to install the {{pkg|linux-firmware}} and/or {{pkg|linux-firmware-network}} packages:
  
==My hardware isn't showing up!==
 
If you have issues with hardware and it doesn't appear in <code>dmesg</code>, you may need to install the <code>linux-firmware</code> and/or <code>linux-firmware-network</code> packages.
 
 
  # xbps-install linux-firmware
 
  # xbps-install linux-firmware
  
 
  # xbps-install linux-firmware-network
 
  # xbps-install linux-firmware-network
  
= What's next? =
+
== What's next? ==
 +
 
 
To further customize your new Void system, you should have a look at our [[:Category:Guides|Guides]].
 
To further customize your new Void system, you should have a look at our [[:Category:Guides|Guides]].
 +
 +
[[Category:Installation]]

Revision as of 04:15, 15 July 2017

This article provides a list of basic functions to perform after finishing the installation of Void.

(If you cannot login after doing an install from a GUI Live ISO, you may need to create an account from a virtual console first. CTRL-ALT-F2 should get you to one where you will be able to create the account as documented below. After that you should see that user account listed on the login page.)

Updates

After installation, the first thing you should do on your new void system is update your remote repository information and update your installed packages. This is especially important if you used the Local source during installation -- it is highly likely that at least some of your packages will be out of date. To update all packages to the most recent version, run:

# xbps-install -Suv

Repeat this command until there are no more updates. After updating your system, you may want to reboot depending on the updates installed (such as kernel updates).

Setting a keymap

Note: The following information may be irrelevant/innecessary for you if your Void installation includes a DE with a suitable keyboard config editor. The MATE flavour of Void Linux comes with such an editor, whereby you can easily pick your keymap with a GUI based application instead of editing config files directly.

To see all available keymaps on your system, run:

$ find /usr/share/kbd/keymaps/ -type f

To configure the console keymap, modify /etc/rc.conf with your keymap code. Using the results from the above command, remove the .map.gz and assign it like this (for example, using the "Español" keymap):

# sed -i -e "s|#\?KEYMAP=.*|KEYMAP=es|" /etc/rc.conf

which becomes active after the next reboot. If you just want to change the keymap ad hoc, the loadkeys utility can be used:

$ loadkeys es

Xorg keymap

If you install Xorg, then that has its own settings for keyboard layout.

While the default keyboard layout can be overriden by running setxkbmap in a user's .xinitrc, or during session startup (depending on DE/WM used), this can be globally set by adding configuration snippets to /etc/X11/xorg.conf.d/ (thus should work regardless of whether one uses a login manager or starts X from a logged-in console).

# cat /etc/X11/xorg.conf.d/10-keyboard.conf
Section "InputClass"
	Identifier "any value works here"
	MatchIsKeyboard "on"	# Limit these settings to keyboards
#	Driver "libinput"
	# Keyboard layout - comma-separated list for multiple layouts
	Option "XkbLayout" "es"
	# Keyboard variant - comma-separated list matching XkbLayout line
# 	Option "XkbVariant" "dvorak"
EndSection

A note on the Driver option: In recent Xorg versions, it seems that this is not necessary. If a driver is listed, then Xorg will use it if it exists, otherwise it will use whatever module is available for keyboards. The layout settings will still be applied. (Previously, incorrectly selecting the driver could leave you without keyboard input in Xorg).

Also note that if multiple keyboard layouts are to be switched between, the line

Option "XkbOptions" "grp:shift_toggle"

will allow you to switch between multple layouts by pressing both Left Shift and Right Shift keys simultaneously.

Keyboard layouts are defined in /usr/share/X11/xkb/symbols/ and multiple variants of a language/layout are defined in one file.

Services

Now is a good time to customize the running services. Void uses Runit as an init and service supervisor. Since the settings were most likely copied from the live system, there are possibly a few services running that you do not really need. Check the contents of /var/service and consider if you need each service. If you do not know or are unsure about a particular service, better leave it in place. These are relatively safe bets:

  • You probably won't need 6 TTYs, so you can safely delete some of the higher-numbered agetty-ttyX entries. Just make sure you leave at least agetty-tty1
  • You only need mdadm if you are using software RAID
  • If you do not plan to connect to this system via SSH from another computer, you can remove sshd
  • If you are using a static network configuration you can (and should) remove dhcpcd
Note: You can always re-enable removed services later should you need them.

Network

If your network provides configuration via DHCP, the default setup should already work fine. If not you may need to enable the dhcpcd service first:

# ln -s /etc/sv/dhcpcd /var/service/dhcpcd

Should you need a static configuration, first get the necessary data:

  • Network interface name. We'll be using "enp0s3" in this example. The name can be obtained from the output of ip link on your system.
  • IP-Address, eg "192.168.1.2"
  • Network mask, eg "255.255.255.0"
  • Broadcast Address, eg "192.168.1.255"
  • Gateway address, eg "192.168.1.1" in this example

When you have the data, put these lines into /etc/rc.local and adapt them to your settings:

# ip link set dev enp0s3 up
# ip addr add 192.168.1.2/24 brd + dev enp0s3
# ip route add default via 192.168.1.1

Now, after you reboot, you should have a working network connection.

Wireless-only access

If you only have access to wireless, you will have to connect through wpa_supplicant.

First you need to find the wireless interface name. It is most likely wlp2s0, and that name will be used for the following examples. However you can check the interface name with:

$ ip addr

Next you need to find the ssid (the name) of the available wireless networks:

$ sudo iw dev wlp2s0 scan | grep -i ssid

After you have picked the network you want, we must generate a configuration for it and add that to /etc/wpa_supplicant/wpa_supplicant.conf

To generate a new configuration you must run:

$ wpa_passphrase {ssid} {password} | sudo tee -a /etc/wpa_supplicant/wpa_supplicant.conf

where {ssid} is replaced by the actual network name, and {password} is replaced by the real password.

Finally, to actually connect you must run:

$ sudo wpa_supplicant -B -D wext -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant.conf 
$ sudo iw wlp2s0 link

You should now have a working wireless connection.

See also: Network Configuration

User Account

The next step, if only the root account exists, is to create an additional user account, put it into all the appropriate groups and set a password for it.

First, create a user using the useradd command. The below example creates a user named voiduser, sets the user's default shell to Wikipedia-logo.png bash, and adds the user to the wheel, users, audio, video, cdrom, and input groups:

# useradd -m -s /bin/bash -U -G wheel,users,audio,video,cdrom,input voiduser  
Note: The 'wheel' user group allows the user to escalate to root if they have the root password. It is also generally used to allow sudo privileges (see below).

Next, set the user's password using passwd:

# passwd voiduser
Note: Use your own shell instead of bash if you want, but you may need to install it first since only bash and Wikipedia-logo.png dash are installed by default.

To allow this user (and other administrators) system access via the sudo, you need to configure that behaviour. Edit /etc/sudoers by running

# visudo

and uncomment this line:

# %wheel ALL=(ALL) ALL

Graphical User Interface

At this point you have a fully functional Void Linux environment and a regular user account to use it. Unless you installed Void with a DE already on top (in which case you can skip this section altogether), the next step is generally to setup a GUI. Void uses Xorg to provide a graphical environment. Please see the Xorg page for more information on installing and configuring Xorg.

The following steps will help you get a basic XFCE setup running. You can choose any desktop environment or window manager you want; the steps are essentially the same for each one. The following commands assume you are logged in as root.

Install Xorg

The xorg package is a metapackage that installs pretty much everything closely related to Xorg. This will give you a quick start but will also clobber your system with many unneeded packages. xorg-minimal is another metapackage with fewer dependencies, e.g. without any video drivers.

Quick start with Xorg:

# xbps-install -S xorg xterm

Or, you can install xorg-minimal instead if you own e.g. an Intel-based notebook. This will suffice to continue with installation of a desktop environment:

# xbps-install -S xorg-minimal xorg-fonts xf86-input-synaptics xf86-video-intel

Install a Desktop Environment

Note: The heavyweight desktop environments like Gnome and KDE increasingly rely on systemd, so they are likely outdated.

In this example we will install xfce4. Other options include LXQT, Mate or even just a window manager like OpenBox.

As root (or sudo):

# xbps-install -S xfce4

It is recommended you only run a DE/WM as a regular user, and not as root. Many DEs will warn you of the danger, but will also allow you to do so at your own risk, if you so insist.

To configure a global xkbmap, see the above section Xorg keymap.

If you want to overrde the default X keymap on a per-user basis, create and edit the file .xinitrc in the user's home directory, and put these lines at the end:

setxkbmap de /*Adapt for your own keyboard layout -- this selects the German QWERTZ layout */
exec startxfce4 /*Adapt for your chosen DE/WM */

Lastly, run startx to start an Xfce4 session. If you did not override the global X keymap, then you may simply run startxfce4. Some DEs will work this way, some will not (for instance, LXQT should be launched via your .xinitrc if not launching from a GUI login manager).

Display Manager

Note: Single user autologin without a display manager is described in the Automatic Login to Graphical Environment article.

Now that you have such a pretty GUI, you might find it tedious or ugly to login on the console and run startx every time. In that case, you can install a display manager that takes care of that much more fashionably. In this example we will use LightDM. For this to work you also need to enable the dbus service:

# xbps-install -S lightdm lightdm-gtk3-greeter
# ln -s /etc/sv/dbus /var/service/dbus
# ln -s /etc/sv/lightdm /var/service/lightdm
Note: In case you have problems logging in you may need to reboot, forcibly if necessary.

Allow users to shutdown without a password

via ConsoleKit/Polkit

If you are using a Desktop Environment/Session Manager that makes use of ConsoleKit -such as XFCE, Cinnamon, or LXQT- then you have the ability to shutdown by using those environments' built-in logout/shutdown interfaces.

The default Polkit rules for ConsoleKit actions already allow any user to perform shutdown/suspend actions without any extra privileges on single-user systems (when other users are not logged in). On systems with multiple users logged in, the default is that only root can do this (and thus end all users' login sessions). These defaults can be overriden by rules added to /etc/polkit-1/rules.d/. See Polkit documentation for rules syntax at FDO or, in a terminal, type man 8 polkit.

If using a login manager such as lightdm or lxdm, the login manager will usually launch your chosen DE with ConsoleKit support, and things should "just work" out of the box.

However, if starting your DE from a console login without a DM, you may need special setup or command options for your DE's session to connect to ConsoleKit. This will vary between DEs.

For instance, XFCE4 should be launched with the command startxfce4 --with-ck-launch or by having XFCE4_SESSION_WITH_CK in your environment when you run startxfce4. LXQT can be launched by adding exec ck-launch-session startlxqt to the end of your .xinitrc and running startx.

Note: This functionality requires that the dbus service be enabled and running (either as a system service, or launched by a Consolekit2 session).

via sudo

This is the simplest method to give any group of users the ability to shutdown/restart without entering a password and can be useful for simpler WMs that don't talk to ConsoleKit2, but instead allow users to customize menu actions, such as OpenBox. This requires commands be prepended with sudo.

Warning: Never edit /etc/sudoers directly! Always use the visudo command, which will run vital sanity checks before exiting.

To allow members of the group "wheel" to shutdown without a password, use this line:

%wheel ALL=(ALL) NOPASSWD: /usr/bin/halt, /usr/bin/poweroff, /usr/bin/reboot, \
	/usr/bin/shutdown, /usr/bin/zzz, /usr/bin/ZZZ
Note: See the sudo documentation (man sudoers) for more information on the /etc/sudoers file.
Note: It is also possible, if you really wanted to, to use Consolekit in these instances as well by using less-friendly (and less memorable) dbus-send commands for poweroff actions instead of sudo commands (not covered here).

Troubleshooting

My hardware isn't showing up!

If you have issues with hardware and it doesn't appear in dmesg, you may need to install the linux-firmware and/or linux-firmware-network packages:

# xbps-install linux-firmware
# xbps-install linux-firmware-network

What's next?

To further customize your new Void system, you should have a look at our Guides.