How To Upgrade Packages In FreeBSD?
 

How To Upgrade Packages In FreeBSD?

 

This post was last updated on August 1st, 2020 at 12:06 pm

FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution. It is used to power modern servers, desktops, and embedded platforms.

In FreeBSD, there are two ways to install a package: Using pkg and from the ports collection. Over time, newer versions of the software package become available for installation.

This article describes how to upgrade packages to a newer version in FreeBSD.

How to determine the packages available for upgrade

Before you check and start upgrading packages, ensure that the latest version of the ports tree is installed. To upgrade ports tree execute the following command –

portsnap fetch update

To list the outdated packages in FreeBSD 10 and later use –

pkg version -l "<"

In FreeBSD 9.x and prior versions use –

pkg_version -l "<"

How to upgrade packages

There are various ways to upgrade ports or packages, we will discuss here a few of them.

Upgrading ports using portmaster

Portmaster is a utility categorized under ports-mgmt in the ports tree. To use it for upgrading packages first you need to install it in your system. Use the following command to install it –

cd /usr/ports/ports-mgmt/portmaster
make install clean

Portmaster defines four categories of ports –

  • Root port – has no dependencies and is not a dependency of any other port
  • Trunk port –  has no dependencies but other ports depend upon it
  • Branch port – has dependencies and other ports depend upon it
  • Leaf port – has dependencies but no other ports depend upon it

To list all installed ports by category and search for updates use the following command in your terminal –

portmaster -L

Now use the following command to upgrade all the packages –

portmaster -a

Once this command gets executed, it will start upgrading the outdated applications into newer versions meanwhile it can prompt you to select or deselect programs as you can see in the image below. Select or deselect a program using the space button and then press enter for ok.

Use the following command if errors are encountered during the upgrade process, add -f to upgrade and rebuild all the ports.

portmaster -af

Upgrading ports using portupgrade

Portupgrade is another utility that can be used to upgrade ports. It also categorized under ports-mgmt in the ports tree. It depends upon ruby, to start using it first you need to install it in your system. Use the following command to install it –

cd /usr/ports/ports-mgmt/portupgrade
make install clean

Now once this utility gets installed, use the following command to upgrade all the outdated ports –

portupgrade -a

To upgrade a specified application use the following command in your terminal –

portupgrade -R nano

If you use option -P with the above command, portupgrade will first search for available packages locally, if not found locally it will start fetching packages from the remote location.

portupgrade -PP xfce

Conclusion

There are other tools such as synth that can also be used for upgrading outdated packages in FreeBSD.

Ok, that’s all for now. If you have a query on this topic then write it to us in the comments below.

Previous How To Install PyCharm in Ubuntu 20.04 LTS?
Next How To Install And Configure Fish Shell In Ubuntu 20.04 LTS?
 

About author

You might also like

How To 0 Comments

ACPI HOWTO

This post was last updated on November 3rd, 2020 at 06:06 pmJump to: News Downloads Readings Basic steps to add ACPI and DSDT 2.4.19-acpi-dsdt Hang Recovery Definitions mscompiler battstat_applet fix_broken_dsdt

How To 0 Comments

How To Install a Package From .tar.gz Or .tar.bz2 File In Linux?

This post was last updated on October 25th, 2020 at 10:02 amA file archiver is used to hold multiple files into a single archive file. And a file compression utility is

Linux Topics 0 Comments

How To Create A Zip File In Linux?

This post was last updated on August 1st, 2020 at 12:29 pmZip is an archive file format that supports lossless data compression. Zipping and unzipping tools are available for various

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply