pacman –sync Command Examples

“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.

Related Post