I use Xubuntu and found that I can update packages by using
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?
apt-get are related and very different from
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.
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.
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.
git is a more manual process. By using
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
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