Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I remember that on one Debian system, I used apt install package to install a package. It asked for a password afterwards and was more convenient than sudo apt-get install.

Now I am not sure how I managed to use the first command. Can you help?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

You can probably create an alias for that.

Assuming you are using Bash, create a .bash_aliases file in your Home directory, if it already doesn't exist.

Then, add a line with the following to the file:

alias apt='sudo apt-get'

Now close the shell and reopen it again.

Now you can install any new package with the syntax apt install <package-name>. Do note that autocompletion will not work with the alias.

share|improve this answer
    
you are right, and since i'am using zsh autocompletion still works, that's great thanks. –  Jeremia Aug 22 '12 at 11:14

Open up your bash_profile or bashrc. (Probably in ~/.bashrc or ~/.bash_profile). Now add the line alias apt='sudo apt-get'. Now save the file, quit your terminal, and reopen it.

share|improve this answer
    
jokerdino beat me to the answer. Using .bash_aliases is probably better than using .bashrc, but jokerdino's answer won't give you the exact syntax you wanted. If you type my line into .bash_aliases (or .bashrc), then you will be able to use the command 'apt install <package>' rather than 'aptinstall <package>'. –  daviewales Aug 22 '12 at 10:55

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.