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
Benyamin Jafari
  • 3,016
  • 3
  • 22
  • 31
Moin Khan
  • 49
  • 1
  • 2
  • 8
  • I am a new user on ubuntu please tell me briefly.. – Moin Khan May 29 '18 at 09:08
  • Your command looks okay to me; so I'd suggest entering the following command `apt-cache policy gparted` and adding its output to your question. The only obvious thing missing is you need to update your repository lists with the command `sudo apt-get update` before you `sudo apt-get install gparted` (*if you are using a 'live' environment it must be done each boot*) – guiverc May 29 '18 at 09:12
  • I updated my reository using above command but it is not useful – Moin Khan May 29 '18 at 09:16
  • please add the `apt-cache policy gparted` command and output to your question. Did you get any errors with the `sudo apt-get update`? – guiverc May 29 '18 at 09:18
  • No sir i not got any error with the sudo apt-get update – Moin Khan May 29 '18 at 09:28
  • BUt still now my problem is not solved – Moin Khan May 29 '18 at 09:29
  • 1
    The output is showing as --Unable to locate package gparted – Moin Khan May 29 '18 at 09:30
  • I have run this command .. kmoin@kmoin-Inspiron-15-3567:~$ apt-cache policy gparted N: Unable to locate package gparted – Moin Khan May 29 '18 at 09:39
  • @MoinKhan at first try to `sudo apt-get update`. do you have any error with this command? – Benyamin Jafari May 29 '18 at 09:41
  • ok please see this i used the command --sudo apt update – Moin Khan May 29 '18 at 09:47
  • @BenyaminJafari I have no any error to sudo apt-get update . command and it is shownig that 18 packages can be upgradable – Moin Khan May 29 '18 at 09:53
  • https://askubuntu.com/questions/378558/unable-to-locate-package-while-trying-to-install-packages-with-apt – d a i s y May 29 '18 at 10:19

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
Cornea Valentin
  • 679
  • 6
  • 11
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
  • 35,754
  • 55
  • 92
  • 145
Deepak Kumar
  • 547
  • 2
  • 5
  • 12
0

Just use the apt command like this:

$ sudo apt install gparted

That should work, let us know.

Benyamin Jafari
  • 3,016
  • 3
  • 22
  • 31