Removing package group except some packages - archlinux

So, I was trying to remove GNOME by
sudo pacman -Rsn gnome
but I got the error
checking dependencies...
:: removing networkmanager breaks dependency 'networkmanager' required by network-manager-applet
In fact, I don't want to remove the package networkmanager, that is contained in the package group gnome. How can I remove the whole group gnome except networkmanager?

I found a solution here, even if I don't know if it's the best solution.
Basically you have to generate the list of the packages from the group package (e.g., gnome) by typing
sudo pacman -Qgq gnome > pkglist
After that you have to remove from the generated file pkglist all the package names that you don't want to remove. And now you have simply to remove the packages by giving in input to pacman the pkglist file, that is
sudo pacman -R - < pkglist

Related

Msys2 included packages

Is there a way to find out what default packages are installed along with Msys2 installation. I see that there is openssh, curl, git installed which I didn't. If there is a list that would also be useful. The official base package repository has a long list with thousands of entry.
After installing MSYS2, run pacman -Q to list the packages that are installed.

Installing cminpack package in Msys2

I have Portable Msys2.
I mean to install cminpack.
As I understand, https://aur.archlinux.org/packages/mingw-w64-cminpack/ means such package is available. I expected then that the package shows up in the list of available packages, but
$ pacman -Ss minpack
gave no results.
Did I infer correctly that the package should show up as available in this list?
I also tried
$ pacman -Qs minpack
which gave no results.
(As I understand, any package listed in pacman -Qs should also be listed in pacman -Ss, so it was useless at this point).
Having concluded that a package being listed in this search list possibly does not imply it is available for msys2, I checked
$ pacman -Ss <pkg>
for a few other packages in that list. Some effectively gave no results.
Thus the question
How can I be certain if a package is available for msys2?
(If and when I am sure about that, I guess pacman -S <pkg> would install it).
See also this.
I think you got mixed between msys2 pacman and arch linux pacman. What you have linked is an AUR repository for arch linux, not MSYS2. The utility used pacman is taken over from arch linux, but that is all.
To search package for a packages within your repositories you really can use pacman -Ss <package_name>. If you can't find your package that means that within the installed repositories there is no such package.
If you can't find it you can always check the web: search within msys2 packages. If that is not enough you can do that search within all generated package MSYS2 history: packages at msys2 repositories.
I have check the repositories for your mingw-w64-cminpack package and that is not available for msys2. You would have to cross-compile it yourself.

How do I get the man command?

I just installed Windows Subsystem for Linux for the first time and downloaded the Debian distribution from the Windows Store.
The first thing I tried to do was use the "mv" command. The second thing was to run "man mv" because I don't remember how to use it. But I received the error:
-bash: man: command not found
It looks like the package I want is called manpages. But I can't install that:
sudo apt-get install manpages
[sudo] password for pi:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package manpages is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package 'manpages' has no installation candidate
How do I get the man command up and running?
apt update to update the local package lists followed by apt install man-db to install the actual package.
I want to add to elken's answer that apparently, the 'man-db' packages doesn't cover all the manpages. For example, I needed documentation for the C stdio library (fopen, fgets, ...), and for that I had to install 'manpages-dev':
sudo apt install manpages-dev
Apparently there are also some other manpage collections (/different names for them on certain unix distros), see https://superuser.com/questions/40609/how-to-install-man-pages-for-c-standard-library-functions-in-ubuntu

apt-get conflict in Ubuntu

