I'm learning about the differences between apt and apt-get.
I read another answer that they are essentially the same but apt
aims at providing a more pleasant user experience. Also from reading the wiki it sounds look both tools use the same repositories.
The list are repositories are available in the following etc file:
/etc/apt/sources.list
Running the following apt
command seems like another way to simply open that file in a text editor like vim
:
sudo apt edit-sources
Now, I'd like install the google-chrome-stable
package. But my goal is to take this as a specific example to help me:
- Learn more about how package management works with on Ubuntu 16.04
- Be able to use
apt
for all my package management needs - Be able to translate
apt-*
commands intoapt
commands
I'm pretty sure the main problem is the google-chrome-stable
package lives in a third party repository which isn't inside my /etc/apt/sources.list
file by default. Also, I think both apt
and apt-get
share the same config file. Is this right?
I found a blog post that describes how to go through the installation process with apt-get
:
Setup key with:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
Setup repository with:
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
Setup package with:
sudo apt-get update sudo apt-get install <package name>
where is the name of the package you want to install.
How would I do the same thing with the apt
command? For example, I see they're apt-key
and apt-get
, are there corresponding commands with apt
?
Edit:
Please refer to the comments below and these two blog posts by Joel and Jeff to learn more about asking specific questions about tools that have been generally asked about.
To add two examples illustrating that this question is more specific:
apt
. It also highlights confusion around the differences betweenapt
,apt-get
, andapt-key
as well as how the config files are treated. The accepted answer @user535733 links to is essentially a copy and paste of a man page. There are some folks who enjoy and gain from specific examples. That's what this question is about. – mbigras Feb 22 '17 at 18:46