I have installed ubuntu 12.04.2(precise pangolin(64bit)) in VM workstation on Windows 7. I am trying to run cmd "sudo add-apt-repository “deb http://archive.canonical.com/ maverick partner”". But it is giving me error: Need a repository.

Please reply with correct form of this cmd.Also I need to install java6 or 7 in this.

2 Answers 2


Manually add the following line to /etc/apt/sources.list

deb http://archive.canonical.com/ubuntu/ maverick partner

Note: it needs to be added as root. So run it with sudo - e.g.,

sudo vim /etc/apt/sources.list

If you need java7 (or 8 even 6) I suggest you to refer to this ppa, it is reliable and it has oracle java packages for version 7 and 8 (you're able to install both without problem I think)

To add the ppa run:
sudo apt-add-repository ppa:webupd8team/java

sudo apt-get update
sudo apt-get install oracle-java7-installer
(replace the '7' with '6' or '8' as you wish)

You must log in to answer this question.