当我使用以下命令时显示输出。
$ sudo apt-get install gparted
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gparted
$ apt-cache policy gparted
N: Unable to locate package gparted
答案1
您需要使用以下命令更新 apt 存储库列表:
sudo apt-get update
然后再试一次
sudo apt-get install gparted
您也可以从源安装 Gparted。为此,请在终端中运行以下命令:
sudo apt-get build-dep gparted
sudo apt-get install git gnome-common
git clone git://git.gnome.org/gparted
cd gparted
./autogen.sh
make
sudo make install
另外,如果以上方法均无效,请检查您的/etc/apt/sources.list或者尝试更改为主服务器然后再次运行: sudo apt 更新
默认的 apt 源列表:
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
# deb http://archive.ubuntu.com/ubuntu xenial-proposed main restricted universe multiverse
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
答案2
sudo apt-get install gparted
上述命令应该可以正常工作。如果不行,你可以下载文件并手动完成。
这个问题解决了你遇到的相同问题,你可以看看尝试使用 APT 安装软件包时出现“无法找到软件包”。
答案3
只需使用apt
如下命令:
$ sudo apt install gparted
这应该可行,请告诉我们。