Author Topic: [How-To] Short pacman tips:  (Read 33034 times)

0 Members and 1 Guest are viewing this topic.

Offline YFDogan

  • Support Team
  • ****
  • Posts: 1211
    • http://www.manjaro-tr.org/
  • Branch: Stable
  • Desktop: KDE
  • GPU Card: Optimus (GeForce GT 540M)
  • GPU driver: Non-free
  • Kernel: Linux manjaro 3.14.4-1-MANJARO #1 SMP PREEMPT Mon May 19 15:45:30 EST 2014 x86_64 GNU/Linux
  • Skill: Novice
[How-To] Short pacman tips:
« on: 16. January 2013, 14:10:16 »
[edit:] This page has been wikified:

http://wiki.manjaro.org/index.php?title=Pacman_Tips
_______


A short tutorial about 'pacman' commands:

Synchronise pacman with repos:

Code: [Select]
pacman -Syy

Optimize the sync and download speed:

Code: [Select]
pacman-optimize && sync

Update System:

Pacman can update your system with only one command:

Code: [Select]
pacman -Su

BTW ,it will be usually better to sync your repo database first:

Code: [Select]
pacman -Syu

Update with ignore a package:

Code: [Select]
IgnorePkg=package_name
Update with ignore a package group:

Code: [Select]
IgnoreGroup=package_group
Example:
Code: [Select]
IgnoreGroup=gnome
Code: [Select]
IgnoreGroup=kde

TO INSTALL:


1- ─░nstall a package:

Code: [Select]
pacman -S package_name
*If there are same packages in different repositories, such as 'extra' or 'testing', you should use pacman like this:

Code: [Select]
pacman -S extra/package_name
Code: [Select]
pacman -S testing/package_name
Which one you need, use the right repo.


2- Install packages as a group:

Code: [Select]
pacman -S gnome
Code: [Select]
pacman -S kde
Important Points:
* If you select a package that has been allready in your system installed, you may use '--needed' , otherwise this package will be reinstalled, even if it is updated.

* Before install a package do not update your package list. This may occurs errors about dependencies. Before installing a package, update your system first.


3- Download a package without installation

Code: [Select]
pacman -Sw package_name

4- Install a downloaded or a local package:

Code: [Select]
pacman -U /package_path/package_name.pkg.tar.xz
You can also use the URL:

Code: [Select]
pacman -U http://www.examplepackage/repo/examplepkg.tar.xz

5- Reinstall all packages:

Code: [Select]
pacman -S $(pacman -Qq | grep -v "$(pacman -Qmq)")

6-To search which packages has been installed in a group :

Code: [Select]
pacman -Sg gnome
Code: [Select]
pacman -Sg kde
7- Get a full package list with versions:

Code: [Select]
sudo pacman -Q > laptop.pacman
After enter the password, a file called 'pacman.laptop' is created in your home folder.


TO REMOVE


1-Remove a package:

Code: [Select]
pacman -R package_name

2- Remove a packages with depenedencies that not being used by different packages:
 
Code: [Select]
pacman -Rs package_name

3- Remove a package with all dependencies:

Code: [Select]
pacman -Rsc package_name
*Pacman is saving the conf files when you remove packages and save it as .pacsave. If you want to remove a package with conf files :

Code: [Select]
pacman -Rn package_name

4- Remove all nonneeded packages:

Code: [Select]
pacman -Sc $(pacman -Qdtq)

5-Remove everything in cache:

Code: [Select]
pacman -Scc


TO CLEAN:


1- cleaning the cache:

Code: [Select]
pacman -Sc

2- Clean the nonneeded packages anymore:

Code: [Select]
pacman -Rs $(pacman -Qtdq)

TO SEARCH:

1- Search a package with explanations:

Code: [Select]
pacman -Ss package_name

2- Search packages that allready being installed:

Code: [Select]
pacman -Qs package_name

3- Get a knowledge about a package:

Code: [Select]
pacman -Si package_name
Code: [Select]
pacman -Qi package_name
*with 'ii' you can see the backup files and the date that the package has been changed.

Code: [Select]
pacman -Qii package_name

4- Get a list of installed packages:

Code: [Select]
pacman -Ql

5- To which package is this file belong to:

Code: [Select]
pacman -Qo /file_path

6- List all unnecessarry packages with no dependencies:

Code: [Select]
pacman -Qdt

7-To see the dependencies of a package:

Code: [Select]
$ pactree package_name


AUR

You have three options to use AUR repos:


1- YAOURT

