Jump to content


Arch -- useful user tips

arch maintenance security pacman pacaur install

  • Please log in to reply
12 replies to this topic

#1 OFFLINE   abarbarian

abarbarian

    Thread Kahuna

  • Forum MVP
  • 5,396 posts

Posted 25 August 2017 - 09:29 AM

This thread is dedicated to useful tips on running an Arch install.

CCACHE To Help Speed Up Compilation Process When Installing Packages From AUR

You need to install ccache package first. For those wondering, ccache is a fast c/c++ compiler which is used to speed up the compilation process. It speeds up recompilation by caching previous compilations and detecting when the same compilation is being done again. It supports C, C++, Objective-C and Objective-C++.

:breakfast:
Install ARCH
You'll never need to install it again
"I did and I'm really happy"

Posted Image~~~~~~~~~~~~~Posted Image

#2 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 23,104 posts

Posted 25 August 2017 - 09:38 AM

The summary was nice but I wonder why people simply copy the wiki entry to their articles instead of simply linking to the wiki: https://wiki.archlin...ndex.php/ccache
Posted ImagePosted Image Posted Image
CNI Radio/G+ Profile/Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#3 OFFLINE   abarbarian

abarbarian

    Thread Kahuna

  • Forum MVP
  • 5,396 posts

Posted 25 August 2017 - 09:52 AM

Arch linux can be pretty daunting to a new user. Cylon could be a very useful program to help a new user gain some experience with running Arch.
Arch is designed for experienced users but how do you gain experience and what do you need to gain experience in ? Cylon can help in that it gives you an insight to some programs that as a new user you may not even have heard of let alone had any experience with. For instance I have never heard of "rmlint" even though I have been playing with Arch for several years.
There is a danger that if you use Cylon you may end up just scanning a menu and entering a number choice which would not really help you to gain experience on the finer points of running a Arch install.
However if you use Cylon and then read up on and study each of the programs you use you will gain enough knowledge to be able to use the programs on their own in a safe and useful way.

Cylon – The Arch Linux Maintenance Program (2017)


Posted Image

Quote

Meet Cylon, a maintenance program for Arch Linux and derivatives. It is a menu-driven Bash script which provides updates, maintenance, backups and system checks for Arch Linux. Cylon is mainly a CLI program, and also has a basic dialog GUI.

Quote

It provides over 100s of useful options and tools, including the following:
  • cower: AUR package for AUR work
  • gdrive: AUR package for google drive backup
  • lostfiles: AUR package for finding lost files
  • pacaur: AUR helper
  • arch-audit: collect CVE data
  • rmlint: Finds lint and other unwanted
  • rkhunter: finds root kits malware
  • clamav: used for finding malware
  • bleachbit: used for system clean
  • gnu-netcat: used for checking network
  • ccrypt: used for encrypting
  • rsync: used for backup
  • inxi: system information viewer
  • htop: interactive process viewer
  • wavemon: wireless network monitor
  • speedtest-cli: internet bandwidth
  • lynis: system audit tool
  • openbsd-netcat: used for checking network

:breakfast:
Install ARCH
You'll never need to install it again
"I did and I'm really happy"

Posted Image~~~~~~~~~~~~~Posted Image

#4 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 23,104 posts

Posted 25 August 2017 - 09:55 AM

Wow! Cylon seems very neat!! Thanks for post that, I'll have to check that one out. :thumbup:
Posted ImagePosted Image Posted Image
CNI Radio/G+ Profile/Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#5 OFFLINE   abarbarian

abarbarian

    Thread Kahuna

  • Forum MVP
  • 5,396 posts

Posted 25 August 2017 - 10:06 AM

View Postsecuritybreach, on 25 August 2017 - 09:38 AM, said:

The summary was nice but I wonder why people simply copy the wiki entry to their articles instead of simply linking to the wiki: https://wiki.archlin...ndex.php/ccache

Well it is easier to copy than write something original. Mind you sometimes the original does not need any re-write as it is well presented and contains all the necessary information.
At least it looks as though the author is running a Arch install and I am guessing that he has tried out the programs he writes articles for. Unlike some article writers who just copy and paste with no real knowledge of what they are copying and pasting.

:breakfast:

