DEV Community

Cover image for NetBSD package manager configuration
Efe Ertugrul
Efe Ertugrul

Posted on • Originally published at efeertugrul.com

NetBSD package manager configuration

Summary

In this part i'm going to enable built-in package manager and install pkgin. Pkgin is the recommended package manager for NetBSD.
For more information see: PKGIN Website

This part requires active internet connection.


Instructions

1- Start and login to your system.

netbsd-pkg-001

2- Switch to root user with su command.

netbsd-pkg-002

3- Go to root's homefolder with cd command. Check with ls command that you're in homefolder. Open .profile dotfile with vi program.

netbsd-pkg-003

4- In this file find and uncomment export PKG_PATH line by deleting the # character at the start of the line. Save it using :w! command because this file is read-only.

netbsd-pkg-004

netbsd-pkg-005

5- This configuration don't require a system restart. It requires a re-login. So logout from all the logged-in users with exit command.

netbsd-pkg-006

netbsd-pkg-007

6- Login with root user. (Installing programs requires root privileges)

netbsd-pkg-008

netbsd-pkg-009

7- First, install pkgin package manager using command pkg_add -v pkgin .

netbsd-pkg-010

netbsd-pkg-011

netbsd-pkg-012

netbsd-pkg-013

8- From now on we can use pkgin. Update pkgin database with command pkgin update . Always update pkgin before installing programs.

netbsd-pkg-014

netbsd-pkg-015

9- Let's test pkgin by installing vim program. Use command pkgin install vim to install vim. Type Y to continue install. This will download and copy all the necessary files for vim program.

netbsd-pkg-016

netbsd-pkg-017

10- After installation is over, test-run the program with command vim. Check if it runs or not.

netbsd-pkg-018

netbsd-pkg-019

11- You can also delete installed programs. Remove vim with using pkgin remove vim command.

netbsd-pkg-020

netbsd-pkg-021

netbsd-pkg-022

12- After removal of a program you should also remove unnecessary packages by using pkgin autoremove command.

netbsd-pkg-023

netbsd-pkg-024

netbsd-pkg-025

13- Also use pkgin clean command to clean the cache after an install or uninstall operation.

netbsd-pkg-026

By the way you should always think programs as potential security vulnerabilities. Especially if you are running your system as a server. So never install any unnecessary programs to a server. Best is always use the programs those come with your operating system. For example use vi instead of vim.

This is the end of NetBSD guide. Now you have a fully functioning minimal NetBSD system. Next is up to you. You can install a Graphical User Interface or configure a Firewall. For more information about NetBSD use the official guide here: NetBSD Guide

Top comments (0)