3

When I used the command following output is showing.

$ 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
Moin Khan
  • 49
  • 1
  • 2
  • 8

3 Answers3

10

You need update the apt repository lists using:

sudo apt-get update 

then try again

sudo apt-get install gparted

Also you can install Gparted from the source. To do so, run the following commands in Terminal:

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

Also if none above works please check your /etc/apt/sources.list or try to change to main server and then run again: sudo apt update

default apt source list:

# 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
3
sudo apt-get install gparted

The above command should work fine. If it's not, you can download the file and do it manually also.

This question addresses the same problem that you have, you can have a look at "Unable to locate package" while trying to install packages with APT.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
Deepak Kumar
  • 577
  • 2
  • 5
  • 13
0

Just use the apt command like this:

$ sudo apt install gparted

That should work, let us know.