Jump to content
xisto Community
Ahsaniqbalkmc

Linux Command: Wget -O

Recommended Posts

While playing with my pi, the first thing i did was update the packages, using commands:

sudo apt-get updatesudo apt-get upgrade

However, while looking for stuff online, I came across a tool to update the raspberry pi firmware. Now I don't REALLY understand what is meant by updating the raspberry pi firmware ( something like updating BIOS of PCs ?? or Something like updating kernels of linux machines ?? Or something else) but because its an UPDATE, I decided to do it.

 

The tool is rpi-update developed by Hexxeh.

So I went on and ran the following command on my raspberry pi:

sudo apt-get install rpi-update

But I was told that the package is already installed.

 

Then I ran

sudo rpi-update

And nothing really happened. So I decided to find some help online.

 

I found an aritcle which had commands as shown below:

sudo apt-get install ca-certificatessudo apt-get install git-coresudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-updatesudo rpi-updatesudo shutdown -r now

And here comes the problem of not understanding what I am doing. So I am on this forum to ask for help:

 

??? The first command installs ca-certificates, but I don't understand what are ca-certificates and what they do

??? Same situation with the second command i.e. what is git-core and what does it do

??? The third command is the main problem and that why I decided to give thic topic a relative title.

The problem here is that I understand that the command is telling the pi to download file from https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update however I don't understand the second part of the command. I searched online for help and found this:

 

-O file --output-document=file The documents will not be written to the appropriate files, but all will be concatenated together and written to file. If file already exists, it will be overwritten. If the file is -, the documents will be written to standard output. Including this option automatically sets the number of tries to 1.

 

I really really don't understand this.

 

Any help would be appreciated:

Share this post


Link to post
Share on other sites

echo " !!! Failed to download update for rpi-update!" echo " !!! Make sure you have ca-certificates installed and that the time is set correctly" exit 1

 

This part of the rpi-update code means that the ca-certificates have to be installed before performing the rpi-update.

And, of course, the firmware does not necessarily need to be updated, only in some cases due to memory problem addressing. Just have a look at your hardware settings, if LInux sees your hardware, your Ethernet adapter and your memory, no need to update the firmware.

And, by the way, if your question is "what does the wget -O mean", these instructions make you install ca-certificates and git-core, and then download the content of http://goo.gl/1BOfJ

and name it "/usr/bin/rpi-update" and make it executable and the execute it.

I would personally not do it because I don't update my firmwares unless I fall into a precise bug ; neverthesless, here is a link

http://raspberrypi.stackexchange.com/questions/4355/do-i-still-need-rpi-update-if-i-am-using-the-latest-version-of-raspbian

discussing the firmware and software update things.

Share this post


Link to post
Share on other sites

This part of the rpi-update code means that the ca-certificates have to be installed before performing the rpi-update.

Maybe I didn't make myself clear when I said this:

??? The first command installs ca-certificates, but I don't understand what are ca-certificates and what they do

What I wanted to say was that I understand that this command is going to install ca-certificates. However I don't know what is "ca-certificates". So I am interested in knowing

What is "ca-certificates" ?

What does it do ?

Why is it important to install before running rpi-update ?

 

I think I have made myself very clear now.

 

Same goes for the second command. I understand that it would install git-core but I don't know what is "git-core". So I am interested in knowing:

What is "git-core" ?

What does it do ?

Why is it important to install before running rpi-update?

 

About the third question I asked, I need you to confirm that I have understood your explanation correctly. My understandig of the wget -O is:

"wget is the command that enables you to download stuff via the command line. It has many options including -O. This -O option enables you to store the downloaded info in a specified way i.e. you can describe the file name and directory in which the downloaded stuff would be stored. So when using -O option, you need provide the directory and filename. Furthermore -O also makes sure that the downloaded stuff is run automatically after the download is complete"

 

Please confirm that my understanding of the wget and -O is correct.

Share this post


Link to post
Share on other sites

What is "ca-certificates" ?

OK, when you install something you don't really know about, somebody has to certify that this thing can be installed.

You probably have found this kind of things when installing a Crosoft Windows software, you have seen a warning saying that "This thing is not certified by Microsoft, you should not install it".

Microsoft is not the only authority assessing that something is a valid software.

Have a look here in order to learn what a certificate authority is :

https://en.wikipedia.org/wiki/Certificate_authority

So, the sofwares you are wanting will not be installed if ca-authority is not already present.

Also, as I already said, I don't like updating firmwares, it can break things if the firmware you install is not suitable for your hardware.

However, if you really want to do this update, you will need to first install, and then run rpi-update

And I guess that rpi-update will not start if git-core is not already installed.

And don't ask me what "git" is, I guess it's a way of distributing Linux kernel versions. More infos here : http://askubuntu.com/questions/5930/what-are-the-differences-between-the-git-and-git-core-packages

Share this post


Link to post
Share on other sites

Thanks for making me understand what "ca-certificates" is. And also for providing an insight into what git might be. Following the source you provided, I searched for git and found that it's a "SCM tool" (Software Configuration Management tool). So after doing a little research, I developed an understanding of what a SCM is (and thus what git is) and I thought it would be good to share it here,

 

So basically a Software Configuration Management tool is a tool that tracks and controls changes in the software. The thing becomes easier to understand when we see it parallel to the open source community. Open source software have usually a community of developers behind them. Anyone in this community can change the code and add things to it. So there must be some means of tracking and controlling these changes and people who make them. This is the job of a SCM (git in this case). It tracks what changes are made, when they are made, and who has made them. It also controls who can make changes to the software. The outcome of the software after the changes is noted and tracked and if they have a negative impact, the changes can be reversed.

 

So git (and other SCMs) make sure that open source software isn't subject to non-useful and harmful code modification. It also makes easy to track the changes made in different versions. Overall it makes open-source software more reliable.

 

Additions (or modifications) to my understanding of git and other SCMs is welcome.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.