KD0YTE's Ham Radio, Linux, and other stuff.

Entries from June 2025.

pacman usage in arch linux
3rd June 2025

pacman is Arch linux's package manager. similar to apt in debian and dnf in fedora but much more complex as several
operations depend on multiple use flags.

One can go read https://wiki.archlinux.org/title/Pacman on the arch wiki but a quick synopsis is as follows.

pacman -S packagename installs a package (must be run with root priveleges)

pacman -R package name uninstalls a package

pacman -Rs uninstalls the package and its dependancies if not used by other packages.

pacman -Ss search for a package

pacman -Syu upgrade all packages to the very latest

in addition their are a few other useful commands.

paccache -r cleans the package cache of old unneded package versions

pactree packagename lists all dependancies for a package

Tags: linux.
Linux user management
19th June 2025

Modifying user settings isn't something I do everyday but it is necessary occasionally

You can add a user with the useradd command

usermod is useful for working on a current users priveleges.

The most common use I have for it is adding my user to a group for additional priveleges
make sure to use the -a or you will remove them from other groups

usermod -a -G groupname username

For example we want to add Ted to the foo group

usermod -a -G foo Ted

You can see all the available usergroups in your /etc/group fiile

Other usermod functions:

1 Change a users primary group
usermod -g groupname username

2. Set an expiration date for a user account
usermod -e YYYY-MM-DD username

this is useful if you want a friend to have temporary access to your machine

3. Change users home directory
usermod -d filepath username

4. change users login name
usermod -l newusername currentusername

5. Lock a user account to prevent them from logging in

usermod -L username

To unlock them

usermod -U username

6. change user shell

usermod -s shell path username

for example

usermod -s /bin/bash Ted
will set teds shell to bash

Associated command to usermod

id username
will give you info on the user such as uuid groups etc.

Tags: linux.

RSS Feed