- Is
sudo pacman -Syyu
equivalent tosudo apt-get update && sudo apt-get upgrade
in Debian? - Is there something that I can add to it to get past all the prompts for yes, such as the
-y
in Debian? - What about
sudo apt-get clean && sudo apt-get autoclean && sudo apt-get autoremove
which cleans packages and obsolete and orphaned packages?
Pacman is used without âsudoâ and when it needs it will ask for your password
Please be carefull when updating. Manjaro needs an owner who cares for it (and reads logs )
man pacman
Um, not for installing or uninstalling packages it isnât. Or are you thinking about pamac
? pamac
will indeed prompt you for a password when needed and should not be used with sudo
.
I think that the only commands I need are:
sudo pacman -Sc
Clean up all local caches.
sudo pacman -Qdtq | pacman -Rs -
Remove dependencies that are no longer needed (orphans)
Do you think there anymore that an average user like me would use?
I was not replying to you but to @andreas85.
OrâŚ
sudo paccache -rvk0
⌠which does the same thing.
Always be careful with that. Sometimes packages are marked as orphans when they were explicitly installed.
man pacman
man pamac
man paccache
man mhwd
man apropos
...
Here I would simply suggest RTFM.
one of my favourite âRTFMâ aids is tldr++
pamac install tldr++
Then do tldr pacman
Youâll get an interactive playground to play with it.
Also Iâd suggest you have a go with fish terminal.
Start by installing fish, then type âfishâ to start it up (no need to change the shell).
Then try pacman -
and hit tab to get this:
It means you can add flags one by one and see whatâs next - build your sentence.
For example, do man pacman | rg -Sy
(rg is ripgrep).
Also donât forget pacman --help
.
For installing, we should really use pamac⌠alias install=pamac install
For upgrading we can do alias upgrade=pamac upgrade --enable-downgrade --aur --devel
But if we change mirrors, we might need to do some more advanced operations - and allow downgrading of packages. Cross that bridge when you come to it
I do agree with your unspoken criticism that man pages are a bit of a pain.
For this reason I would suggest you try this:
man pacman > pacman.md
(or .txt if you like) which will put a text file in your home directory.
Now open that pacman.md
so you can have a personal copy, edit and highlight as you find useful.
It would open nicely in a Markdown editor/note application. I like Joplin, but right now Iâm using Obsidian.
Obsidian would be an excellent way to extract parts of the âmanâ page into personal âtips and tricksâ notes - which are all saved as separate .md files in the selected ânotesâ directory.
What if I get:
error: failed to init transaction (unable to lock database)
error: could not lock database: File exists
if you're sure a package manager is not already
running, you can remove /var/lib/pacman/db.lck
I get this with such command as pacman -Sc
and sudo pacman -Qdtq | pacman -Rs -
you can remove /var/lib/pacman/db.lck
Thank you, but I tried remove /var/lib/pacman/db.lck
and got bash: remove: command not found
.
The command is rm not remove
rm /var/lib/pacman/db.lck
gave me rm: remove write-protected regular empty file '/var/lib/pacman/db.lck'?
My badâŚ
Do you remember that if something is protected, or you donât have permission, then you give it administrative permission (which can destroy your system if you like).
Also remember - donât copy and paste from internet unless you understand it. I usually include deliberate edits or errors in commands in forums now⌠but that time I just repeated the line which I think makes the answer too obvious.
Let me create a new file, and show you the âwrongâ wayâŚ
sudo touch /var/lib/pacman/db.lck
will create an empty file to play with.
To save time I also did abbr rm 'rm -v -d -I
in my FISH terminal, separate -I to easily remove itâŚ
If you use bash or zsh then you add 'alias rm=ârm -v -d -Iâ to your bashrc or zshrc.
Now in terminalâŚ
rm /var/lib/pacman/db.lck
Ok, itâs interactive - type âYâ to acceptâŚ
Woah, these beans arenât cooked What now?
Get the last command back (I press UP arrow)
Move the cursor goes to the start of the line (I press HOME key)
you type 'sudo â or 'doas â
You enter your password.
Then you fall off your chair screaming with happiness.
I strongly suggest you install and try out Fish terminal BTW.
Then commands like ârmâ once you figure out you want to use it with rm -v -d -I
can be set with abbr rm 'rm -v -d -I '
and will expand if you hit space after typing ârmâ.
Also learn to use stuff like man rm
and tldr rm
For âtldrâ you can install âtealdeerâ or something cool and interactive like tldr++ - itâs in alpha, but itâs fun and itâs small - and not difficult to simply install tldr and that will remove tldr++.
Use pamac - copy and do one line at a time.
pamac install fish
fish
pamac install tldr++
tldr pamac
pamac install tldr
tldr pamac
Woah, now thatâs FUN.
Fish also uses colour out of the box⌠so if I remember wrongly (I have no âaliasâ or âabbrâ for the word âremoveâ - but I do have an alias for âpurgeâ) then commands typed appear RED until they will workâŚ
Correctly typed they appear in blueâŚ
And also, the reason I like to be able to use fish (not as default, but just by typing âfishâ to load it) is that it will give information.
So we type 'pamac
whatâs next??? Now hit :
You get a list underneath of options. Also pressing arrow up/down will scroll your history with suggestions containing âpamacâ.
How did we delete that pacman thing?
type âpacmanâ and then press the âUPâ arrow:
But anyway - thanks for the entertainment. I hope it gets easier for you soon.
Now if you didnât already install Obsidian, youâd better get on with that now.
pamac install obsidian
Then launch itâŚ
Then add useful snips of what you needâŚ
In Firefox, visit MarkDownload - Markdown Web Clipper â Get this Extension for đŚ Firefox (en-US)
Load THIS page and click the âM+â extension icon.
You can now download this page as a Markdown file, which will appear in Obisidan if you set the right directory, and also can be opened with MarkText which is a rather lovely Markdown editor.
From pacman - ArchWiki (archlinux.org)
Warning: One should avoid deleting from the cache all past versions of installed packages and all uninstalled packages unless one desperately needs to free some disk space. This will prevent downgrading or reinstalling packages without downloading them again.
Okay, so cleaning the cache is potentially dangerous in Manjaro. Iâm wondering if I should switch topaccache -rk1
. Whatâs your opinion?
Well itâs only worth doing when you really need spaceâŚ
I had no problems yet⌠but that looks ok.
Hereâs my cleaner I generally donât use it often though.
alias clean='pamac clean --build-files && paccache -rvuk1 && sudo journalctl --vacuum-time=12h --rotate'
No, Itâs not!
All it is is that you lose the ability to go back to a prior version of a package
without re-downloading it again
which can be difficult, because only the current packages are easily available
you (obviously) do not have the previous, older, packages anymore - so you cannot easily go back by just installing the older version in the case you might want or need to do so.
Itâs not dangerous.
Just keep 2 or even 3 previous versions if you are not tight on storage space.
although I never needed a package 2 levels older than what is current
Youâd do well to read the man page for pamac
:
man pamac
Get the last command back (I press UP arrow)
Move the cursor goes to the start of the line (I press HOME key)
you type 'sudo â or 'doas â
Just type Alt + s
in fish or sudo !!
in other shells
Anything is dangerous, potentially.
But regarding the cache, I think a safer way to clean the cache is:
pamac clean
Because, according to the main page:
pamac clean [options]
Clean packages cache or build files