Ubuntu: Enabling the Ubuntu universe Repository

ubuntuThere are four main repositories for Ubuntu: Main, Universe, Restricted, and Multiverse.  The Ubuntu CD contains the packages from the Main and Restricted repositories, so even if you do not have an Internet connections those will be available.

However, if you have booted from the LiveCD, and did not initially configure a wired or wireless network connection, then the ‘Universe’ repository will not be enabled.

If you were trying to install a package such as putty and the Universe repository source was disabled, you would get ‘E: Unable to locate package’ responses when trying to install and an empty response from apt-cache when searching for this package:

ubuntu@ubuntu:~$ sudo apt-get install putty
Reading package lists... Done
Building dependency tree 
Reading state information... Done
E: Unable to locate package putty
ubuntu@ubuntu:~$ sudo apt-cache search putty
ubuntu@ubuntu:~$

You could enable it manually by opening the Software center and going to the menu: Edit > Software Sources, and checking the box.

ubuntu-sw-center-universe

But if you are working remotely or at the console there is also an easy way to enable this repository.

sudo add-apt-repository universe

OR on older versions of Ubuntu you must use the full source line:

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"

Then do an update

sudo apt-get update

After enabling the repository, a search for a package in the Universe repository such as putty would now yield results:

ubuntu@ubuntu:~$ apt-cache search putty
libjsch-agent-proxy-java - Proxy to ssh-agent and Pageant in Java
libtrilead-putty-extension-java - PuTTY key support for Trilead SSH2 library
libtrilead-putty-extension-java-doc - Documentation for libtrilead-putty-extension-java
pterm - PuTTY terminal emulator
putty - Telnet/SSH client for X
putty-doc - PuTTY HTML documentation
putty-tools - command-line tools for SSH, SCP, and SFTP

and installing the package, would work normally.

apt-get install putty -y

 

REFERENCES

https://help.ubuntu.com/community/Repositories/Ubuntu

http://askubuntu.com/questions/78613/how-do-i-enable-the-universe-repository-from-the-command-line