PacUI: Bash script providing advanced Pacman and Yay/Pikaur/Aurman/Pakku/Trizen/Pacaur functionality in a simple UI

cli
pacui
pacman
yay
aur

#241

i had been missing package groups for a long time.
every time i have read something like “install LXQt group with sudo pacman -S lxqt command”, it did not work in pacui. after a while, i simply implemented package groups.

it has some drawbacks, too:

  • “remove packages” option shows you about 130 more packages than you have installed on your system. if you want to know the exact number, you have to choose “reverse dependency tree” option.
  • package groups do not have a version number and description (the same as AUR packages), only packages from the manjaro repositories have that. this means, it is possible to confuse package groups with AUR packages.
  • the “remove packages” option shows ALL packages groups, even if they are not installed on your system. i have not found a simple way to change that.

#242

as i have explained in my last post, all input is handled by a “read” command, which needs to be quit with the ENTER key. but thanks to some tip i have added an exception for the ESC key in the latest commit:

you can test it by installing “pacui-git” from the AUR.


#243

i think this does not work out.

my terminal is completely messed up (i cannot use my arrow keys anymore) after i have quit pacui’s GUI with the ESC key (= the “stty intr ^[” ran). the only way of getting back a working terminal is “stty sane”.

i revert the change now.
when you find a better way of implementing this feature, please let me know.


#244

Yes, appreciate the effort. :thumbsup: (I assume it is clashing with the ‘^[’ part of ‘^[[A’ for arrow keys?) I got the same behaviour manually testing here and couldn’t get it to work on trying some modifications. I thought there would be a way to only modify the interrupt key temporarily or ‘one time only’ or similar, maybe with an additional option on the command, but searched the man stty page and don’t see anything helpful? :disappointed_relieved::confused: Let me try search for an alternative method… [edit: but don’t specialize in shell scripts though so… :neutral_face:]

No problem that the other issue is an upstream problem.


#245

i have also tested “stty intr \033” and the result was the same (at least on my system). can you confirm this?
“stty intr \033” should theoretically only modify the ESC key.


#246

Yes \033 and ^[ behave the same in this setting for me also.


#247

i have just released version 1.5 of pacui.
the changelog can be read here: https://github.com/excalibur1234/pacui/releases/tag/1.5

it might be a while before it appears in the stable repositories, because it requires at least version 4.2 of pacman-mirrors. without pacman-mirrors 4.2, the “clean system” and “fix pacman errors” options are broken!

edit: pacman-mirrors 4.2 is in the stable branch since yesterday. feel free to update to pacui 1.5 or pacui-git from the AUR.


#248

A feature request as a long term target.
I haven’t found a solution in pacman or yaourt to give a list of installed packages sorted by installed size.
Pamac can do it, Octopi IIRC, too.


#249

i assume you want to see, which packages need the most hard drive space and remove them. i usually do this kind of thing with

sudo ncdu / -x

(press “d” to delete files/directories)

ncdu shows you folders and files. if you want to know to which package a file belongs, do a “pacui s” (search package file option in pacui) and search for the file name (this only works with files installed by the package directly!).


a method of getting a list of packages sorted by installed size is:

package-query -Q --sort 2 -f "%2 - %n"

(shows size of packages in bytes and package name )

you can also do:

package-query -Q --show-size --sort 2

p.s.: you can also do that with the -Sl argument instead of -Q, which will give you a list of packages in the manjaro repositories. the largest package requires 7.8gb!


do you think this is really worth an extra option in pacui?
it would be rather easy to create (now, that i have found a command, which does the thing you are asking for).

which of the commands above do you like better? should i display more information?

this command makes the result look good (and gives dependencies of each package):

package-query -Q --rsort 2 -f "%2 - \e[1m%n \e[0m(%D)"

this command only displays explicitly installed packages:

package-query -Qe --sort 2 -f "%2 - \e[1m%n \e[0m%v"


the best option would be to sort the packages by their installed size + installed size of all dependencies, which will be removed with "pacman -Rns ". but i have not found a way to do that.


#250

with the latest commit, i have added a hidden option to pacui, which displays all packages listed by their size: https://github.com/excalibur1234/pacui/commit/63aa09e33a2704c8ad13c77d1dbbe6c8d2c7612c

you need to (re-)install pacui-git from the AUR and can call the option with “pacui ls”.


#251

Very cool! Works! Is a human readable file size difficult to achieve? Probably yes, because it is not an option in package-query. :frowning:


#252

i just did it with latest commit.

should i display more information about a package?
i have tested to display all dependencies of each package, but i find the result hard to read. you can test this with the command:

package-query -Q --sort 2 -f "%2 - \e[1m%n \e[0m(%D)" | numfmt --to=iec


#253

It works quite fine, but in xfce4-terminal (haven’t checked others ATM) I get a strange scrolling issue:


It doesn’t happen with a maximized window. I think it can be fixed with a shorter header text or a newline char in the text.


#254

i have just shortened the prompt of fzf. now, it has the same length as all other prompts and is narrower than pacui GUI’s width: https://github.com/excalibur1234/pacui/commit/f355fd08381993fcb8b675fff32303908145dd0c

when i add this option to the GUI, would you prefer it as option no.6 or option no.5 (and move the current option 5 to no.6)?

p.s.: i usually have similar rendering bugs, when i use pacui in tty (press CTRL+ALT+F2). it looks strange and is sometimes hard to read, but it still works.


#255

inspired by a part of the update-notifier script from @Chrysostomus, i added a new part to the “clean system” option in pacui:

		echo "checking installed kernels ..."
		# check, if any installed kernel is EOL:
		
		# 0. delete old temporary file to avoid strange errors. ignore all output of "rm" command (such as output, messages, or errors).
		rm /tmp/.installed_kernels /tmp/.available_kernels /tmp/.uptodate_kernels /tmp/.eol_kernels &>/dev/null
		
		# 1. create lists of installed and available kernels (and ignore all errors).
		mhwd-kernel -li 2>/dev/null | awk '/ linux/ {print $2}' > /tmp/.installed_kernels
		mhwd-kernel -l 2>/dev/null | awk '/linux/ {print $2}' > /tmp/.available_kernels
		
		# 2. Check if all installed kernels are eol:
		if ! [[ -z $(cat /tmp/.available_kernels) ]]   # make sure that file is not empty
		then
			# write all kernels, which are installed and still available to /tmp/.uptodate_kernels
			grep -f /tmp/.available_kernels /tmp/.installed_kernels > /tmp/.uptodate_kernels
			# write all kernels, which are NOT up-to-date anymore, but which are still installed to /tmp/.eol_kernels
			grep -v -f /tmp/.uptodate_kernels /tmp/.installed_kernels > /tmp/.eol_kernels
			if ! [[ -z $(cat /tmp/.eol_kernels) ]]   # make sure that file is not empty
			then
				echo -e "\e[1;41m The following Linux kernels have reached their end-of-live status. \e[0m"
				echo -e "\e[1;41m Do not expect any security or stability fixes for those kernels anymore. \e[0m"
				echo -e "\e[1;41m Kernel modules are likely to break. Please remove these Linux kernels: \e[0m"
				cat /tmp/.eol_kernels
			fi
		fi

thanks a lot @Chrysostomus for the “inspiration”. as you see, my code is quite similar to yours. i have extended it a little to mention the name of all EOL kernels. feel free to let yourself get “inspired” by that part…


#256

Btw, have you considered adding support for simultaneously installing packages from repos and aur with option 3?


#257

i have never actually thought about it, but did some tests:
all non-aur packages get installed first using pacman and then all aur packages get installed using pacaur/yaourt.

if you want all packages to get installed at the same time, i would need to use pacaur/yaourt exclusively for installation of packages. this could be done easily. is this what you are talking about?

p.s.: i just did the adjustment you asked for:


#258

In my experience, it has worked like this (with yaourt): if I choose multiple packages and one of them is in aur, then the whole operation fails because some packages are not in the repos. If I choose only aur packages or only repo packages, there has been no problem.


#259

i could not tell, because i am using pacaur for a while now.

any way, it should work now. if it does not work, it is the fault of yaourt and there is nothing i can do about it.
my tests with pacaur were successful, though.


#260

inspired by pcurses, which @Chrysostomus talks about in this topic, i created a similar option for pacui:

now, pacui will show package/group information for the “install”, “remove”, “force install”, and “force remove” options! i removed the “info” option, because it is now obsolete!
you can test this new feature in the latest build of pacui-git.