• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

pacman –sync Command Examples

by Deepika

“pacman –sync” is an option for the pacman package manager in Arch Linux and its derivatives. It is used to install, upgrade, and sync packages from remote repositories.

When used with the name of a package, “pacman –sync” installs that package and its dependencies from a remote repository. If the package is already installed, “pacman –sync” will upgrade it to the latest available version.

pacman –sync Command Examples

1. Install a new package:

# sudo pacman --sync {{package_name}}

2. Synchronize and update all packages (add –downloadonly to download the packages and not update them):

# sudo pacman --sync --refresh --sysupgrade

3. Update all packages and install a new one without prompting:

# sudo pacman --sync --refresh --sysupgrade --noconfirm {{package_name}}

4. Search the package database for a regular expression or keyword:

# pacman --sync --search "{{search_pattern}}"

5. Display information about a package:

# pacman --sync --info {{package_name}}

6. Overwrite conflicting files during a package update:

# sudo pacman --sync --refresh --sysupgrade --overwrite {{path/to/file}}

7. Synchronize and update all packages, but ignore a specific package (can be used more than once):

# sudo pacman --sync --refresh --sysupgrade --ignore {{package_name}}

8. Remove not installed packages and unused repositories from the cache (use two –clean flags to clean all packages):

# sudo pacman --sync --clean

Summary

In summary, “pacman –sync” is a crucial option for managing packages in Arch Linux and its derivatives. It allows the user to easily install or upgrade packages from remote repositories, ensuring that the system is always up-to-date with the latest available software.

Filed Under: Linux

Some more articles you might also be interested in …

  1. btrfs Command Examples in Linux (cheat sheet)
  2. Linux OS Service ‘sshd’
  3. How to Configure a Fiber-Channel Over Ethernet (FCoE) Interface in CentOS/RHEL
  4. How to Remove a Dead Mulitpath Device without Reboot in CentOS/RHEL
  5. getcap Command Examples in Linux
  6. dm-tool: command not found
  7. How to debug systemd boot process in CentOS/RHEL 7 and 8
  8. How to Run DNS and FTP services in a chroot Jail
  9. deborphan Command Examples in Linux
  10. Images preview with ngx_http_image_filter_module

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright