I want to install ubuntu-minimal. I can't see coreutils as a dependency, although there are still plenty of other packages that ubuntu-minimal depends on. Will I have to install it seperately or is it a dependency of one of these other packages in ubuntu-minimal? If so, which one?
Ubuntu – Where is coreutils in ubuntu-minimal
package-management
Related Solutions
aptitude
can get you most of the way with its search feature. Here's how you find everything installed that wasn't only an automatic dependency:
aptitude search -F "%p" "?installed ?not(?automatic)"
This wont be optimal some of these may be able to be removed but I don't know a simple way to work that out. Perhaps the answer lies in man aptitude
.
On second thought, with that list you could loop through it and find the dependant packages (not dependencies) for each one. If one of those is in the master list, remove the current package from the list... but only after you've parsed the whole list or you'll miss intermediates in a 3+ level dep tree.
You find dependants with a query like this:
aptitude search '~i~Dpackage'
I'd try and write the script but I'm typing this on a tiny phone keyboard. Even I have limits.
Edit: After five minute of trying to sleep, I started hacking away on this. something like this should do the job:
orig=$(aptitude search -F "%p" "?installed ?not(?automatic)")
newlist="";
for p in $orig; do
depended=0;
for dependant in `aptitude search -F "%p" "~i~D$p"`; do
if [[ $orig == "* $dependant *" ]]; then
depended=1;
fi;
done;
if [[ $depended == 0 ]]; then
newlist="$newlist $p";
fi;
done;
echo $newlist
Note this takes a really long time to run and it might be over-keen (eg it will remove thing that you manually installed, that you want to be manually installed, if they are depended on by something else in the $orig list that you perhaps installed afterwards).
EDIT: Ok, as noted below, the "rejecting the removal..." thing in aptitude
does not work - this is what did manage to work for me, though...
While looking for, say, Package: ipe
, one may hit files such as:
$ grep -r 'Package: ipe' /var/lib/apt/lists/
...
/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_universe_binary-i386_Packages:Package: ipe
...
/var/lib/apt/lists/old-releases.ubuntu.com_ubuntu_dists_natty_universe_binary-i386_Packages:Package: ipe
...
... however, these are not right - apparently, the runtime information for apt-get
etc. is stored in /var/lib/dpkg/status
( via How do I fix a "Problem with MergeList" or "status file could not be parsed" error when trying to do an update? ).
So, I opened that file via sudo nano /var/lib/dpkg/status
, and looked up "Package: ipe", and then tried to comment the texlive-latex-base
portion of "Depends:" - first by putting it in a separate line, at commenting it with a number sign/hash #
. Note that this does not work - first you'll get errors like:
dpkg: error: parsing file '/var/lib/dpkg/status' near line 8140 package 'ipe':
field name `#,' must be followed by colon
E: Sub-process /usr/bin/dpkg returned an error code (2)
... then if you try to add that colon, as in #:
, you'll get:
dpkg: error: parsing file '/var/lib/dpkg/status' near line 8141 package 'ipe':
user-defined field name `#' too short
E: Sub-process /usr/bin/dpkg returned an error code (2)
Apparently, these files do not use comments; and they seem to be documented in Debian Policy Manual - Control files and their fields. Then I found:
The right way to include a field in the .deb is to use fields named "XB-*".
... so, basically, instead of using a comment character to "comment out" - I just used an user-defined field, instead, which I arbitrarily called XB-Ignore:
; so that portion of /var/lib/dpkg/status
ended up looking like this:
Package: ipe
...
Depends: libc6 (>= 2.4), libcairo2 (>= 1.2.4), libgcc1 (>= 1:4.1.1), libipe7.0.10, liblua5.1-0, libqtcore4 (>= 4:4.6.$
XB-Ignore: , texlive-latex-base, gsfonts
...
With this change saved, I could perform the install using apt-get
directly, without a problem:
$ sudo apt-get install dropbox
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
python-gpgme
The following NEW packages will be installed:
dropbox
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0 B/93,0 kB of archives.
After this operation, 410 kB of additional disk space will be used.
Selecting previously deselected package dropbox.
...
Setting up dropbox (1.6.1) ...
Processing triggers for menu ...
I'll just note that /var/lib/dpkg/status
is not a persistant file - in fact, right after the apt-get install
, if you check the file again, Depends:
and XB-Ignore:
will no longer be on neighboring lines (as they were originally, as shown on the snippet above)!
While the question on ignoring the unmet dependency is still open noted above - it turns out I did misinterpret what these "new solutions" are: it is the choices you're offered by aptitude
if you answer "no" to the "Accept this solution?" question:
...
The following packages have unmet dependencies:
ipe: Depends: texlive-latex-base but it is not going to be installed.
The following actions will resolve these dependencies:
Remove the following packages:
1) ipe
Accept this solution? [Y/n/q/?] r 1
Rejecting the removal of ipe
The following actions will resolve these dependencies:
Remove the following packages:
1) R ipe
Accept this solution? [Y/n/q/?] n # <==== here not accepting above solution
The following actions will resolve these dependencies: # <==== new solution offered here:
Install the following packages:
1) lmodern [2.004.1-3 (natty)]
2) luatex [0.65.0-1ubuntu3 (natty)]
3) tex-common [2.09 (natty)]
4) texlive-base [2009-11 (natty)]
5) texlive-binaries [2009-8ubuntu2 (natty)]
6) texlive-common [2009-11 (natty)]
7) texlive-doc-base [2009-2 (natty)]
8) texlive-latex-base [2009-11 (natty)]
9) texlive-latex-base-doc [2009-11 (natty)]
10) texlive-luatex [2009-11 (natty)]
Accept this solution? [Y/n/q/?] r 1
Rejecting the installation of lmodern version 2.004.1-3 (natty)
The following actions will resolve these dependencies:
Install the following packages:
1) R lmodern [2.004.1-3 (natty)]
2) luatex [0.65.0-1ubuntu3 (natty)]
...
Accept this solution? [Y/n/q/?] r 10
Rejecting the installation of texlive-luatex version 2009-11 (natty)
The following actions will resolve these dependencies:
Install the following packages:
1) R lmodern [2.004.1-3 (natty)]
2) R luatex [0.65.0-1ubuntu3 (natty)]
3) R tex-common [2.09 (natty)]
4) R texlive-base [2009-11 (natty)]
5) R texlive-binaries [2009-8ubuntu2 (natty)]
6) R texlive-common [2009-11 (natty)]
7) R texlive-doc-base [2009-2 (natty)]
8) R texlive-latex-base [2009-11 (natty)]
9) R texlive-latex-base-doc [2009-11 (natty)]
10) R texlive-luatex [2009-11 (natty)]
Accept this solution? [Y/n/q/?] n
*** No more solutions available ***
The following actions will resolve these dependencies:
Install the following packages:
1) R lmodern [2.004.1-3 (natty)]
2) R luatex [0.65.0-1ubuntu3 (natty)]
3) R tex-common [2.09 (natty)]
4) R texlive-base [2009-11 (natty)]
5) R texlive-binaries [2009-8ubuntu2 (natty)]
6) R texlive-common [2009-11 (natty)]
7) R texlive-doc-base [2009-2 (natty)]
8) R texlive-latex-base [2009-11 (natty)]
9) R texlive-latex-base-doc [2009-11 (natty)]
10) R texlive-luatex [2009-11 (natty)]
Accept this solution? [Y/n/q/?] y
The following NEW packages will be installed:
dropbox lmodern{a} luatex{a} tex-common{a} texlive-base{a} texlive-binaries{a} texlive-common{a}
texlive-doc-base{a} texlive-latex-base{a} texlive-latex-base-doc{a} texlive-luatex{a}
The following partially installed packages will be configured:
ipe
0 packages upgraded, 11 newly installed, 0 to remove and 1 not upgraded.
Need to get 87,4 MB of archives. After unpacking 181 MB will be used.
Do you want to continue? [Y/n/?] n
Abort.
So yeah - if I keep on rejecting all solutions, at the end I'll get "*** No more solutions available ***", and aptitude
can either go with those solutions, or abort - but unfortunately cannot ignore them with this technique...
Related Question
- Ubuntu – Find minimal equivalent of packages currently installed
- Ubuntu – Ignoring specific unmet dependencies with aptitude
- Ubuntu – How to find top-level dependencies in a list of deb packages
- Ubuntu – find statistics on package downloads and dependencies
- Ubuntu – How to upgrade coreutils from 8.21 to 8.24 in Linux Ubuntu 14.04
- Ubuntu – libsensors5 or libsensors-config upgrade problem
Best Answer
The
coreutils
is markedEssential: yes
, so it's always included in an installation, anddpkg
will warn you in a rather non-ignorable way if you try to remove it. Packages do not have to declare dependencies on essential packages, unless they need a particular version (for example,dpkg
(another essential package) depends oncoreutils (>= 5.93-1)
in Ubuntu 10.04).