Remove the -dry-run to perform the actual purge operation instead of reporting what actions it would have taken.I Really need some help. With that said, here are two one-liners which can be used for each purge methods: dpkg -list |grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg -dry-run -purgeĪpt-get autoremove -y apt-get -dry-run purge -y $(dpkg -list |grep '^rc' |awk '') Package so that's what I did! Poor planning on your part does not With dpkg: What dependency? You just told me to purge the damn Packages, then only package A will be purged. With apt: If I wanted to purge package A, and it has a dependencyĬalled package B, and package B had no other dependent packages, then You can read about it in section 8.6 on this page The Debian GNU/Linux FAQ - The Debian package management tools The dpkg utility does not know about or track packages dependencies in relation to one another, which was a big reason that apt was developed I believe. I just wanted to clarify one thing that seems to be a source of confusion on here. If you don't know to which package a file belongs, try this: dpkg -S /path/to/file Do not remove files belonging to packages without using the package manager! It will get confused and is the wrong way to do things. dangerous.Īre completely outside the scope of the package management. Sudo rm -rf (file/folder name) # <- removes files/dirs recursively. Sudo locate application # <- locates the file 'application'. These commands, sudo updatedb # <- updates the locate database (index). (note the quotes and the dot) which will remove all packages whose name starts with application. Probably, the command that was meant is really sudo apt-get remove "^application.*" To see how this can be dangerous, try (without root for double safety) apt-get -s remove "wine*" ( -s will simulate the thing instead of doing it) - it will say is going to remove all packages that has "win" in their name and the dependant, almost the entire system. If (as is normally the case) it finds nothing, it returns the glob pattern unaltered (supposing bash with default behavior here - zsh will error out).Īpt-get will remove the packages whose name contains a string that satisfies the regular expression application*, that is, applicatio followed by an arbitrary number of n: applicatio, application, applicationn, libapplicatio, etc. The shell tries to expand application* looking at the files in the current directory. So what happens with sudo apt-get remove application* The asterisk version in the question is probably wrong apt-get accepts a regular expression and not a glob pattern as the shell. Make sure you understand the meanings and try out what it wants to do before accepting the action (you need to press Y before it actually performs the actions as proposed). There's no single 'correct way' of removing applications or performing other tasks interacting with your package management. Lower-level dpkg-commands can be used (advanced), or GUI tools like Muon, Synaptic, Software Center, etc. Note that aptitude only remembers dependency information for packages that it has installed.Īnd many more exist. Will also attempt to remove other packages which were required by packagename on but are not required by any remaining packages. Use this after removing a package which had installed dependencies you're no longer interested in.Īptitude remove packagename or aptitude purge packagename (likewise) installed packages that used to be installed as an dependency, but aren't any longer. There is no easy way to get those removed as well. However, it does not remove configuration or data files residing in users home directories, usually in hidden folders there. Particularly useful when you want to 'start all over' with an application because you messed up the configuration. Will remove about everything regarding the package packagename, but not the dependencies installed with it on installation. It will also leave dependencies installed with it on installation time untouched.Īpt-get purge packagename or apt-get remove -purge packagename Will remove the binaries, but not the configuration or data files of the package packagename.
0 Comments
Leave a Reply. |