我不知道为什么我突然不能用 apt-get 做某事,例如sudo apt-get update
或sudo apt-get install blabla
这是输出uname -a
:
Linux adelleodel-X450CC 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
文件 apt-get:
apt-get: ERROR: cannot open `apt-get' (No such file or directory)
cat /etc/lsb-release:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"
ls -l 在 /usr/bin/apt-get 中:
ls: cannot access /usr/bin/apt-get: No such file or directory
dpkg-l apt:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=============================-===================-===================-================================================================
rc apt 1.0.1ubuntu2.11 amd64 commandline package manager
回显 $PATH :
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
我之前搜索过这个问题,有人说我必须下载一些东西然后 dpkg 一下。那该怎么办呢?有人可以提供链接并一步一步教我怎么做吗?非常感谢!!!!
-----编辑-----实际上,我确实这样做了sudo apt-get remove libusb-0.1-4:amd64
,并且我认为一些包自动删除了它。我这样做是因为我认为它不属于我的程序,因为我有libusb-1.0-0:amd64,libusb-1.0-0-dev:amd64, 和libusb-1.0-文档
我试过了wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.0.1ubuntu2.11_amd64.deb
结果是:
--2016-02-08 19:56:19-- http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.0.1ubuntu2.11_amd64.deb
Resolving security.ubuntu.com (security.ubuntu.com)... 91.189.91.13, 91.189.92.200, 91.189.92.201, ...
Connecting to security.ubuntu.com (security.ubuntu.com)|91.189.91.13|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 952468 (930K) [application/x-debian-package]
Saving to: ‘apt_1.0.1ubuntu2.11_amd64.deb’
100%[======================================>] 952.468 245KB/s in 3,8s
2016-02-08 19:56:29 (245 KB/s) - ‘apt_1.0.1ubuntu2.11_amd64.deb’ saved [952468/952468]
在那之后,sudo dpkg -i apt_apt_1.0.1ubuntu2.11_amd64.deb
结果是:
dpkg: error processing archive apt_apt_1.0.1ubuntu2.11_amd64.deb (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
apt_apt_1.0.1ubuntu2.11_amd64.deb
adelleodel@adelleodel-X450CC:~$ sudo dpkg -i apt_1.0.1ubuntu2.11_amd64.deb
(Reading database ... 230272 files and directories currently installed.)
Preparing to unpack apt_1.0.1ubuntu2.11_amd64.deb ...
Unpacking apt (1.0.1ubuntu2.11) over (0.8.10.3+squeeze1) ...
dpkg: dependency problems prevent configuration of apt:
apt depends on libstdc++6 (>= 4.6); however:
Version of libstdc++6 on system is 4.4.5-8.
apt depends on gnupg; however:
Package gnupg is not installed.
dpkg: error processing package apt (--install):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Errors were encountered while processing:
apt
答案1
你现在必须从以下位置下载 apt.deb 软件包到你的系统上: http://security.ubuntu.com/ubuntu/pool/main/a/apt/
打开终端(Ctrl-Alt-t)输入:
32 位:
wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_v_x_x_x_i386.deb
或者
64 位:
wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_v_x_x_x_amd64.deb
通过输入以下命令进行安装:
sudo dpkg -i apt_apt_v_x_x_x_i386.deb
sudo dpkg -i apt_apt_v_x_x_x_amd64.deb
或者
尝试从 Ubuntu 软件中心安装它。