Code: [Select]
sudo pacman -S yaourt(This is preinstalled with Manjaro, so you don't need to run this cmd).


2-PACKER

Able to install both official repos and AUR.

Code: [Select]
yaourt -S packer
Since you installed 'packer' than you can run:

Code: [Select]
packer -S package_name

3- MERIC

Developed by 'tarakbumba' and similar too packer.

Code: [Select]
yaourt -S meric
Code: [Select]
packer -S meric
Code: [Select]
meric -S package_name

UPDATE AUR PACKAGES


Simple use 'packer'

Code: [Select]
packer -syu


Hope it is understandble and also hope it will be help you. If there is something wrong please warn me.
« Last Edit: 13. May 2013, 09:16:37 by handy »
Manjaro Linux with DELL Insipiron N5110 i7 8GB Ram, Nvidia-Optimus
http://manjaro-tr.org/forum/index.php

Offline Holmes

  • Mirror Support Team
  • ***
  • Posts: 2039
  • Brazilian and Hispanic Support Team
    • Manjaro Brasil
  • Branch: Stable
  • Desktop: Manjaro XFCE
  • GPU Card: Mobile Intel (R) 945
  • GPU driver: Non-free
  • Kernel: kernellinux
  • Skill: Novice
Re: [How-To] Short pacman tips:
« Reply #1 on: 16. January 2013, 14:45:53 »
Hi YFDogan, very good and will help a lot of people!

vlw fwi, Holmes :)


==> Manjaro Brasil I Manjaro Hispano
==> IRC Manjaro Brasil: #manjaro-br I IRC Manjaro Hispano: #manjaro-es

Offline YFDogan

  • Support Team
  • ****
  • Posts: 1211
    • http://www.manjaro-tr.org/
  • Branch: Stable
  • Desktop: KDE
  • GPU Card: Optimus (GeForce GT 540M)
  • GPU driver: Non-free
  • Kernel: Linux manjaro 3.14.4-1-MANJARO #1 SMP PREEMPT Mon May 19 15:45:30 EST 2014 x86_64 GNU/Linux
  • Skill: Novice
Re: [How-To] Short pacman tips:
« Reply #2 on: 16. January 2013, 14:46:31 »
Hope so borther. :)
Manjaro Linux with DELL Insipiron N5110 i7 8GB Ram, Nvidia-Optimus
http://manjaro-tr.org/forum/index.php

Offline simgin

  • Held Mitglied
  • *****
  • Posts: 774
  • Branch: All.
  • Desktop: XFCE+Alpine Linux, Mate+Fedora, Ubuntu Server + Mate and NoX+LinuxBBQ
  • GPU Card: GeForce 8600M & GT 555M 2GB
  • Skill: Intermediate
Re: [How-To] Short pacman tips:
« Reply #3 on: 16. January 2013, 14:48:02 »
Nice to have it all on one page YFDogan :) Thank you.

Now I'll see how I can make it into a text format, so I can use it if the system is crashed etc. :D

Offline YFDogan

  • Support Team
  • ****
  • Posts: 1211
    • http://www.manjaro-tr.org/
  • Branch: Stable
  • Desktop: KDE
  • GPU Card: Optimus (GeForce GT 540M)
  • GPU driver: Non-free
  • Kernel: Linux manjaro 3.14.4-1-MANJARO #1 SMP PREEMPT Mon May 19 15:45:30 EST 2014 x86_64 GNU/Linux
  • Skill: Novice
Re: [How-To] Short pacman tips:
« Reply #4 on: 16. January 2013, 14:50:11 »
I read some messages about use the terminal from noob users such as I am :). So , have a little search and decided to publish this.
Manjaro Linux with DELL Insipiron N5110 i7 8GB Ram, Nvidia-Optimus
http://manjaro-tr.org/forum/index.php

Offline hsngrms

  • Neuling
  • *
  • Posts: 33
Re: [How-To] Short pacman tips:
« Reply #5 on: 16. January 2013, 16:53:56 »
Thanks @YFDogan, it's more understanable than 'man pacman' :)

Offline ultima

  • Held Mitglied
  • *****
  • Posts: 1563
Re: [How-To] Short pacman tips:
« Reply #6 on: 18. January 2013, 02:49:20 »
Thanx for posting , need it bad .

Offline YFDogan

  • Support Team
  • ****
  • Posts: 1211
    • http://www.manjaro-tr.org/
  • Branch: Stable
  • Desktop: KDE
  • GPU Card: Optimus (GeForce GT 540M)
  • GPU driver: Non-free
  • Kernel: Linux manjaro 3.14.4-1-MANJARO #1 SMP PREEMPT Mon May 19 15:45:30 EST 2014 x86_64 GNU/Linux
  • Skill: Novice
Re: [How-To] Short pacman tips:
« Reply #7 on: 22. January 2013, 12:37:09 »
My pleasure. :)
Manjaro Linux with DELL Insipiron N5110 i7 8GB Ram, Nvidia-Optimus
http://manjaro-tr.org/forum/index.php

Offline eskaini

  • Security Team
  • *****
  • Posts: 10842
  • I eat deleted accounts
  • Skill: Novice
Re: [How-To] Short pacman tips:
« Reply #8 on: 22. January 2013, 12:57:56 »
My pleasure. :)

Thank you Mr. Dogan. I shall update the pacman wiki page with this stuff today. A few things on the wiki are badly in need of updating!

Edit: Haven't forgotten - will do this!
« Last Edit: 15. February 2013, 22:17:06 by Carl »

