Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

Linux Package Management Basics: apt, yum, dnf and pkg

A practical guide to apt, yum, dnf and pkg: identify the right manager, understand Debian and RPM layers, use FreeBSD packages versus Ports, and avoid repository and dependency mistakes.
Length10 min Posted Quest giverVGSources Team

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the package manager that matches your operating system’s packaging family: apt on Debian and Ubuntu, dnf on current Fedora and many RPM-based systems, yum mainly on older or compatibility-focused RPM installations, and pkg on FreeBSD. Each tool refreshes repository metadata, resolves dependencies, installs or removes software, and applies updates, but their repositories, package formats, upgrade rules and source-build options are different.

The safest routine is the same everywhere: identify the release, refresh metadata, inspect the package, read the proposed transaction, then confirm. Keep repositories aligned with that release; mixing distributions or release channels can leave an otherwise healthy system with unsatisfied dependencies.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which package manager belongs to your system?

Package-manager commands are not interchangeable just because they look alike. The distribution family determines the package format, repository layout and dependency policy. Start by checking the operating system rather than guessing from a command found in a tutorial.

System family Primary manager Package ecosystem Typical package file
Debian, Ubuntu and derivatives apt Debian packaging, handled at a low level by dpkg .deb
Fedora and current RPM-based distributions dnf RPM .rpm
Older RPM installations and compatibility workflows yum RPM .rpm
FreeBSD pkg FreeBSD binary packages; source builds use the Ports Collection Repository-provided binary package

On Linux, /etc/os-release normally identifies the distribution and release. On FreeBSD, use the system’s release information and Handbook guidance. Do not infer the manager solely from the desktop environment: a graphical desktop can run on several distribution families.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

How the layers fit together

APT and dpkg

APT is Debian’s high-level interface to the packaging system. It downloads repository metadata, chooses package versions, resolves dependencies and asks the lower-level dpkg database and tools to unpack and configure .deb packages. You normally use apt for interactive administration; apt-get remains the better choice for scripts and advanced, stable command-line workflows.

RPM, yum and dnf

RPM is the package ecosystem underneath Fedora and other RPM-based systems. yum and dnf are repository-aware managers that query RPM metadata, calculate dependencies and execute transactions. Fedora documents that yum was replaced by dnf starting with Fedora 22. A maintained system may still expose a yum command as a compatibility interface, while current Fedora instructions generally use dnf. Red Hat documentation continues to describe yum terminology for supported RHEL workflows, so follow the command and release policy of the system you administer rather than assuming one global rule.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

FreeBSD pkg and Ports

FreeBSD deliberately separates prebuilt packages from source builds. pkg registers, adds, removes and upgrades binary packages from configured repositories. The Ports Collection builds software from source with port-specific options and patches. The FreeBSD Handbook explicitly notes that pkg works with binary packages and is not a replacement for Ports.

Using apt on Debian-family systems

1. Refresh repository metadata

Run:

sudo apt update

This downloads current package indexes. It does not upgrade installed software. If the command reports a disabled repository, signature failure or a distribution codename mismatch, fix that repository before installing anything; continuing with stale or mixed indexes can produce conflicting versions.

2. Search and inspect a package

Search package names and descriptions with:

apt search TERM

Then inspect candidate versions, dependencies and descriptions:

apt show PACKAGE

Searching first helps distinguish an application name from the package that actually provides it. The information shown can also reveal whether a package is available for your enabled release and architecture.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

3. Install software

sudo apt install PACKAGE

APT may propose additional dependencies, configuration changes or removals. Read that transaction summary, especially on a production or gaming machine with large libraries, before entering Y. A package can install successfully yet still require a service restart or a new login before applications see it.

4. Upgrade installed packages

For routine upgrades:

sudo apt upgrade

apt upgrade updates installed packages without normally removing packages to satisfy a more disruptive dependency change. When the dependency graph requires packages to be added or removed, use:

sudo apt full-upgrade

full-upgrade can make broader changes, so inspect the proposed removals and additions rather than treating it as a harmless synonym for upgrade. Refresh metadata first when the machine has not been updated recently.

5. Remove software and unused dependencies

sudo apt remove PACKAGE
sudo apt autoremove

remove uninstalls the named package while generally retaining system-wide configuration files. autoremove targets dependencies that are no longer required. Check the list: a dependency that looks unused to APT may still be needed by a manually installed application or a locally maintained package.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

