Basic Pacman Commands For Arch Base Linux



 

Please Read This 👇🏾

 

Arch is an advance level Linux distro which is specifically loved by experienced / advance Linux users. Dealing with Arch base distro gives you a great experience about Linux. Arch base Linux system use pacman as a default package managing tool. According to man page "Pacman is a package management utility that tracks installed packages on a Linux system. It features dependency support, package groups, install and uninstall scripts, and the ability to sync your local machine with a remote repository to automatically upgrade packages. Pacman packages are a zipped tar format". If you are learning or start learning Arch/ Arch base distro then this post is helpful for your because today we will see some basic operation of pacman utility & try to understand its format structure.

Basic Manipulate Commands: We will start with basic so its easy to understand what pacman utility can do . We will see how  installation , removing , upgrading & dependencies are handled by this utility.

Note: All commands can only be executed with root privileges

i) pacman -S package1 package2

This command will install a package/s in the system. Where s stands for sync 

list of pacman commands



ii) pacman -Sw package_name

Only download the given package name , will not extract/install.

pacman package download  command


iii) pacman -Rs package1 package2

This command will remove a package/s from the system. Where R for remove and s means sync.

pacman package remove command


iv) pacman -Ss package_name

This command will search for package(s) by searching the expression in name, description, short description.Where S means sync & s means search

search a package in pacman arch linux



v) pacman -Syu

This command will perform the upgrade for packages which are installed in the system.Where S for sync,y for refresh, u

system update command in arch linux manjaro


vi) pacman -Sc or pacman -Scc

This command will perform clean up all local caches.

pacman clear  cache  command arch linux manjaro


vii) pacman -Qdtq | pacman -Rs -


This command will remove dependencies that are no longer needed.

pacman remove dependency which are not required arch linux


Note: You have to switch to root in order to perform this action.

viii) pacman -Qmq | pacman -Rs -

This command will remove packages which are no longer included in any repositories.

remove package no longer available in source repo list


ix) pacman -D --asexplicit package_name

This command will mark a package previously installed as a dependency as explicitly required. That means if you remove the base package which included that dependency , will remain after the base package removed. 
                      e.g you installed a package with some python library files as a dependency and now you don't want to uninstall these python library files for some reason , then you can use above command.

pacman -D --asexplicit kde-gtk-config
 

x) pacman -S --asdeps
This command will install a package as dependency without marking it explicitly required.



xi) cat /var/log/pacman.log  
  
You can find all the logs performed by pacman utility,



xii) ls -l /var/lib/pacman/local

You will find the dump information of all packages here which are managed by pacman utility


xiii) pacman -Rsn package_name

To completely remove a package with all its configuration. 
 

xiv) sudo pacman-mirrors --fasttrack && sudo pacman -Syyu
 
Auto connect your system to the fastest mirror in Manjaro Linux.

If You think there is any command that I should add in the list , Please feel free to comment below. I will definitely add that command.


Sharing is Caring, Please share with your friends If you find this helpful  😀


Post a Comment

0 Comments