Offline Olde_Toad

  • Neuling
  • *
  • Posts: 22
Re: [How-To] Short pacman tips:
« Reply #9 on: 22. January 2013, 14:42:51 »
Carl, G/Day in the UK. LOL. I noticed last night that several of the commands in the Wiki have been altered i.e. not inserting sudo before pacman etc. I'm Older than Dirt, but still above it, and i have to go look ocasionally to remind myself of a proper command is how i discovered these alterations. With No disrespect intended, some of the experienced Gent's forget that a Linux Beginner Has No Clue what sudo is. Thks for your attention to this matter.

                                                                                                                                         Have a Gr8 Day,

                                                                                                                                          Tom


                                                                                                                                                     

Offline eskaini

  • Security Team
  • *****
  • Posts: 10842
  • I eat deleted accounts
  • Skill: Novice
Re: [How-To] Short pacman tips:
« Reply #10 on: 22. January 2013, 15:05:39 »
Carl, G/Day in the UK. LOL. I noticed last night that several of the commands in the Wiki have been altered i.e. not inserting sudo before pacman etc. I'm Older than Dirt, but still above it, and i have to go look ocasionally to remind myself of a proper command is how i discovered these alterations. With No disrespect intended, some of the experienced Gent's forget that a Linux Beginner Has No Clue what sudo is. Thks for your attention to this matter.

                                                                                                                                         Have a Gr8 Day,

                                                                                                                                          Tom


                                                                                                                                                     

Putting sudo up before most (if not all) of the commands everywhere before was my mistake; it was after another forum member pointed out that it can change file permissions to root when editing one's own files that alarm bells rang. I'll be going through the entire wiki again to ensure that there are no further improper uses of sudo...

I'm quite the noob myself, I'm afraid. Thankfully community members have provided a lot of support, and have been contributing to the wiki quite a lot (e.g. Handy).

Offline eskaini

  • Security Team
  • *****
  • Posts: 10842
  • I eat deleted accounts
  • Skill: Novice
Re: [How-To] Short pacman tips:
« Reply #11 on: 15. February 2013, 21:53:00 »
Hi,

could somebody please explain the difference between:

13- Remove all nonneeded packages:
Code: [Select]
pacman -Sc $(pacman -Qdtq)
18- Clean the nonneeded packages anymore:
Code: [Select]
pacman -Rs $(pacman -Qtdq)
Thanks.

Offline YFDogan

  • Support Team
  • ****
  • Posts: 1211
    • http://www.manjaro-tr.org/
  • Branch: Stable
  • Desktop: KDE
  • GPU Card: Optimus (GeForce GT 540M)
  • GPU driver: Non-free
  • Kernel: Linux manjaro 3.14.4-1-MANJARO #1 SMP PREEMPT Mon May 19 15:45:30 EST 2014 x86_64 GNU/Linux
  • Skill: Novice
Re: [How-To] Short pacman tips:
« Reply #12 on: 15. February 2013, 22:12:56 »
13- Removed packages also from cache.
18- Remove package from your system.
Manjaro Linux with DELL Insipiron N5110 i7 8GB Ram, Nvidia-Optimus
http://manjaro-tr.org/forum/index.php

Offline dicktater

  • Held Mitglied
  • *****
  • Posts: 2056
  • Skill: Novice
Re: [How-To] Short pacman tips:
« Reply #13 on: 15. February 2013, 23:07:06 »
Check out handy's remarkable wiki entry, too!
http://wiki.manjaro.org/index.php/Orphan_Package_Removal
The Manjaro Forum Revised Rules  How to Report Issues Properly   Please Read the Manjaro Wiki

Offline Culinax

  • Support Team
  • ****
  • Posts: 1146
  • Branch: Unstable
  • Desktop: Awesome 3.5
  • GPU Card: NVIDIA GeForce 710M - Intel (Optimus)
  • GPU driver: Free Driver
  • Kernel: Linux315-x64
  • Skill: Intermediate
Re: [How-To] Short pacman tips:
« Reply #14 on: 16. February 2013, 10:00:23 »
13- Remove all nonneeded packages:
Code: [Select]
pacman -Sc $(pacman -Qdtq)

Is it possible that that doesn't even exist? I've never seen any case where pacman -Sc took an argument. + I just tested it myself and it had the same effect as pacman -Sc


pacman -Rs $(pacman -Qtdq): Removes all programs that don't depend on any other program (the so called 'orphans') + their dependencies. Many times they're unnecessary crap, but you should always check the list before typing 'y' because there might be some programs you actually use.

pacman -Sc: When you install a program with pacman, then it first downloads the package and then installs it. All those downloaded packages get stored in the cache (/var/cache/pacman/). What pacman -Sc does is removing all those packages except for the programs that are currently installed.
Manjaro Awesome WM Respin: Current version: 0.8.10
Belgian/Dutch Manjaro Linux users: unite! http://manjaro-nl.org/ | IRC: #manjaro-nl