apt or apt-get?

The concise apt interface is convenient at a terminal and presents human-oriented progress output. Debian’s documentation continues to recommend apt-get for scripts and advanced use because its command behavior and output conventions are intended to be more stable for automation. Do not parse changing human output from apt in a deployment script; use the scripting-oriented tool and explicit error handling instead.

Using dnf and yum on RPM-based systems

Know which command your release expects

On Fedora 22 and later, dnf replaced yum as the standard manager. On older Fedora releases or systems whose vendor documentation still specifies yum, use yum. Some newer systems provide yum as a compatibility command that invokes dnf behavior, but options and plugins can differ. Check the local manual page and release documentation before copying a command into automation.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Refresh or populate metadata

To explicitly populate DNF metadata caches:

sudo dnf makecache

A normal DNF transaction may refresh metadata as needed. Yum-based systems commonly refresh as part of an operation or through their configured cache policy. If repository errors occur, resolve expired metadata, unreachable mirrors, disabled repositories or an incorrect release configuration before attempting installation.

Search and install

dnf search TERM
sudo dnf install PACKAGE

The equivalent legacy syntax is yum search TERM and sudo yum install PACKAGE. DNF calculates dependencies and may install weak dependencies: optional packages that maintainers mark as useful but not strictly required. Review these additions if you want a minimal installation or have limited disk space. A package’s exact dependency set depends on the enabled repositories, architecture and release.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Upgrade the system

sudo dnf upgrade

For yum-managed installations, the traditional command is:

sudo yum update

Both perform repository-based upgrades, but the transaction can include kernel, library and service changes. Read the package list and any restart or configuration notices. Schedule major upgrades when you can reboot or restart affected services, and keep a recovery path for systems that must remain available.

Remove packages and unused dependencies

sudo dnf remove PACKAGE
sudo dnf autoremove

Yum equivalents are sudo yum remove PACKAGE and the corresponding autoremove operation where supported by that release. Removing a package can remove dependents, so examine the proposed transaction. If a supposedly unused library is required by software installed outside the package manager, record that dependency before accepting removal.

Using pkg on FreeBSD

Refresh the package catalog

pkg update

This updates the catalog used to locate binary packages. Repository configuration and the FreeBSD release must agree; a catalog from a different release can make otherwise valid packages appear incompatible.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Find and install a binary package

pkg search TERM
sudo pkg install PACKAGE

pkg search searches the configured binary repository. During installation, read the dependency and replacement summary. Package names and available versions are determined by the repository branch selected for your FreeBSD release.

Upgrade, remove and clean up

sudo pkg upgrade
sudo pkg delete PACKAGE
sudo pkg autoremove
sudo pkg clean

pkg upgrade updates installed packages. pkg delete removes a named package, while pkg autoremove removes dependencies no longer needed. pkg clean clears cached package files; use it when cache storage is consuming space, but remember that deleting the cache means future reinstalls must download the packages again.

Audit installed packages

pkg audit -F

This checks installed packages against FreeBSD’s available vulnerability data. Treat findings as maintenance work: identify the fixed package version, update the repository catalog, upgrade the affected package and investigate whether an unavailable fix requires temporarily disabling the software or applying a documented mitigation.

When Ports is the better fit

Use the Ports Collection when you need a source build, port-specific options, a patch not present in the binary repository or a workflow that deliberately compiles locally. Ports adds build time and maintenance responsibility. A host that mixes manually built software and packages needs clear ownership of files and dependencies; otherwise a later binary upgrade can overwrite assumptions made by the source build.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Command reference

Task Debian/Ubuntu Fedora/RHEL FreeBSD
Refresh metadata sudo apt update sudo dnf makecache; yum may refresh during a transaction pkg update
Search apt search TERM dnf search TERM or yum search TERM pkg search TERM
Inspect package apt show PACKAGE Use package information commands documented by the local dnf/yum release Use the local pkg man page for repository details
Install sudo apt install PACKAGE sudo dnf install PACKAGE or sudo yum install PACKAGE sudo pkg install PACKAGE
Upgrade all sudo apt upgrade or sudo apt full-upgrade sudo dnf upgrade or sudo yum update sudo pkg upgrade
Remove sudo apt remove PACKAGE sudo dnf remove PACKAGE or sudo yum remove PACKAGE sudo pkg delete PACKAGE
Remove unused dependencies sudo apt autoremove sudo dnf autoremove sudo pkg autoremove

