5

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?

2
  • 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, 2016 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, 2016 at 7:46

2 Answers 2

15

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
2
  • Rinzwind's answer is correct but just to add some help if you are not sure you are choosing the correct package name you can look it up with 'apt-cache search [package-name]'. Even with a partial package name this will return a list of similar packages. Jul 16, 2017 at 15:29
  • hahaha, I feel like an idiot.. i forgot the "install" option... Mar 12, 2018 at 15:25
1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .