efe_ertugrul

apple developer

home tech-notes app store github twitter stackoverflow dev.to

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.

004-netbsd-package-manager-001

2- Switch to root user with su command.

004-netbsd-package-manager-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.

004-netbsd-package-manager-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.

004-netbsd-package-manager-004

004-netbsd-package-manager-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.

004-netbsd-package-manager-006

004-netbsd-package-manager-007

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

004-netbsd-package-manager-008

004-netbsd-package-manager-009

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

004-netbsd-package-manager-010

004-netbsd-package-manager-011

004-netbsd-package-manager-012

004-netbsd-package-manager-013

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

004-netbsd-package-manager-014

004-netbsd-package-manager-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.

004-netbsd-package-manager-016

004-netbsd-package-manager-017

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

004-netbsd-package-manager-018

004-netbsd-package-manager-019

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

004-netbsd-package-manager-020

004-netbsd-package-manager-021

004-netbsd-package-manager-022

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

004-netbsd-package-manager-023

004-netbsd-package-manager-024

004-netbsd-package-manager-025

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

004-netbsd-package-manager-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


download this page as .md

download this page as .pdf

back to NetBSD Guides