Jump to content

Recommended Posts

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:

  • Like 1

Share this post


Link to post
Share on other sites

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)

 

 

Cylon-The-Arch-Linux-Maintenance-Program-720x340.png

 

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.

 

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:

  • Like 1

Share this post


Link to post
Share on other sites

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:

 

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:

  • Like 1

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

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

 

 

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:

 

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:

 

-u, --uninstalled target uninstalled packages.

  • Like 1

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites

 

 

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:

  • Like 1

Share this post


Link to post
Share on other sites

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

 

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

Share this post


Link to post
Share on other sites

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

 

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:

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...