Exact options, transaction behavior and plugin support vary by release. Read the local man page before scripting a destructive operation, and never assume that a command with the same name has identical defaults across distributions.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What differs beyond the command names?

Repository trust and configuration

Each manager trusts repository signing keys and metadata configured for a particular release. A package manager cannot make an untrusted third-party repository safe merely because the package installs cleanly. Prefer the distribution’s repositories or a vendor repository whose signing and support policy you understand. Keep repository definitions on the correct release codename or version; mixing stable, testing, end-of-life and rolling sources is a common cause of dependency conflicts.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Dependency solving

APT, DNF/yum and pkg all calculate dependencies, but package maintainers express optional components differently. DNF’s weak-dependency feature can bring in recommended functionality that is not strictly required. APT’s full-upgrade can remove packages to complete a dependency transition. FreeBSD package repositories and Ports can expose different option sets. Always read the proposed transaction instead of judging risk from the one package named in your command.

Upgrade semantics and recovery

An upgrade is a transaction, not a single-file replacement. It may unpack a new library, run maintainer scripts, restart a service or require a reboot. Keep backups of important configuration and save a record of intentionally installed packages. If an upgrade fails, do not repeatedly delete random package files: inspect the manager’s error, restore repository consistency, finish interrupted configuration using the distribution’s documented recovery procedure and then retry with the correct release metadata.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Binary packages versus source builds

Binary packages are fast, reproducible within the repository’s policy and receive coordinated updates. Source builds offer compile-time choices and local patches but require compilers, build dependencies and a plan for future updates. FreeBSD makes this distinction explicit through pkg and Ports; Linux distributions also provide source-build workflows, but those files are outside the normal dependency database unless you package them properly.

A safe package-management workflow

  1. Identify the operating system and release. Confirm the distribution family, version, architecture and whether the release is still supported.
  2. Check repository configuration. Disable stale, duplicate or mixed-release entries. Verify that signing keys and mirror locations are expected for this system.
  3. Refresh metadata. Use sudo apt update, sudo dnf makecache or pkg update as appropriate.
  4. Search and inspect. Find the package, review its description, candidate version and dependencies, and confirm that it matches your architecture and release.
  5. Review the transaction. Look for removals, newly installed libraries, held packages, kernel updates and service restarts. Stop if an essential desktop, network or gaming dependency is unexpectedly scheduled for removal.
  6. Apply the transaction. Install, upgrade or remove the package and watch for configuration prompts or errors rather than leaving the terminal unattended.
  7. Restart what changed. Reboot when a kernel or core system library requires it, and restart affected services according to the package’s instructions.
  8. Audit and clean up. On FreeBSD, run pkg audit -F. On every system, remove only caches and orphaned dependencies you have reviewed, and retain logs needed to diagnose a failed update.

Common problems and practical fixes

“Package not found”

Refresh metadata, check spelling and search the package name. If it still does not appear, verify that the required repository component is enabled and that the package exists for your release and architecture. Do not solve a missing package by mixing repositories from another release.

Dependency conflicts after changing repositories

Stop further installs. Restore a consistent set of repositories, refresh metadata and inspect which packages are pinned, held or installed from another source. A partial downgrade or forced replacement can create a larger problem than the original conflict.

Unexpected removals in an upgrade

Cancel the transaction and investigate why the resolver wants those removals. On Debian-family systems, distinguish a conservative upgrade from full-upgrade. On RPM systems, check enabled repositories and module or plugin policies. On FreeBSD, confirm that the package repository matches the running release.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Insufficient disk space

Review cached packages, old kernels and unused dependencies using the manager’s own cleanup commands. Free space before retrying, but do not manually erase database files or package-management directories; those records are needed for safe dependency resolution and removal.

Source-built software is missing from package queries

A program compiled outside the package manager may not appear in apt, dnf, yum or pkg as an installed package. Track its source, build options and update method, or rebuild it as a proper package so the system can account for its files and dependencies.

Bottom line

Choose by operating-system family, not by personal preference: APT for Debian-family systems, DNF for current Fedora-style RPM systems, yum where the installed release still specifies it, and pkg for FreeBSD binary packages. Refresh metadata before every meaningful change, inspect the resolver’s transaction, keep repositories on the same release, and choose Ports or another source-build workflow only when the control it provides justifies the extra maintenance.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.