Post History
I executed emerge --deselect xournalpp , which means "I don't need the xournalpp package anymore", so it can be removed by a future --depclean action in case Portage figures xournalpp is not a ...
#1: Initial revision
I deselected a package and changed my mind. How to select it without re-emerging?
I executed
emerge --deselect xournalpp
, which means "I don't need the `xournalpp` package anymore", so it can be removed by a future `--depclean` action in case Portage figures `xournalpp` is not a dependency of any other installed package.
Hence the aforementioned command **does not** uninstall Xournalpp. It only removes it from the [world file][1].
Now, suppose I realize that was a mistake<sup>*</sup> and want to keep Xournalpp. It seems only natural to use `--select`:
--select [ y | n ], -w
Add specified packages to the world set (inverse of --oneshot).
However, Portage wants to re-emerge the package!
# emerge --ask --select xournalpp
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] app-text/xournalpp-1.0.20
Would you like to merge these packages? [Yes/No]
Although answering Yes would solve the problem, it entails essentially reinstalling the package (extracting the compressed file, re-compiling the package, ...), which is a waste of time — that may take from seconds to hours — and CPU cycles.
How do I add `xournalpp` back to the world file without emerging the already installed package?
<sup>*Actually my motivation to run that command was to find out the installed dependencies of Xournalpp that were not dependencies to any other package. I realize now there are better ways to do that, but the question stands.</sup>
[1]: https://wiki.gentoo.org/wiki/Selected-packages_set_(Portage)
