Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For so many commands which i type are correct even then i have errors like unable to locate package or sometimes it gives "invalid operation" . This error really kills me, how can i fix this?

share|improve this question
2  
Note: instead of apt-get you can use apt. It does the same things in a more beginner friendly way plus it colorize output etc. – Bakuriu Mar 21 at 21:14
    
@Bakuriu make it an answer with some examples or I will add it into mine and profit from it ;-) – Rinzwind Mar 22 at 7:46

This

sudo apt-get cpufrequtils

is missing a mandatory option. To install or remove use...

sudo apt-get install cpufrequtils
sudo apt-get remove cpufrequtils
share|improve this answer

An more morecent alternative to apt-get is the apt command (see here for a discussion about their differences).

Maybe using apt you more easily realize that installing isn't the only thing that these tool do. And as such you first have to tell them the operation you want to perform:

sudo apt install cpufrequtils

Without the install the command wouldn't know whether you want to install or uninstall that package or if you simply want to search for it.

The name apt-get may sound like it only "gets"("install") the programs, but this isn't true.


You should prefer apt for interactive use as it provides a cleaner interface and colorized human friendly output. Use apt-get or apt-cache for scripts.

share|improve this answer

The apt-get tool actually does many things to packages, such as installing, removing, purging, etc... This is accomplished by adding a command to the options like apt-get install cpufrequtils. Not choosing a command results in an error message.

Asking apt-get to do something with the name of a package that is not in the repository will cause an error.

Everyone types commands incorrectly sometimes, that is life. Unless you are encountering a bug in the software (which is highly unlikely), the command is typed wrong. Look for typos, then for logical errors, and if all else fails try typing the command again.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.