我正在使用新安装的 Ubuntu 15.04,因为我想安装较新版本的 Python。因此,我在终端中输入了此内容。
sudo apt-get install python 3.5.0
然后它下载并安装了一些东西。之后当我进入python3
终端时,它打开的是版本 3.4.3,而不是 3.5.0。
虽然它没有安装我想要的版本,但我输入了这个
sudo apt-get remove python 3.5.0
当它完成后,我发现Ubuntu 软件中心消失了,当我重新启动操作系统时,Ubuntu 的启动器和菜单栏消失了,但桌面上的文件可见且可打开。但 ctrl + alt + t 无法打开终端。
那么,这里出了什么问题?
答案1
因为bash
使用空格将命令行划分为参数(读作man bash
),所以你确实这样做了:
sudo "apt-get" "remove" "python" "3.5.0"
即删除两个包“python”和“3.5.0”。许多包(见下面的列表)依赖于python
,没有它就无法工作。因此,如果您要删除python
,您还必须删除(见列表)。
请阅读man apt-get
,并理解命令,尤其是使用 的命令sudo
,在执行之前。
如果您不理解命令,其他人可能会告诉您(使用无法解释的计算机术语)“瞄准脚。开火!”,而您不理解,也会照做。很多人都这样做。
答案2
当我在 15.04 系统上的 bash 中启动该命令时sudo apt-get remove python 3.5.0
(不,不是真的,我用过sudo -s apt-get remove python 3.5.0
),结果就是这样。换句话说,你的系统无法使用。我说,如果你重新安装并阅读,速度会更快这。
The following packages will be REMOVED:
aisleriot apt-xapian-index apturl arronax arronax-base arronax-nautilus
asymptote atom bzr bzr-builddeb calibre calibre-bin cdbs colortest-python
cython deja-dup deja-dup-backend-cloudfiles deja-dup-backend-gvfs
deja-dup-backend-s3 diffuse dput dropbox duplicity elyxer gcalcli
gcj-4.9-jre-lib gconf2 gdebi gdm gedit gedit-latex-plugin gimp gimp-gmic
gimp-gutenprint gimp-plugin-registry gir1.2-gda-5.0 gir1.2-ibus-1.0
git-buildpackage gksu gnome-control-center gnome-doc-utils
gnome-exe-thumbnailer gnome-pkg-tools gnome-shell gnome-shell-extensions
gnome-tweak-tool gnome-user-share gobject-introspection gtk-doc-tools guake
gufw gvfs-backends gvfs-backends-goa gyp ibus ibus-pinyin ibus-table
ibus-unikey inkscape iotop ipython ipython-qtconsole itstool jobs-admin
jobservice libappstream-glib-dev libatk-bridge2.0-dev libatk1.0-dev
libatkmm-1.6-dev libatspi2.0-dev libavahi-glib-dev libbonobo2-dev
libbonoboui2-0 libbonoboui2-dev libboost-all-dev libboost-mpi-python-dev
libboost-mpi-python1.55-dev libboost-mpi-python1.55.0 libboost-python-dev
libboost-python1.55-dev libcairo2-dev libcairomm-1.0-dev
libcanberra-gtk3-dev libclutter-1.0-dev libclutter-gtk-1.0-dev libcogl-dev
libcogl-pango-dev libcogl-path-dev libcv-dev libcvaux-dev libdbus-glib-1-dev
libdbusmenu-glib-dev libdbusmenu-gtk3-dev libdee-dev libenchant-dev
libgail-dev libgcj-common libgcj15 libgconf2-dev libgda-5.0-4 libgda-5.0-bin
libgda-5.0-common libgda-5.0-dev libgda-5.0-postgres libgdamm-5.0-13
libgdk-pixbuf2.0-dev libgee-0.8-dev libghc-gconf-dev libghc-glib-dev
libgirepository1.0-dev libgksu2-0 libglade2-dev libglib2.0-dev
libglibmm-2.4-dev libgnome-keyring-dev libgnome-vfs2.0-cil libgnome2-0
libgnome2-bin libgnome2-common libgnome2-dev libgnome2.24-cil
libgnomecanvas2-dev libgnomeui-0 libgnomeui-dev libgnomevfs2-0
libgnomevfs2-common libgnomevfs2-dev libgnomevfs2-extra
libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libgtk-3-dev
libgtk2.0-dev libgtkmm-2.4-dev libgtkmm-3.0-dev libgtksourceview-3.0-dev
libgudev-1.0-dev libhighgui-dev libibus-1.0-dev libidl-dev libindicate-dev
libjson-glib-dev libmagick++-6.q16-dev libmagick++-dev
libmagickcore-6.q16-dev libmagickwand-6.q16-dev libmagickwand-dev libmx-dev
libnotify-dev libopencv-contrib-dev libopencv-dev libopencv-highgui-dev
libopencv-legacy-dev libopencv-objdetect-dev libopencv-ocl-dev
libopencv-superres-dev libopencv-videostab-dev liborbit2-dev
libpackagekit-glib2-dev libpango1.0-dev libpangomm-1.4-dev libpeas-dev
libpulse-dev libpurple-bin libreoffice-gnome librsvg2-dev libsdl1.2-dev
libsdl2-dev libsmbclient libsoup2.4-dev libspice-client-glib-2.0-dev
libspice-client-gtk-2.0-dev libspice-server-dev libunity-dev
libwebkitgtk-3.0-dev libzeitgeist-2.0-dev lilypond-data lyx lyx-common meld
mercurial mercurial-common monodevelop morituri mplayer2 nautilus-share
ndiff node-gyp nodejs-dev npm nut-monitor ocrfeeder oneconf oneconf-common
openshot pdftk picard pyrenamer python python-appindicator python-apport
python-apt python-aptdaemon python-aptdaemon.gtk3widgets
python-beautifulsoup python-boto python-bs4 python-bzrlib python-cairo
python-cddb python-characteristic python-chardet python-cherrypy3
python-cloudfiles python-colorama python-commandnotfound python-configobj
python-crypto python-cssselect python-cssutils python-cups python-dateutil
python-dbus python-debian python-debianbts python-debtagshw python-decorator
python-defer python-defusedxml python-dev python-dirspec python-discid
python-distlib python-distro-info python-distutils-extra python-dns
python-dnspython python-ecdsa python-enchant python-feedparser python-gconf
python-gdbm python-gflags python-gi python-gi-cairo python-gi-dev
python-glade2 python-gnome2 python-gnomekeyring python-gobject
python-gobject-2 python-gobject-2-dev python-googleapi python-gpgme
python-gst0.10 python-gtk2 python-gtk2-dev python-gtk2-doc python-gtkspell
python-gudev python-hachoir-core python-hachoir-metadata
python-hachoir-parser python-html5lib python-httplib2 python-idna
python-imaging python-jinja2 python-kaa-base python-kaa-metadata
python-keybinder python-keyring python-launchpadlib
python-lazr.restfulclient python-lazr.uri python-ldb python-libxml2
python-lockfile python-lxml python-mako python-markdown python-markupsafe
python-mechanize python-mlt python-musicbrainzngs python-mutagen
python-nautilus python-ndg-httpsclient python-netifaces python-nose
python-notify python-ntdb python-numpy python-nut python-oauth
python-oauth2client python-oauthlib python-oneconf python-openssl python-pam
python-paramiko python-parsedatetime python-pexpect python-pil
python-pil.imagetk python-pip python-pisa python-piston-mini-client
python-pkg-resources python-problem-report python-pyasn1
python-pyasn1-modules python-pycurl python-pyexiv2 python-pygments
python-pygoocanvas python-pyicu python-pyorbit python-pyparsing python-pypdf
python-pyqt5 python-pyqt5.qtsvg python-pyqt5.qtwebkit python-qt4
python-renderpm python-reportbug python-reportlab python-reportlab-accel
python-repoze.lru python-requests python-routes python-samba python-sane
python-scour python-secretstorage python-serial python-service-identity
python-setuptools python-simplegeneric python-simplejson python-sip
python-six python-soappy python-software-properties python-speedtest-cli
python-sqlite python-support python-talloc python-tdb python-tk
python-twisted-bin python-twisted-core python-twisted-web python-tz
python-ubuntu-sso-client python-ubuntutools python-uritemplate
python-urllib3 python-usb python-utidylib python-vobject python-vte
python-wadllib python-webob python-wheel python-wstools python-wxgtk2.8
python-wxgtk3.0 python-wxversion python-xapian python-xdg python-yaml
python-zeitgeist python-zmq python-zope.interface python3-oneconf
python3-smbc r-base-dev rapid-photo-downloader regexxer reportbug rubber
samba-common-bin samba-libs sessioninstaller smart-notifier software-center
software-center-aptdaemon-plugins soundconverter
system-config-printer-common system-config-printer-gnome terminator
texlive-full texlive-lang-indic texlive-music totem-plugins transmission-gtk
trash-cli ubuntu-dev-tools ubuntu-gnome-desktop ubuntu-release-upgrader-gtk
ubuntu-sso-client ubuntu-system-service update-manager update-notifier
update-notifier-common valac valac-0.26 valac-0.28 vlc-plugin-samba
xdiagnose y-ppa-manager yelp-tools youtube-dl youtube-dlg zeitgeist zenmap
zim