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
ii) pacman -Sw package_name
Only download the given package name , will not extract/install.
iii) pacman -Rs package1 package2
This command will remove a package/s from the system. Where R for remove and s means sync.
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
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
vi) pacman -Sc or pacman -Scc
This command will perform clean up all local caches.
vii) pacman -Qdtq | pacman -Rs -
This command will remove dependencies that are no longer needed.
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.
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 😀
0 Comments