My friends told me to run this command
sudo apt-get
When I wanted new software. But I type it and it does nothing other than ask for a password. What is this command? How do I use it better?
sudo apt-get
Started by Off, Feb 22 2008 03:09 PM
3 replies to this topic
#1
Posted 22 February 2008 - 03:09 PM
|
|
|
#2
Posted 23 February 2008 - 12:37 AM
It's two separate commands, or programs. You shall know that everything you type in the terminal is actually programs (and they're all located in the different directories, which $PATH specifies) sudo is used to run a command as root. You'll have to be root in order to install new software. You could also choose to first become root, using su, and then next run the command.
As you may noticed about apt-get, there's a little problem. You've no control on precisely what to install, and where to install it. If you want or need this control, you'll need to install the software by the sourcecode. It's slightly more complicated, but the plus is; you'll get the control. Another user asked about the same thing some days ago, and you can find my response in the thread, which is located right here: http://www.totalpeng...read.php?t=1149
$ su $ apt-get ...Now to apt-get. apt-get is the packaging system used in Debian-based systems (including the *ubuntu-family.) It's used for easier installation of software, which normally can be hard on Linux. You can give apt-get, a lot of options, but I'll concentrate on one, the one for installation; install.
$ sudo apt-get install softwareWe let apt-get know, that we want to install some new software. software shall be the name of what you will install. So you shall not write software, but the name of the software you want to install. Let's say you want to install the popular FPS-game Sauerbraten. The only thing you've to do is:
$ sudo apt-get install sauerbratenNow, apt-get will handle the process, and you don't have to do anything. To remove it again, you'll need to replace the install with remove instead. You shall also note that you can't find all the software you want using apt-get, but you can find a lot for sure. You can use apt-cache to search for available packages. You don't have to be root to use apt-cache, as you're not going to install anything.
$ apt-cache search sauerbratenYou'll now get a whole list of packages related to Sauerbraten. You can also use another keyword, like game, for finding other games.
As you may noticed about apt-get, there's a little problem. You've no control on precisely what to install, and where to install it. If you want or need this control, you'll need to install the software by the sourcecode. It's slightly more complicated, but the plus is; you'll get the control. Another user asked about the same thing some days ago, and you can find my response in the thread, which is located right here: http://www.totalpeng...read.php?t=1149
#3
Posted 23 February 2008 - 08:40 AM
Wow, informative post! Thank you for the reply. I don't understand the root system though. Why do I need to sudo to root to run a command? I think I understand the apt-get after playing around with it and reading your post.
#4
Posted 23 February 2008 - 09:01 AM
I'm glad you liked my post.
You've probably heard that everything in Linux is basically a file. And all these files each have a permission. The permission specifies who is able to read, execute, write, etc. to and from the file. As root, you're able to do everything with every file on the system without thinking about the permissions. That's why you need to be root in order to use apt-get. apt-get will read and write from files and directories which most likely all have limited permissions for the normal user.
There's much more in apt-get than I just told you. It's very complex, and it cannot be described in few words. I'll suggest you to check the man-page for apt-get, and eventually, pass the parameter --help to apt-get, for usage-help.
You've probably heard that everything in Linux is basically a file. And all these files each have a permission. The permission specifies who is able to read, execute, write, etc. to and from the file. As root, you're able to do everything with every file on the system without thinking about the permissions. That's why you need to be root in order to use apt-get. apt-get will read and write from files and directories which most likely all have limited permissions for the normal user.
There's much more in apt-get than I just told you. It's very complex, and it cannot be described in few words. I'll suggest you to check the man-page for apt-get, and eventually, pass the parameter --help to apt-get, for usage-help.
# Check out the man-page $ man apt-get
# Get help to apt-get $ apt-get --help


Sign In
Create Account


Back to top









