0

I use Xubuntu and found that I can update packages by using apt and apt-get. But I have heard that programmers use usually git in their project to manage different version. So why Xubuntu do not use git to handle different versions of software?

  • 10
    It's an interesting question, however it seems that you first need to understand the difference between software package manager and version control systems. They are fundamentally very different things. – shivams Jan 14 at 18:50
  • 1
    Everything. What is the difference between format and mkdir? :-) – user259412 Jan 14 at 19:26
  • 3
    A package is a group of pre-configured files such as pre-compiled binaries, libraries, and/or supporting configuration files, etc. These are created by a package maintainer who may acquire original sources from git (or any other vcs or even a distribution method that isn't a vcs). This saves all of us the work of compiling all of our own applications and libraries and leverages skills of the maintainer. – Christopher Jan 14 at 19:38
  • They can, they just don't. Using git to manage versions of packages would be too much overhead and the main functionality of git -- storing all the versions of your files -- is not actually needed by users of package manager, software packages management system can have that kind of functionality, but would just be considered as bonus. – 炸鱼薯条德里克 Jan 16 at 5:25
10

apt and apt-get are related and very different from git.

apt is the package management tool for Debian-derived Linux distributions (including Ubuntu/Xubuntu). This is used to manage (i.e. download, install, remove, update) the binary software packages that makeup the Linux distribution you are using. This is about updating your local system software, as well as adding and removing programs.

'apt' is the command-line tool that is used to interact with the Synaptic graphical tool. Essentially, they do the same things; however, one is graphical and runs in the X-Window System and the other is run from the Linux command line.

apt-get is the command that is most-commonly used to install or update packages on your computer. apt is less-commonly used and differs from apt-get mostly in terms of output formatting. You can use man apt or man apt-get to pull up the manual pages, which will give you more details about the differences between the commands. There are also many pages online that will give you more information about how Synaptic and apt can be used.

git, on the other hand, is a versioning control system for source code for software development. Again, you can use man git for more information (if git is installed on your system). However, I wouldn't think you would need to worry much about git if you have Xubuntu and are not involved in developing software yourself.

4

So apt and apt-get are both package management tools available to most Debian and Debian based Linux distributions. APT stands for Advanced Package Tool and is a package management tool designed to manage .deb packages. Here is an article you can check out to see the differences. I also recommend you read the Debian Wiki on package management.

Essentially apt-get is "older" and apt is "newer" but both have largely the same functionality, that being they download, install, update, upgrade, and manage all your packages on your Debian install. They are interchangeable outside of a few edge cases.

Git on the other hand is a software version control system. Here is a good site to get started on learning about git. Developers and end users can use git to control versions of a project they are working on. You can use git to track changes in Word documents, videos, pictures, source code, etc.

It is just another tool to be able to manage and control software on your system. Some applications are not available in your operating system's repositories and the developers may choose to distribute a version in a git repository compared to the standard repository that your operating system's package manager would reference. In that case you would use git to download the software and follow any instructions the developers provide to complete the installation.

Using git is a more manual process. By using apt or apt-get you can automatically download and install any updates for all packages (software, firmware, kernel updates, security patches, etc.) with 1 or 2 commands. With git you would have to check to see if there is a new version of the software yourself, download it and complete all the installation steps needed. Unlike with an APT tool, you would have to do this for each individual piece of software you installed via git.

1

apt calculates dependencies. When you request software package X, apt installs both package X and all the packages it depends on. (Or in other cases, removes other packages). It unpacks the package files, and runs install scripts in sequence.

git allows pulling or pushing a set of (source code) files. It does not track dependencies. As well as the current version of the source files, git tracks the history of changes to the set of files.

Both of these are fairly sophisticated. They are also specialized to their respective purposes - with various tradeoffs and limitations. There is not much overlap in how the two work, or what they are used for.


For example they even tend to use different network and security protocols from each other.

Many (but not all) git downloads are now performed over HTTPS (HTTP over TLS). This defends against connection hijacking, by relying on the same global Web Certificate Authorities (CAs) that have been created to secure online shoppping, etc.

Connection hijacking on the internet is distressingly easy and widespread; we must always defend against it. Connection hijacking can be performed by a malicious Wi-Fi router you are connected to, the internet access provider, someone who gained access to a line between internet backbone routers, etc.

Most (but not all) apt downloads are performed over plain HTTP. apt authenticates the downloaded files using a different method. It uses one GPG signature file for the overall apt repository, which in turn authenticates a list of checksums of the available files. See SecureApt.

For example SecureApt is historically cheaper than TLS, because it does not require the server to encrypt each file transfer individually. Another example feature is the ability to download from your best local "mirror" server of the apt repository. All the mirror has to do is copy the same files. Mirror servers have been provided by many different organizations as a public service. And yet if the mirror server is hijacked, they cannot feed you a false update. The authenticated files can only be generated by the organization that holds the secret half of the GPG keypair.

There might be some room to improve SecureApt using more modern techniques. For example SecureApt has no equivalent of "Update Transparency" (analogous to Certificate Transparency), to deter state powers from secretly coercing backdoors into distributed software. Nevertheless, the features of SecureApt have been quite well suited to their purpose.

Whereas e.g. the Debian apt repo is generated by one large organization, many people will want to use Git to inspect source code and history from many stand-alone projects. Re-using HTTPS (i.e. authenticating using the Web Certificate Authorities) has been a very convenient way to add protection to git transfers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.