I have a brand new installation of Ubuntu 18.04. I then ran apt-get install curl
and it gave me:
Package 'curl' has no installation candidate
I then ran apt-get update
and tried installing curl again and it worked this time.
The term "update" can mean lots of things. What does it mean in the above context? what was it updating given that the Ubuntu I had just installed was the latest?
OK as I understand (speaking as a Ubuntu user) Ubuntu uses a packaging system (in common I believe with other Linux OSs) apt-get accesses this system. apt-get is used to install, upgrade and 'tidy up' existing packages - it is also used to gather information before installing or upgrading via the uptade clause. apt-get update updates the database with information on any new packages or versions. It does not update any installed packages, it updates the database with what is available, apt-get install installs after referencing the database and apt-get upgrade upgrades already installed packages after referencing the database. If you install without updating you may be trying to install an incomplete or out of date system referencing the out of date database. If you then run upgrade you will upgrade the package to include any amendments / enhancements made since the package was released. Be clear on the difference between update and upgrade. Hope this helps.
In Ubuntu if you want to install any package you have to type
apt-get install package_name
Hereapt-get
is nothing but apython script
and it's called synaptic package manager and you can check source code ofapt-get
on Github.And
update
in theapt-get
will downloads packages lists from the repositories and updates them to get information on the newest versions of packages and their dependencies. You can see this http://linux.die.net/man/8/apt-get:After running
apt-get update
when you runapt-get install curl
since it's updated thecurl
package will be available now.And you should see this Where does apt-get install get packages from? to know what
install
will do.