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:
Best Answer
apt
andapt-get
share the same config files.apt-key
is a separate command,apt
doesn't have any ofapt-key
's functionality. The steps from the blog post will remain the same, except that you can replaceapt-get
withapt
for the last two commands.It might be easier to just download the Google Chrome package from its website, and then install it using:
Chrome's package adds both the key and the repository, so I think this is the simplest way. Note that this wouldn't be directly possible with
apt-get
, sinceapt-get
doesn't support installing deb files directly, and if you useddpkg
, you'd have to runapt-get install -f
later to fix dependency issues.