Saturday, January 11, 2014

Ubuntu - Linux - E: Package has No installation candidate

E: Package has No installation candidate

This is one of the common Ubuntu error you get while installing new packages.
If you are getting it for any specific package then you should update your apt repository by adding this package.

But if you are getting this error for every package, here is the solution.

Run following command.
# sudo apt-get update
Now try to install the package again, you should not get the error.

Find the public IP address of the system using command line

Commands to find Static IP address of the server

If you want to find the public IP address of the system. Run following commands.
# wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
If this is not working for you, try this.
# curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
It does not show you the LAN IP address, it shows the IP address that you can access out side the LAN, if it is static.
# curl ifconfig.me
One of these four should work for you.
# lynx -dump ifconfig.me | grep 'IP Address'

No write since last change (use ! to override)

No write since last change (use ! to override)

If you are getting this error after using :q while saving your changes in command line editor.
Run following commands
:w
then
:q
Now it will ask to save the changes.