What is the correct way to completely remove an application?
2015-08-21 11:36
477 查看
What is the correct way to completely remove an application?
apt-get remove packagename 删除二进制可执行文件
will remove the binaries, but not the configuration or data files of the package
packagename. It will also leave dependencies installed with it on installation time untouched.
apt-get purge packagenameor
apt-get remove --purge packagename 删除所有与包相关的文件。
will remove about everything regarding the package
packagename, but not the dependencies installed with it on installation. Both commands are equivalent.
Particularly useful when you want to 'start all over' with an application because you messed up the configuration. However, it does not remove configuration or data files residing in users home directories, usually in hidden folders there. There is no easy
way to get those removed as well.
apt-get autoremove 删除所有不再被依赖的包。
removes orphaned packages, i.e. installed packages that used to be installed as an dependency, but aren't any longer. Use this after removing a package which had installed dependencies you're no longer interested in.
aptitude remove packagenameor
aptitude purge packagename(likewise)
一次性同时删除本package及相关的功能依赖包
will also attempt to remove then not used dependencies anymore in one step.
And many more exist. Lower-level
dpkg-commands can be used (advanced), or GUI tools like Muon, Synaptic, Software Center, etc.
There's no single 'correct way' of removing applications or performing other tasks interacting with your package management.
The list you found are just examples. Make sure you understand the meanings and try out what it wants to do before accepting the action (you need to press
Ybefore it actually performs the actions as proposed).
The asterisk version in the question is probably wrong;
apt-getaccepts a regular expression and not a glob pattern as the shell. So what happens with
sudo apt-get remove application*
is the following:
The shell try to expand
application*looking at the files in the current directory. If (as normally is the case) find nothing, it returns the glob patter unaltered (supposing
bashwith default behavior here ---
zshwill error out).
apt-getwill remove the packages whose name contains a string that satisfy the regular expression
application*, that is,
applicatiofollowed by an arbitrary number of
n:
applicatio,
application,
applicationn,
libapplicatio, etc.
to see how this can be dangerous, try (without root for double safety)
apt-get -s remove "wine*"(
-swill 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 all system...
Probably, the command that was meant is really
sudo apt-get remove "^application.*"
(note the quotes and the dot) which will remove all packages whose name starts with
application.
Do not remove files belonging to packages without using the package management! It will get confused and is the
wrong way to do things.
If you don't know to which package a file belongs, try this:
dpkg -S /path/to/file
相关文章推荐
- JNI学习2——jni入门篇
- 移动端技术简单分析
- 移动端技术简单分析
- androoid makefile 学习
- iOS开发 - NSScanner的用法
- 欢迎使用CSDN-markdown编辑器
- 【iOS奇葩特性】layoutSubviews在iPhone和iPad中,当设备方向改变后的调用情况
- UNITY EDITOR EXTENSIONS – MENU ITEMS[详]
- Android 自定义控件实现刮刮卡效果 真的就只是刮刮卡么
- Android 获取当前手机电量
- Android自定义控件View的探讨
- Swift学习笔记(十八)泛型
- UIWebView与JS的交互
- sql server cross/outer apply 用法
- Android图形图像之使用Path类
- 搜索WKWebView[UIWebView]中内容
- iOS多线程技术
- android压缩图片的算法
- Xamarin.Android快速入门
- android侧滑菜单-DrawerLayout的基本使用