As far as I know I can uninstall a program from Ubuntu using this command...
$ sudo dpkg -r packagename
But this does not remove the dependencies while the packagename
installed. To remove all files including dependencies we need to apply this command...
$ sudo apt-get --purge autoremove packagename
But my question is removing the package and all its dependencies is really a good practice? Will --purge autoremove
command make my system as it before installing the packagename
package? Or occasionally I might end up with some broken files and my system might crash while trying to remove everything? Actually I am afraid to implement the --purge autoremove
command and want to know expert opinion before practising this!
autoremove
doesn't require a package name after it. – saiarcot895 May 10 '15 at 19:46deborphan
, it will search out (and list, only) unnecessary packages more thoroughly thanapt-get autoremove
. Though if you have non-Ubuntu software (like, built from sources) where you manually installed dependecies, be careful withdeborphan
results, it may list something you want to keep. – hyde May 11 '15 at 5:15apt-get
whenever possible rather than using bothapt-get
anddpkg
(the exception being if you're installing a deb file, in which case you'll need to usedpkg
). To remove a package usingapt-get
, it's justsudo apt-get remove packagename
. I just did a test, and you can indeed usesudo apt-get --purge autoremove packagename
to remove the package and any unused packages you have (after removing the package). – saiarcot895 May 11 '15 at 12:11