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
m (→‎Keymap: Typo.)
(→‎Updates: Emphasized the fact that 'xbps-install -Suv' should be issued repeteadly until no more updates appear.)
Line 9: Line 9:
 
To update all packages to the most recent version, run:
 
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=
 
=Keymap=

Revision as of 00:12, 1 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 execute the adduser command 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).

Keymap

NOTE: 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:

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

To configure the keymap 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 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 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. I'll be using "enp0s3" in my 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 my 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.



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 me 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 

And

sudo iw wlp2s0 link

You should now have a working wireless connection.

User Account

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 useradd command. The below example creates a user named voiduser, sets the user's default shell to 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 dash are installed by default.

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

# visudo

and uncomment the line:

# %wheel ALL=(ALL) ALL

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.

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.

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

Example with xorg-minimal for an Intel-based notebook, enough 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 I 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' 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 /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

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.