Manjaro-Pek / pacli

A simple and interative Bash Frontend for Pacman/Yaourt/Pacaur
GNU General Public License v2.0
44 stars 8 forks source link

2. Clean system hangs with no candidate packages found for pruning. #40

Closed freed00m closed 8 years ago

freed00m commented 8 years ago

Hi, I have a problem, I can't seems to exit from optimazition now called Clean system. It hangs even withou empty cache. The problem wasn't present before since manjaro stable update today.

The process ends up with

-> 0.385 http://mirror.nexcess.net/manjaro/stable/$repo/$arch
-> 0.510 http://distro.ibiblio.org/manjaro/stable/$repo/$arch
:: Generated and saved '/etc/pacman.d/mirrorlist' mirrorlist.
:: Synchronising package databases...
 core                     137.8 KiB  1436K/s 00:00 [#################] 100%
 extra                   1895.0 KiB  2.48M/s 00:01 [#################] 100%
 community                  3.6 MiB  2.48M/s 00:01 [#################] 100%
 multilib                 184.2 KiB  2.57M/s 00:00 [#################] 100%
stat: cannot stat '/var/cache/pacman/pkg/*.pkg.tar?(.+([^.]))': No such file or directory
==> Privilege escalation required
rm: cannot remove '/var/cache/pacman/pkg/*.pkg.tar?(.+([^.]))': No such file or directory

==> finished: 1 packages removed (disk space saved: 0 B)
==> no candidate packages found for pruning

The command paccache returns the same thing but let me continue to use terminal.

[frdm@NORMANDY ~]$ paccache -d
==> no candidate packages found for pruning
[frdm@NORMANDY ~]$ 

Version : 0.9-1

excalibur1234 commented 8 years ago

i am not completely sure, whether i understood your problem, but it looks like some commands do not work on your system. can you please post the output of the following commands: yaourt -Qdt paccache -ruvk0 paccache -rvk2 df --output="source,target" | grep "/$" | cut -c 6-8 disk=$(df --output="source,target" | grep "/$" | cut -c 6-8 ) cat $(find /sys -name "rotational" 2>/dev/null | grep "$disk/queue") please tell me, whether you can keep using your terminal after every command.

another question: do you have manjaro installed on a HDD or SSD?

freed00m commented 8 years ago

Hi all four commands let me use the terminal and I am using single HDD drive,

to rephrase, if I chose option 2, it will never finish its job and I have to terminate pacli completely.

[frdm@NORMANDY ~]$ yaourt -Qdt
[frdm@NORMANDY ~]$ paccache -ruvk0
stat: cannot stat '/var/cache/pacman/pkg/*.pkg.tar?(.+([^.]))': No such file or directory
==> Privilege escalation required
rm: cannot remove '/var/cache/pacman/pkg/*.pkg.tar?(.+([^.]))': No such file or directory

==> finished: 1 packages removed (disk space saved: 0 B)
[frdm@NORMANDY ~]$ paccache -rvk2
==> no candidate packages found for pruning
[frdm@NORMANDY ~]$ df --output="source,target" | grep "/$" | cut -c 6-8
map
[frdm@NORMANDY ~]$ cat $(find /sys -name "rotational" 2>/dev/null | grep "$disk/queue")
1
1
1
1
1
[frdm@NORMANDY ~]$ 
excalibur1234 commented 8 years ago

ok, it looks like paccache -ruvk0 is causing some mess. maybe there is a strange package in your pacman cache. but this is not important at the moment, because it is not the cause of your problem.

the next strange thing is your output of df --output="source,target" | grep "/$" | cut -c 6-8. on my system, the output is "sda", because manjaro's root partition is on hard drive sda. your hard drive seems to be called "map". this is strange. but it looks like the last command runs successfully anyway. just to make sure, the result of the following command should be "1" on your system: cat $(find /sys -name "rotational" 2>/dev/null | grep "$(df --output="source,target" | grep "/$" | cut -c 6-8)/queue")

it looks like we are getting closer to the root of your problem. please post the result of these commands: [[ $(cat $(find /sys -name "rotational" 2>/dev/null | grep "$(df --output="source,target" | grep "/$" | cut -c 6-8)/queue")) == "1" ]] && sudo pacman-optimize sudo pacman-optimize are the results the same? (they should be)

if all of those 3 commands work as intended, then i know with 90% certainty where your problem is.

freed00m commented 8 years ago

Hi, I am kinda puzzled,

cat $(find /sys -name "rotational" 2>/dev/null | grep "$(df --output="source,target" | grep "/$" | cut -c 6-8)/queue") won't finnish cause

find /sys -name "rotational" 2 returns find: paths must precede expression: 2

If I run it withou the 2 I get

[frdm@NORMANDY ~]$ find /sys -name 'rotational'
/sys/devices/pci0000:00/0000:00:11.0/ata1/host0/target0:0:0/0:0:0:0/block/sda/queue/rotational
/sys/devices/pci0000:00/0000:00:11.0/ata2/host1/target1:0:0/1:0:0:0/block/sr0/queue/rotational
/sys/devices/virtual/block/dm-0/queue/rotational
/sys/devices/virtual/block/dm-1/queue/rotational
/sys/devices/virtual/block/dm-2/queue/rotational
find: ‘/sys/kernel/debug’: Permission denied

I will add df without the cutting part,

[frdm@NORMANDY ~]$ df --output="source,target" | grep "/$"
/dev/mapper/ManjaroVG-ManjaroRoot /

sudo pacman-ptimize is able to finnish but it doesn't solve the problem

excalibur1234 commented 8 years ago

your output of find /sys -name "rotational" 2 and find /sys -name "rotational" looks normal. the output of find /sys -name "rotational" 2>/dev/null should even look cleaner.

but i am puzzled by your output of df --output="source,target" | grep "/$". mine looks like this: ` ~ » df --output="source,target" | grep "/$"

/dev/sda3 / ~ » df --output="source,target" | grep "/$" | cut -c 6-8

sda `

the command df --output="source,target" | grep "/$" | cut -c 6-8 is supposed to read the label of the hard drive with your root partition. i see you only have 1 hard drive (HDD) in your system with the label "sda". therefore, "sda" should be the right output. leaving the "cut -c 6-8" part of the command away will not help you. do you use some strange device, partition, or hard drive setup, which produces device paths like "/dev/mapper/ManjaroVG-ManjaroRoot"?

one more thing: the whole code section ` disk=$(df --output="source,target" | grep "/$" | cut -c 6-8 )

[[ $(cat $(find /sys -name "rotational" 2>/dev/null | grep "$disk/queue")) == "1" ]] && sudo pacman-optimize

unset disk ` is meant to check, whether you have your root parition installed on a HDD or SSD, if you have a HDD the command "sudo pacman-optimize" will get executed.

freed00m commented 8 years ago

When I installed the manjaro i3 v8.11 i chose the Full drive encryption, that I think encrypts everything (LUSK I think) but /boot so there might be some mapper to mount and decrypt the /root /urs and others after I fill in the password that it ask me during boot.

I didn't chose my own partition setup and by default I think it created swapfile that is 105% of ram size.

Everything was done with the pre Calamares graphical installer.

What should I do ?

excalibur1234 commented 8 years ago

thanks for reporting the bug, it seems that disk encryption was not in the developers mind when he suggested this code. i will ask for alternative code on the forum and will implement the fixed code.

at the moment, we are waiting for papajoker. he wanted to implement a settings page and other fancy stuff. after that, i already have some improvements in mind.

until then, you can run the commands manually instead of using pacli for it: ` sudo pacman-mirrors -g && sudo pacman -Syy --color always

yaourt -Qdt

paccache -ruvk0

paccache -rvk2

sudo pacman-optimize ` this is all the "clean system" command does.

p.s.: these commands are also explained in detail in the "help" section of pacli. alternatively, you can enter "2h" and press enter.

excalibur1234 commented 8 years ago

ok, eugen-b found a possible solution. the following command should ouput your root partition with a name like "sda". can you test it and post your output? sudo cryptsetup status home

my hard drive is not encrypted. this means, i cannot test this.

freed00m commented 8 years ago

Hmm, this starts to look very strange

[frdm@NORMANDY ~]$ sudo cryptsetup status home
/dev/mapper/home is inactive.
[frdm@NORMANDY ~]$
freed00m commented 8 years ago
[frdm@NORMANDY ~]$ ls /dev/mapper/
control  cryptManjaro@  ManjaroVG-ManjaroRoot@  ManjaroVG-ManjaroSwap@
[frdm@NORMANDY ~]$ sudo cryptsetup status ManjaroVG-ManjaroRoot
[frdm@NORMANDY ~]$ sudo cryptsetup status ManjaroVG-ManjaroSwap
[frdm@NORMANDY ~]$ sudo cryptsetup status cryptManjaro
/dev/mapper/cryptManjaro is active and is in use.
  type:    LUKS1
  cipher:  aes-xts-plain64
  keysize: 512 bits
  device:  /dev/sda2
  offset:  4096 sectors
  size:    976244784 sectors
  mode:    read/write
[frdm@NORMANDY ~]$ 
excalibur1234 commented 8 years ago

does the following command outputs "sda" on your system? lsblk -o "name,mountpoint" -pa | grep "/$" -B1 | head -n 1 | cut -c12-14

if it does, we most likely found a solution.

freed00m commented 8 years ago

I am afraid no

[frdm@NORMANDY ~]$ lsblk -o "name,mountpoint" -pa | grep "/$" -B1 | head -n 1 | cut -c12-14
v/m
[frdm@NORMANDY ~]$ lsblk -o "name,mountpoint" -pa | grep "/$" -B1 | head -n 1 
  └─/dev/mapper/cryptManjaro            
[frdm@NORMANDY ~]$ lsblk -o "name,mountpoint" -pa | grep "/$" -B1 
  └─/dev/mapper/cryptManjaro            
    ├─/dev/mapper/ManjaroVG-ManjaroRoot /
[frdm@NORMANDY ~]$ lsblk -o "name,mountpoint" -pa 
NAME                                    MOUNTPOINT
/dev/sda                                
├─/dev/sda1                             /boot
└─/dev/sda2                             
  └─/dev/mapper/cryptManjaro            
    ├─/dev/mapper/ManjaroVG-ManjaroRoot /
    └─/dev/mapper/ManjaroVG-ManjaroSwap [SWAP]
/dev/sr0                                
[frdm@NORMANDY ~]$ 
freed00m commented 8 years ago

Thank you very much, it's working fixed by commit

17e060b7a1d9f31cd87fbab1fad7bdc2cac4eb53