Originally Posted by
charleswb
how can I know if removing a dependency will cause unwanted removal or disabling of another program I want?
The system will tell you, and give you a chance to stop.
For example, let's try removing a fairly important package.
Code:
$ sudo apt-get remove python2.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libqt4-opengl
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
idle-python2.6 libpython2.6 python2.6 virtualbox-4.1
0 upgraded, 0 newly installed, 4 to remove and 22 not upgraded.
After this operation, 140 MB disk space will be freed.
Do you want to continue [Y/n]? n
Everything in green will be immediately removed. In this case, I want to keep virtualbox, so I better not do this.
Everything in blue will be orphaned, but not removed at this time.
Originally Posted by
charleswb
I want to clean out all unnecessary files/programs/dependencies, but am concerned that I might accidentally uninstall some files/programs/dependencies that are necessary to other programs I want to keep.
Use 'sudo apt-get purge' to get rid of packages, including the config files in /etc. The config files in your /home WON'T be removed automatically by any automated tool (there are very good reasons for this).
Use 'sudo apt-get autoremove' to get rid of those orphans (like the orphan in the example above).
Use 'apt-cache depends packagename' and 'apt-cache rdepends packagename' (no sudo needed) to see the first-level of dependencies of any package. For example,
Code:
$ apt-cache depends hello
hello
Depends: libc6
|Depends: dpkg
Depends: install-info
$ apt-cache rdepends hello
hello
Reverse Depends:
junior-system
hello-debhelper
hello-debhelper
hello-debhelper
hello-debhelper
So if you try to purge dpkg, it will take hello with it, and that will take hello-debhelper with them.
Package management is pretty easy. If you're keeping up with the orphans, then there is probably little cruft in your system - just about everything is there for a reason. And if you don't know why something is there, apt-cache it to figure it out.
Bookmarks