down. translated.

@spec.get_opts.each do |name, opt| options[name] = opt.value counts[name] = opt.count end @spec.get_args.each do |name, arg| args << arg.value named[name] = arg.value end args.flatten! args += trailing @report = Report.new(args, named, trailing, options, counts) if @report.opt(:help) self.print_usage() end unless @spec.get_args.values.all? {|arg| arg.fulfilled? } raise InterfaceError, "Required argument '#{name.upcase}' was not given." end if @spec.trailing_error && !@report.trailing.empty? raise InterfaceError, "Error: got trailing argument(s): #{trailing.join

Software

This cheatsheet collects commands and tools you might find useful when starting out with Void Linux. This guide will be updated as I learn .

ยงXBPS Package Manager

The Void package manager is XBPS โ€” the X Binary Package System. It was written from scratch for use with Void. Common commands:

  • xbps-install -Su โ€” update the system
  • xbps-install PACKAGE โ€” install PACKAGE
  • xbps-query -Rs QUERY โ€” search repositories for packages
  • xbps-query -f PACKAGE โ€” list files provided by PACKAGE
  • xbps-query -l โ€” list all packages with versions and descriptions
  • xbps-query -l | cut -d " " -f 2 | sed "s/^\(.*\)-.*$/\1/" โ€” list all package names (might want to alias this)

Install xtools for additional tools:

  • xlocate -S | QUERY โ€” search for paths within all packages. Useful to find which package a command is in, etc.
    • Run xlocate -S first to cache package data. Run occasionally to keep the cache updated
    • Use like xlocate /usr/bin/dig. Absolute paths work best; xlocate npm returns 2716 results, xlocate /usr/bin/npm returns one.
  • xcheckrestart [-v] โ€” XBPS does not restart services when they're updated. Run this to check for services that need to be restarted.

ยงService Management

Services are managed with the sv command. Usage examples:

  • sv up SERVICES โ€” start a service and re-start it as needed
  • ln -s /etc/sv/SERVICE /var/service/ โ€” configure a service to start at boot
  • sv down SERVICES โ€” stop a service and do not restart it
  • rm /var/service/SERVICE โ€” stop a service from starting at boot
  • sv restart SERVICES
  • sv status SERVICES
  • ls /var/service โ€” contains symlinks for all running services
  • sv s /var/service/* โ€” show status of all running services

Install rubyists/sv-helper for some additional tools:

  • sv-list โ€” list all available services
  • svls SERVICE โ€” like sv-list but you can limit output to a single SERVICE
  • sv-enable SERVICE โ€“ enable a service to start at boot, and start it now
  • sv-disable SERVICE โ€“ stop a service from starting at boot, and stop it now

ยงManaging old kernels

Old kernels are not removed when new ones are built, to allow you rollback to previous versions. This will eventually cause your /boot partition to run out of space, causing update errors and kernel panics.

You can manage old kernel versions using vkpurge:

  • vkpurge list โ€” list unused, removable kernels
  • vkpurge rm all โ€” remove all removable kernels
  • vkpurge rm '2.6.*' 4.3.4_1 โ€” remove all removable kernels matching a pattern, and remove a specific version

Directory