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.
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 –
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 –
Now use the following command to upgrade all the packages –
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.
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 –
make install clean
Now once this utility gets installed, use the following command to upgrade all the outdated ports –
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
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.
You might also like
This post was last updated on August 1st, 2020 at 12:21 pmDifferent Linux distribution comes with different tools to manage software packages on it. Debian and its derivative use the
This post was last updated on August 1st, 2020 at 08:53 amDocker image is an immutable file that is essentially a snapshot of a container. Images are created with build command, and