I have tried to install mod_security, but it has the error, so I tried aptitude:
apt-get install libapache-mod-security
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libapache-mod-security : Depends: libapache2-modsecurity but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root#srv16540:~# aptitude install libapache2-modsecurity
The following NEW packages will be installed:
apache2.2-common{ab} libapache2-modsecurity modsecurity-crs{a}
0 packages upgraded, 3 newly installed, 0 to remove and 10 not upgraded.
Need to get 660 kB of archives. After unpacking 2,861 kB will be used.
The following packages have unmet dependencies:
apache2 : Conflicts: apache2.2-common but 2.2.22-1ubuntu1.4 is to be installed.
apache2.2-common : Depends: apache2.2-bin (= 2.2.22-1ubuntu1.4) but 2.4.6-2~precise+1 is installed.
apache2-bin : Conflicts: apache2.2-common but 2.2.22-1ubuntu1.4 is to be installed.
apache2-data : Conflicts: apache2.2-common but 2.2.22-1ubuntu1.4 is to be installed.
The following actions will resolve these dependencies:
**Keep the following packages at their current version:**
1) apache2.2-common [Not Installed]
2) libapache2-modsecurity [Not Installed]
3) modsecurity-crs [Not Installed]
Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.
I do now know what Keep the following packages at their current version means.
I want to know what does happen if I press yes. Does it replace my current apache2? Do I need to back up before doing this?
ANSWERS
I do now know what Keep the following packages at their current version mean
aptitude is trying to resolve the dependencies and possible conflicts to satisfy your installation request. It then proposes a solution. In your particular case the first solution it finds is to keep everything as it actually is, that's what keep at their current version + [Not installed] means.
I want to know what does happen if I press yes , does it replace my current apache2 ?
No, that solution will basically do nothing.
Do I need back up before ?
As boring as it sounds, backups are a good strategy to save time in the long run. If you're messing with important data then it should be even more important for you.
CONTEXT
I've seen other scenarios make aptitute propose solutions with combinations like these:
Remove the following packages
Keep the following packages at their current version
Leave the following dependencies unresolved
The following packages have been kept back
The following packages will be upgraded
The following packages were automatically installed and are no longer required
The following extra packages will be installed
Suggested packages
The following packages will be REMOVED
(and probably others)
In your case if instead of accepting the solution (or quitting), you reject it by pressing n, then aptitude will try to figure out another scenario that could be useful and propose it to you again. You can iterate through the solutions doing that and if any of them satisfies you then you can accept it.
SOLUTION (?)
As far as I can see by your output:
apache2.2-common : Depends: apache2.2-bin (= 2.2.22-1ubuntu1.4) but 2.4.6-2~precise+1 is installed.
Your problem is that you have apache2-2.4.6-2~precise+1 installed which isn't available from standard Ubuntu precise repositories (most probably installed from this PPA), and you're requesting a package which conflicts with that other one.
I'd take a look at the answers on how to remove PPAs and after you have removed that source I'd reinstall apache 2.2 from the standard repos with this command:
sudo aptitude install apache2
That's exactly what it did for me:
$ sudo apt-get remove apache2-bin
$ sudo apt-get autoremove
$ sudo apt-get install apache2
Open synaptic manager and search for apache2.2-bin. Mark it for removal. Then
sudo apt-get install apache2
Just remove all the content of /var/lib/apt/lists directory:
sudo rm -rf /var/lib/apt/lists/*
then run:
sudo apt-get update

how to map pkg-config names to yum/apt-get

Lots of makefiles use pkg-config but the names don't relate to package managers (e.g. yum / apt). How to map pkg-config names to them? is there a trick?
Example: if I do yum searchName -- look through the name and approximate to pkg-config's name
Result:
$ pkg-config --libs dbus-glib-0
Package dbus-glib-0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-glib-0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dbus-glib-0' found
$ sudo yum install dbus-glib
Loaded plugins: langpacks, refresh-packagekit
Package dbus-glib-0.100-5.fc19.i686 already installed and latest version
Nothing to do
$ sudo yum install dbus-glib-0
Loaded plugins: langpacks, refresh-packagekit
No package dbus-glib-0 available.
Error: Nothing to do
In the case of apt-get, if you have some software that complains about this missing package via pkg-config, for instance:
configure: error: Package requirements (gtk+-2.0 >= 2.8) were not met:
No package 'gtk+-2.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables GTK_CFLAGS
and GTK_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Error: Could not run ./configure, which is required to configure banshee
Then it means that the configure script is looking for the gtk+-2.0 pkgconfig package.
Then, what you can do is this:
$ sudo apt-get install apt-file
...
$ apt-file update
...
$ apt-file search gtk+-2.0 | grep "\.pc"
libgtk2.0-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-2.0.pc
Which means you can install package libgtk2.0-dev:
sudo apt-get install libgtk2.0-dev
And the dependency would be satisfied.
In the particular case of the original question:
$ apt-file search --package-only dbus-glib-1.pc
libdbus-glib-1-dev
(dbus-glib-0 seems to be too old to show up in my system.)
The pkg-config files are usually provided by the -devel package so in most cases foo.pc is provided by libfoo-devel. That's still guesswork, but there are two shortcuts:
Installing by path name, if you know where the .pc file will end up
$> yum install /usr/lib64/pkgconfig/foo.pc
That works for any file, but you still need to guess where the .pc file is. The best approach is using the actual pkgconfig requirement:
$> yum install "pkgconfig(foo)"
Use the quotes to avoid the shell trying to interpret the parenthesis.