View Postsecuritybreach, on 25 August 2017 - 09:55 AM, said:

Wow! Cylon seems very neat!! Thanks for post that, I'll have to check that one out. :thumbup:

You don't need Cylon as it is for the lazy/new Arch user not super geeks like you. :tease:
Install ARCH
You'll never need to install it again
"I did and I'm really happy"

Posted Image~~~~~~~~~~~~~Posted Image

#6 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 23,104 posts

Posted 25 August 2017 - 10:14 AM

View Postabarbarian, on 25 August 2017 - 10:06 AM, said:

You don't need Cylon as it is for the lazy/new Arch user not super geeks like you. :tease:

Hehe, right B)
Posted ImagePosted Image Posted Image
CNI Radio/G+ Profile/Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#7 OFFLINE   abarbarian

abarbarian

    Thread Kahuna

  • Forum MVP
  • 5,396 posts

Posted 10 September 2017 - 08:14 AM

The Recommended Way To Clean The Package Cache In Arch Linux

The above link gives details of how to manually deal with your package cache. It also gives a way to automate this process and I do love ways to make life easier.

Automatically clean the package cache

You can automate this task using pacman hooks. The pacman hook will automatically clean the package cache after every pacman transaction.

To do so, create a file /etc/pacman.d/hooks/clean_package_cache.hook

# nano /etc/pacman.d/hooks/clean_package_cache.hook

Add the following lines

