0

Alright, so I just installed Ubuntu and I'm new to the Linux community in general so this might seem a bit obvious to most of you, but how do repositories work? I know that a repository is like a server that has a bunch of packages that you can install from but I'm still confused on many aspects of this concept, here are a few of them:

  1. What is apt. I did some googling and its a command utility. So is it just a piece of software for handling repositories?
  2. What is the difference between apt and apt-get?
  3. There seems to this "Ubuntu software center", which repository is that? Is it like Ubuntu's official repository? Or is it a collection of all the repositories on your computer?
  4. How do you search for a package without using the Ubuntu software center (if it's even possible)?
  5. When you use apt for installing packages from a third party repository, it doesn't seem like you need to specify which repository. Thus it seems like when you add a repository, it all gets added to this one big abstract repository. Won't that cause name conflicts?
  6. When you want to add a repository, it seems that you can do something like this, sudo add-apt-repository ppa:webupd8team/java How does apt locate that repository? There doesn't seem to be a URL of any sort.

I know this is a lot of questions but if you could answer even 1 or 2 that'd be really helpful. Thanks in advance :)

piny88
  • 3

1 Answers1

0

What is apt. I did some googling and its a command utility. So is it just a piece of software for handling repositories? What is the difference between apt and apt-get?

Advanced packaging tool or apt for short is a tool to manipulate the .deb packages on your system or to be installed on your system. The apt-get is the old name for the new apt command, they are the same command. Then there is aptitude and dpkg that can do the same job and install/manipulate packages. The dpkg being the original tool with apt-get coming next then the aptitude in terms of their development.

There seems to this "Ubuntu software center", which repository is that? Is it like Ubuntu's official repository? Or is it a collection of all the repositories on your computer?

Both it will have all applications available in the repositories contained in your /etc/apt/sources.list and the files contained in the /etc/apt/sources.d/. The directory being a new idea for easily adding a repository without editing the /etc/apt/sources.list file. And it is where they prefer you install it from, their "official" place for installation of software.

How do you search for a package without using the Ubuntu software center (if it's even possible)?

In the Terminal application apt-cache search package_name will do a search of the cache for your package. Want to see the version to be installed apt-cache policy package_name will show you the version installed if any, the versions available, the repository it comes from and if any newer version is available.

When you use apt for installing packages from a third party repository, it doesn't seem like you need to specify which repository. Thus it seems like when you add a repository, it all gets added to this one big abstract repository. Won't that cause name conflicts?

No there are strict naming practices for packages designed to avoid this conflict , in addition they have version number added onto to the to further allow packages to co-exist. When a repository is added you must make certain it is made for the version of the OS it runs on.

deb http://deb.debian.org/debian buster main contrib non-free

Above is a line for Debian Buster it shows you the repository in the name, it could be stable too as that is the status of Buster until the next release in a month or two. When new stable is released the distribution would be updated if you had stable for your line and not Buster.

When you want to add a repository, it seems that you can do something like this, sudo add-apt-repository ppa:webupd8team/java How does apt locate that repository? There doesn't seem to be a URL of any sort.

I have no clue on how Ubuntu's system for that works I just use it when necessary and am too lazy to edit the file myself.

muru
  • 197,895
  • 55
  • 485
  • 740
  • 1
    For the last question, PPAs are hosted at https://launchpad.net. (The PPA for your specific example is https://launchpad.net/~webupd8team, and Ubuntu is at https://launchpad.net/ubuntu). So the "ppa:" format is simply converted to a full URL starting with "https://launchpad.net". – Enterprise Feb 25 '21 at 04:03