Keeping the system up-to-date basics

 FreeBSD software package system is different than Linux distro and it uses 3 kinds of types to deliver software packages and updates compared to Linux distro which is usually uses one kind to deliver software packages from software installation to operating system updates. FreeBSD uses pkg for installing readily-made software, ports for compiling the program from the source with the specialized configurations and also freebsd-update to deliver operating system updates and upgrades. 


1. PKG package installation system basics.

In order to install/remove/modify the software in the operating system, it must be run under root privileges, otherwise for other misc. stuff eg. finding the package information.

To install the package:
            $ pkg install [application-name]
 
To remove the package:
            $ pkg remove [application-name]
 
*To update the package:
       $ pkg update

*Note that this command will replace existing ports installation unless locking the application from being modified. 

To automatically remove unneeded package, usually done after installing ports:
           $ pkg autoremove
 
To stop the package from being removed or getting updates:
          $ pkg lock [application-name]
 
To create a backup of locally installed pkg:
           $ pkg create [application-name]
 
To restore the local backup or to install local pkg file:
           $ pkg add [application-name].pkg
 
To list the information of the software package:
           $ pkg info [application-name]
 
To show the post-install message of the application:
           $ pkg info -D [application-name]

To safely remove an application or package without removing the rest of the other applications [dependency hell]

      $ pkg delete -f [application-name]

 

2. Ports Collections 

Port collections is another way to install latest applications if the application wasn't readily available on pkg system or you want something more specific onto your program by adding or removing features of your program. However, installation over ports collections requires you to being patient because this will be time consuming and of course, storage space consuming where imaging that installation of ports requires 20GB of storage just for creating only 200MB of the application! Mostly, ports collections usually located at /usr/ports so you can find some stuff over there.

 Note that this procedure must be run on root privileges. 

To obtain ports collection:
         $ portsnap fetch
 
To extract the obtained ports collection after the above command:
         $ portsnap extract 
 
To update the ports collection:
         $ portsnap update
 
To automate ports collection fetching and updates directly:
        $ portsnap auto
 
To configure the ports collection before compiling:
        $ make config
 
To compile and install the ports collection
       $ make install
 
To compile and install the program without any prompts:
      $ make install BATCH=YES
 
To build the local pkg file backup for installed ports:
     $ make package
 
To clean up the compiled files after installing the program or to redo the installation process:
     $ make clean
 
To safely uninstall the conflicted application without removing other dependencies (when prompted):
     $ make deinstall

 

3. FreeBSD core OS update system

One major difference between Linux and FreeBSD is how core operating system updates carried out and FreeBSD uses separate OS update system unlike major Linux distro uses single package manager to handle OS updates alongside with applications updates as well. Keep in mind that upgrading the current version of operating system into newer ones may break the existing applications and modules so be prepared if doing so. 

To fetch the OS update:
       $ freebsd-update fetch
 
To install the downloaded updated after running the command above:
      $ freebsd-update install 
 
To upgrade the OS into newer version, requires to specify its version:
      $ freebsd-update upgrade -r [version-release]

    Example:

      $ freebsd-update upgrade -r 14.0-RELEASE

 To rollback current updates into previous state:
      $ freebsd-update rollback

Comments

Popular posts from this blog

Installing nvidia-drm-kmod on FreeBSD

Setting Up GPU Cards on FreeBSD 13

How To Setup Optical Drives on FreeBSD