[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = *
[Action]
Description = Cleaning pacman cache...
When = PostTransaction
Exec = /usr/bin/paccache -ruk1


From now on, the package cache will be cleaned automatically after every pacman transactions (like upgrade, install, remove). You don’t have to run paccache command manually every time.

The guide shows

Exec = /usr/bin/paccache -r

in the script but I have added in the "uk1" as I only want to keep one version of the cached packages and would like to get rid of uninstalled package caches.
Any excuse to fly the flag :Laughing:

:breakfast:
Install ARCH
You'll never need to install it again
"I did and I'm really happy"

Posted Image~~~~~~~~~~~~~Posted Image

#8 OFFLINE   saturnian

saturnian

    Topic Cop

  • Members
  • PipPipPipPipPipPipPip
  • 991 posts

Posted 10 September 2017 - 09:24 AM

Excellent, abarbarian! I've recently started running paccache here, seems like a nice tool.


View Postabarbarian, on 10 September 2017 - 08:14 AM, said:

The guide shows

Exec = /usr/bin/paccache -r

in the script but I have added in the "uk1" as I only want to keep one version of the cached packages and would like to get rid of uninstalled package caches.


See: https://wiki.archlin...e_package_cache

The wiki seems to be saying to run paccache -rk 1 and paccache -ruk0 as separate commands:

Quote

You can also define how many recent versions you want to keep:

# paccache -rk 1

To remove all cached versions of uninstalled packages, re-run paccache with:

# paccache -ruk0


I wondered why it was explained that way in the wiki, so I played around with the --dryrun operation here, with the following results:

steve[~]$ sudo paccache -dk 1

==> finished dry run: 25 candidates (disk space saved: 194.54 MiB)

steve[~]$ sudo paccache -duk0

==> finished dry run: 2 candidates (disk space saved: 18.27 MiB)

steve[~]$ sudo paccache -duk1
==> no candidate packages found for pruning


By the way, it doesn't seem to matter if there's a space before the <num> or not:
steve[~]$ sudo paccache -dk1

==> finished dry run: 25 candidates (disk space saved: 194.54 MiB)

steve[~]$ sudo paccache -duk 0

==> finished dry run: 2 candidates (disk space saved: 18.27 MiB)
steve[~]$ sudo paccache -duk 1
==> no candidate packages found for pruning



Anyway, seems to me that the -u option does make paccache target only uninstalled packages, even though the word "only" isn't included here:

Quote

-u, --uninstalled target uninstalled packages.


#9 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 23,104 posts

Posted 10 September 2017 - 10:25 AM

I just use the following line in my /etc/pacman.conf:

CleanMethod = KeepCurrent

KeepCurrent basically runs pacman -Sc which keeps only the current versions of the installed packages in the cache. I believe this defaults to the last 3 versions as that is what my /var/cache/pacman/pkg directory shows.

I do use a hook to automatically take care of mirrorlist.pacnew files though.

/etc/pacman.d/hooks/mirrorlist.hook
[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Target = pacman-mirrorlist

[Action]
Description = Updating mirrorlist...
When = PostTransaction
Exec = /usr/bin/env sh -c "reflector --country 'United States' --latest 50 --age 24 --sort rate --save /etc/pacman.d/mirrorlist; if [[ -f /etc/pacman.d/mirrorlist.pacnew ]]; then rm /etc/pacman.d/mirrorlist.pacnew; fi"

This basically uses reflector to grab the latest 50 mirrors for the USA and sort them by  speed. Then it removes the /etc/pacman.d/mirrorlist.pacnew file.
Posted ImagePosted Image Posted Image
CNI Radio/G+ Profile/Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#10 OFFLINE   abarbarian

abarbarian

    Thread Kahuna

  • Forum MVP
  • 5,396 posts

Posted 10 September 2017 - 12:30 PM

View Postsaturnian, on 10 September 2017 - 09:24 AM, said:



The wiki seems to be saying to run paccache -rk 1 and paccache -ruk0 as separate commands:



By the way, it doesn't seem to matter if there's a space before the <num> or not:


In the article he uses "rk1" and "rk 1" and it had me puzzled too so I tried both and they both worked so it must be the way the program is coded as some programs would throw a fail if you left/not left a space.

The " u " is indeed for uninstalled packages as I installed and uninstalled a package to see what it did.

He also mentions Securitybreache's " pacman -Sc " tip though not in as much detail.

Thanks for the tip about the pacman mirror list hook SB I'll have a look at it later as I am geeked out at the moment. :breakfast:
Install ARCH
You'll never need to install it again
"I did and I'm really happy"

Posted Image~~~~~~~~~~~~~Posted Image

#11 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 23,104 posts

Posted 10 September 2017 - 12:40 PM

View Postabarbarian, on 10 September 2017 - 12:30 PM, said:

He also mentions Securitybreache's " pacman -Sc " tip though not in as much detail.

Thanks for the tip about the pacman mirror list hook SB I'll have a look at it later as I am geeked out at the moment. :breakfast:

Well the -Sc switch is the built in method

Quote

pacman stores its downloaded packages in /var/cache/pacman/pkg/ and does not remove the old or uninstalled versions automatically, therefore it is necessary to deliberately clean up that folder periodically to prevent such folder to grow indefinitely in size.

The built-in option to remove all the cached packages that are not currently installed is:
# pacman -Sc

https://wiki.archlin...e_package_cache
Posted ImagePosted Image Posted Image
CNI Radio/G+ Profile/Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

#12 OFFLINE   abarbarian

abarbarian

    Thread Kahuna

  • Forum MVP
  • 5,396 posts

Posted 10 September 2017 - 01:14 PM

View Postsecuritybreach, on 10 September 2017 - 12:40 PM, said:

View Postabarbarian, on 10 September 2017 - 12:30 PM, said:

He also mentions Securitybreache's " pacman -Sc " tip though not in as much detail.

Thanks for the tip about the pacman mirror list hook SB I'll have a look at it later as I am geeked out at the moment. :breakfast:

Well the -Sc switch is the built in method

Quote

pacman stores its downloaded packages in /var/cache/pacman/pkg/ and does not remove the old or uninstalled versions automatically, therefore it is necessary to deliberately clean up that folder periodically to prevent such folder to grow indefinitely in size.

The built-in option to remove all the cached packages that are not currently installed is:
# pacman -Sc

https://wiki.archlin...e_package_cache

Yeah but your "CleanMethod = KeepCurrent" tip is a very neat tip as it does not need user input apart from the initial tweak. :laugh:
Install ARCH
You'll never need to install it again
"I did and I'm really happy"

Posted Image~~~~~~~~~~~~~Posted Image

#13 OFFLINE   securitybreach

securitybreach

    CLI Phreak

  • Forum Admins
  • 23,104 posts

Posted 10 September 2017 - 02:21 PM

Glad to help :)
Posted ImagePosted Image Posted Image
CNI Radio/G+ Profile/Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984





Also tagged with one or more of these keywords: arch, maintenance, security, pacman, pacaur, install

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users