Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Explicitly installed state #197

Closed
cromerc opened this issue Jan 12, 2017 · 12 comments
Closed

[Feature] Explicitly installed state #197

cromerc opened this issue Jan 12, 2017 · 12 comments

Comments

@cromerc
Copy link
Contributor

cromerc commented Jan 12, 2017

pacman has the ability to show us explicitly installed packages with:
pacman -Qet
It would be nice to have this as a state in pamac, I was trying to remove some packages that were preinstalled in manjaro and noticed that I couldn't see which packages where explicitly installed by manjaro.

@guinux
Copy link
Collaborator

guinux commented Feb 17, 2017

In pamac, double click on a package name to view details.
In details you can see if the package is explicitly installed.

@cromerc
Copy link
Contributor Author

cromerc commented Feb 18, 2017

True, but with over 1000 packages installed I don't want to have to open each one to see if it's explicitly installed or not. A list of packages in that state is much more convenient.

@guinux
Copy link
Collaborator

guinux commented Feb 18, 2017

Pamac can't implement all complex feature, for advanced package operation, pacman is recommended.
What would you do with this list of packages in pamac?

@lots0logs
Copy link
Contributor

I have to admit that I personally dont see the value in this. However, as far as implementation goes, I think it could be done using the state icon in the package listings. The empty green box could mean "installed as a dependency" and a green box with a white checkmark inside could mean "explicitly installed".

@cromerc
Copy link
Contributor Author

cromerc commented Feb 19, 2017

It is actually very useful to help with optdepends that are no longer needed. For example, I install a package. Then I install some of it's optdepends to add more functionality. When I do this, those optdepends are installed explicitly. Later I remove the main package and the orphans. However since the optdepends are installed explicitly they will not be removed since they are not considered orphans.

By reading the explicitly installed packages I can see what I have installed personally and remove things that are not needed any longer.

@lots0logs
Copy link
Contributor

In that case, what I proposed would not handle your use case. Actually, its not really possible with ALPM currently. Once you install a package manually, it's considered explicitly installed. It doesn't matter if you installed it because it was an optdepend of another package or not. There is no way to differentiate such cases in ALPM currently.

@cromerc
Copy link
Contributor Author

cromerc commented Feb 19, 2017

Actually it is part of alpm. The function is calld alpm_pkg_get_reason and the reason code is ALPM_PKG_REASON_EXPLICIT.

All that needs to be done is get a list of all installed packages then use that alpm library call to only show the packages that are explicitly imstalled. Libalpm already supplies what is needed.

@lots0logs
Copy link
Contributor

lots0logs commented Feb 19, 2017

I think you misunderstood my point. Yes, it's absolutely possible to get a list of explicitly installed packages. However, my point was that the list of packages would include all packages that were explicitly installed regardless of why you might have installed them. There is no way to know whether or not a package was installed because it was an optdepend of some other package. That's not going to change until ALPM offers a more robust system for optdepends.

@guinux
Copy link
Collaborator

guinux commented Feb 19, 2017

Even if it will not perfect, I think I can add an explicitly installed list in states tab. I would be easy to do and can help someones.

@lots0logs
Copy link
Contributor

@guinux I agree. I kind of really like the idea I posted in #197 (comment) too.

@cromerc
Copy link
Contributor Author

cromerc commented Feb 19, 2017

@lots0logs

Looks like I did misunderstand your point. However, that list of explicity installed packages helps a lot even though it does not show which explicit packages are optdepends. For example I installed the steam package. Later I install lib32-libpulse for 32 bit audio. After a couple of moths I removed steam.

While reading the list of explicity installed packages I saw "lib32-libpulse". Usully explicitly installed packages are things like "pacman", "geany", "cinnamon". When I see something like "lin32-libpulse", or other libraries in the explicitly installed package, it's obvious that I had installed it manually as an optdepends for something. I doubt any normal person who is not a programmer installs libs explicitly.

And in the case of manjaro, I installed the cinnamon iso. However the "explicit" packages are installed by the iso. I wanted to clean up my system and remove stuff I don't want or need. However when I try to uninstall a package I get "package x depends on package y", then I try to remove package y, but then I get "package y depends on package z". I have to follow a chain of packages to uninstall stuff which is a real pain.
With a list of explicitly installed packages, those packages are almost aleays the root. If I remove the root, then all the packages which are dependencies of that root will also be removed after I clean up orphans. Very useful on a fresh install of manjaro to remove what is not needed by the user.

@lots0logs
Copy link
Contributor

@cromerc In cases like that you should use pacman as it includes a command option to recursively remove a package and its dependencies (so long as no other packages depend on them).

sudo pacman -Rcc <package>

@guinux guinux closed this as completed in e9b8a03 Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants