我知道我可以apt-get remove <package>用来删除程序。
而是apt一个程序本身。我可以apt-get remove apt用来删除它,还是会在中途混淆?
cau*_*uon 79
APT 允许您使用选项模拟您的命令-s。您可以自己尝试,发出命令apt-get -s remove apt(sudo不需要)。
这会产生以下输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
apturl-common xul-ext-ubufox
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
apt apt-utils apturl nautilus-share python3-software-properties
software-properties-common software-properties-gtk ubuntu-desktop
unattended-upgrades
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
apt
0 upgraded, 0 newly installed, 9 to remove and 0 not upgraded.
Remv ubuntu-desktop [1.341]
Remv nautilus-share [0.7.3-1ubuntu5]
Remv apturl [0.5.2ubuntu9]
Remv software-properties-gtk [0.96.13.1]
Remv software-properties-common [0.96.13.1]
Remv python3-software-properties [0.96.13.1]
Remv unattended-upgrades [0.86.2ubuntu1]
Remv apt-utils [1.0.10.2ubuntu1]
Remv apt [1.0.10.2ubuntu1]
Run Code Online (Sandbox Code Playgroud)
所以答案应该是:是的,你可以。
Rin*_*ind 30
你可以...
sudo apt-get remove apt
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
apt apt-utils apturl nautilus-share python3-software-properties
software-center software-properties-common software-properties-gtk
ubuntu-desktop ubuntu-extras-keyring ubuntu-minimal unattended-upgrades
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
apt
0 upgraded, 0 newly installed, 12 to remove and 0 not upgraded.
After this operation, 9,031 kB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
?] Yes, do as I say!
(Reading database ... 179817 files and directories currently installed.)
Removing ubuntu-desktop (1.327) ...
Removing nautilus-share (0.7.3-1ubuntu5) ...
Removing apturl (0.5.2ubuntu4) ...
dpkg: warning: while removing apturl, directory '/usr/lib/python3/dist-packages/AptUrl/gtk/backend' not empty so not removed
Removing software-properties-gtk (0.94) ...
dpkg: warning: while removing software-properties-gtk, directory '/usr/lib/python3/dist-packages/softwareproperties/gtk' not empty so not removed
Removing software-properties-common (0.94) ...
Removing python3-software-properties (0.94) ...
Removing unattended-upgrades (0.82.8) ...
Removing ubuntu-minimal (1.327) ...
Removing apt-utils (1.0.9.2ubuntu2) ...
Removing software-center (13.10-0ubuntu4.1) ...
Removing ubuntu-extras-keyring (2010.09.27) ...
OK
Removing apt (1.0.9.2ubuntu2) ...
Processing triggers for man-db (2.7.0.2-2) ...
Processing triggers for gconf2 (3.2.6-2ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu2) ...
Processing triggers for bamfdaemon (0.5.1+14.10.20140925-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.55ubuntu1) ...
Processing triggers for dbus (1.8.8-1ubuntu2) ...
Processing triggers for libc-bin (2.19-10ubuntu2) ...
Run Code Online (Sandbox Code Playgroud)
并且会被警告你即将做一些非常具有破坏性的事情。我必须说......包的列表看起来很糟糕,节省的空间少于 6000kb :D
它确实完成了,但没有办法使用“apt-get”。Ubuntu 软件中心将不再工作,您需要使用“dpkg”重新安装包管理器(并且还需要手动安装所有依赖项)。
cat*_*cat 12
有一次,当我运行 CoreUbuntu 时,我从源代码安装了一个错误的包,它apt决定apt. 下次跑的时候apt autoremove,其实没看要删除的软件列表,apt就在列表中。
想象一下我下次打字apt install <package-name>并得到The program 'apt' is currently not installed. You can install it by typing: sudo apt-get install apt.
幸运的是,由于某种原因,autoremove没有删除任何的apt',所以我不得不做的呈S依赖wget apt的.deb使用归档和重新安装dpkg -i。
如其他答案所示,如果您删除apt with apt,由于它试图解决的依赖关系,您会遇到更多麻烦。
我觉得这很有趣,但确实是这样(当然对于 Debian,也许在某种程度上也适用于 Fedora/openSUSE?)许多现代发行版主要是基于他们选择的包管理器提供的基础架构来定义和构建的。
| 归档时间: |
|
| 查看次数: |
11511 次 |
| 最近记录: |