2

我在 linux mint 12 lisa 上运行了以下命令:

1). sudo rm -rf /var/lib/apt/lists/* -vf
2). sudo apt-get update
3). sudo apt-get install git

我在运行 3 时收到以下错误。即安装 git:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package git

我的 /etc/apt/sources.list 文件包含以下内容:

deb http://packages.linuxmint.com/ lisa main upstream import
deb http://archive.ubuntu.com/ubuntu/ oneiric main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ oneiric-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ oneiric-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ oneiric partner
deb http://packages.medibuntu.org/ oneiric free non-free

# deb http://archive.getdeb.net/ubuntu oneiric-getdeb apps
# deb http://archive.getdeb.net/ubuntu oneiric-getdeb games

sudo apt-get upgrade 显示以下内容:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4

2 回答 2

2

您需要先安装 aptitude。

sudo apt-get install aptitude

然后使用命令安装 git

sudo aptitude install git
于 2013-08-09T06:26:57.840 回答
2

我有一个类似的问题,并通过在一个命令行上同时运行更新和升级来解决它。

sudo apt-get update && sudo apt-get upgrade -y

之后,我通常使用以下命令安装 git:

sudo apt-get install git
于 2021-03-23T22:38:21.050 回答