You are reading the article How To Install Git On Linux updated in December 2023 on the website Achiashop.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested January 2024 How To Install Git On Linux
Git is a popular version control system that enables developers to track changes in their codebase and quickly interact with others. It is widely used in the software development business and has evolved into an essential tool for many programmers.
In this article will walk you through the Installation of Git on Linux.Prerequisites
Access to a user account that has sudo or root rights.
A computer that is running Ubuntu 20.04 or 22.04.
Access to a command line/terminal window (Ctrl+Alt+T).Install Git using APT
This is the easiest way to install Git on your system because Git package is included in the official Ubuntu chúng tôi you wish to install a specific version or latest stable version, you need to Install Git from source.
[email protected]:-$ sudo apt update Yeading package lists... 99%
This command will refresh the package listings in preparation for upgrades and new package installations.
Then, if there are any pending upgrades, upgrade the system:sudo apt upgrade [email protected]:-$ sudo apt upgrade Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no lon ger required: libflashromi libftdi1-2 1ibllvmi3 virtualbox-guest-utils Use 'sudo apt autoremove' to remove them. The following NEW packages will be installed: libatomic1 libllvmi5 linux-headers-5.19.0-45-generic linux-hwe-5.19-headers-5.19.0-45 linux-image-5.19.0-45-generic linux-modules-5.19.0-45-generic linux-modules-extra-5.19.0-45-generic systemd-hwe-hwdb The following packages will be upgraded: accountsservice alsa-ucm-conf apparmor apport apport-gtk apt apt-utils avahi-autoipd avahi-daemon avahi-utils base-files bind9-dnsutils bind9-host bindo-libs britty ca-certificates cpp-11 cups cups-browsed cups-bsd cups-client cups-common cups-core-drivers cups-daemon cups-filters cups-filters-core-drivers cups-ipp-utils cups-ppdc sudo apt install git [email protected]:-$ sudo apt install git Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no nger required: Llibflashrom1 libftdi1-2 1ibllvm13 virtualbox-guest-utils Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: git-man liberror-perl Suggested packages: git-gui gitk gitweb git-cvs git-mediawiki git-svn The following NEW packages will be installed: git git-man liberror-perl © upgraded, 3 newly installed, © to remove and 1 not upgraded. Need to get 4,147 kB of archives. After this operation, 21.6 MB of additional disk space will be used. Do you want to continue? [y/n]
During the installation, you may be asked to confirm the installation by typing ‘y’ and pressing Enter. Please do so in order for the installation to proceed. The system will then download and install the Git package and any dependencies.git --version
If Git was successfully installed, the version number will be displayed in the output terminal.Install Git from Source
If you wish to install a specific version of Git or any latest stable version, you need to compile Git from source. Make sure you install the dependencies required to install from source.sudo apt update sudo apt install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev make gettext libz-dev libssl-dev libghc-zlib-dev
Now choose the version you need to install and copy the tar.gz link from the official git releases page.
Now you can download and extract the version you wish to the /usr/share directory.
Once the download is completed you can move inside the directory and execute the following commands to compile and install Git.
HTTP request sent, awaiting response… 362 Found
following] /tags/v2.41.0 3… connected. HTTP request sent, awaiting response… 260 OK Length: 10884275 (16M) [application/x-gzip] saving to: ‘STDOUT’
Here are the instructions for compiling and installing Git on Linux:cd /usr/src/git-* sudo make prefix=/usr/local all sudo make prefix=/usr/local install [email protected]:~$ cd /usr/src/git-* sudo make prefix=/usr/Tocal all Sudo make prefix=/usr/Tocal install GIT_VERSION = 2.41.6 * new build flags CC oss-fuzz/fuzz-conmit-graph.o CC oss-fuzz/fuzz-pack-headers.o CC oss-fuzz/fuzz-pack-idx.o CC daemon.o * new link flags CC common-main.o cc abspath.o CC add-interactive.o CC add-patch.o CC alias.o CC alloc.o cc apply.o CC archive-tar.o cc archive-zip.o git --version
You will get a sample output similar to the one below.
Now you have compiled and installed Git from source.Configure the Git User Information
Before you begin using Git, you should configure your user information. This data will be linked to any commits you make in a Git repository. Replace the placeholders with your own name and email address and run the following commands:git config --global chúng tôi "Your Name" git config --global user.email "[email protected]"
You may check the configuration settings by running the command:git config --list
A list of setup items, including your name and email address, will be displayed.
If you prefer to manually edit the Git configuration file, you can do so with any text editor you like, such as nano:nano ~/.gitconfig
Now your changes will be saved inside the ~/.gitconfig folder.
Also read: You might also find useful our guide on How to Modify the Hostname in LinuxConclusion
To summarize, installing Git on Linux is a simple process. By following the provided steps, you can easily set up Git, update your system, and configure your user information. You are now ready to use Git’s sophisticated version control capabilities for your software development projects after successfully installing it.
You're reading How To Install Git On Linux
Chromebooks are capable web-focused PCs, and a great choice for anyone who needs a laptop for travel or working outside the office. Thanks to a wide variety of fully featured web apps—some of which work offline—a Chromebook can cover many of the same use cases as a regular PC.
Chroot stands for “change root.” It’s a system utility in Unix and Linux environments that separates one set of running processes from another—in this case two different operating systems. You can alternate between the two on-the-fly—no reboot necessary.
Using a chroot is the easiest way to install Linux on a Chromebook thanks to a project called Crouton, and if you ever make a mistake, it’s easy to reset everything back to normal.First things first
Before you can install Linux on a Chromebook you have to put the machine in developer mode. Like other modern PCs, Chromebooks are locked down to prevent malicious code from running—Google calls its security mechanism “OS verification.” This means you’ll be introducing a certain degree of insecurity to your machine by installing Linux. For a detailed breakdown of the risks check out the Crouton wiki.
Moving to developer mode will also wipe your Chromebook’s hard drive of everything but the operating system. Any personal files will be deleted. If you have files saved locally on your Chromebook, move them to the cloud or copy them to a USB drive before continuing.
Once you’re ready, hold down the Escape and Refresh keys on your Chromebook’s keyboard and then press the power button.
Ian Paul/PCWorld Ian Paul/PCWorld
Now another screen appears asking you to confirm that you want to turn off OS verification. Press Enter to confirm, and wait.
Next, the Chromebook will reboot and you’ll see a new warning screen that says OS verification is off. Get used to this screen. It will appear every time you boot up your Chromebook. The warning is there to protect novice users in case a device has been tampered with. A quick tap of the space bar resets the Chromebook with OS verification turned on. That’s not what we want. To get past this screen without blowing out developer mode, press Ctrl + D.Installing Crouton
Now it’s time to get your Crouton on. If you’re wondering what Crouton stands for, the developers say it stands for “ChRomium Os Universal chrooT envirONment…or something like that.”
First, you should encrypt your Linux desktop to keep it secure. You also need to decide which desktop you’re going to use with Crouton. The suggested desktop is XFCE since that environment is small in size and won’t be too demanding on a Chromebook processor. In my tests on an Acer Chromebook 14 with a quad-core 1.6GHz processor and 4GB RAM, however, Ubuntu’s default Unity interface worked just fine. Another otpion for anyone who’s feeling hardcore is to install the command-line version of Linux with no graphical interface at all.
Here’s how this command breaks down:
sudo provides temporary super user privileges to carry out a command
sh says you want to use an sh command language interpreter
-e tells Crouton you want to encrypt your Linux install. This will also require you to set a Chromium OS shell password
-t tells Crouton you are about to specify which desktop you want installed
unity tells Crouton to install the Unity desktop
Once you’ve told Crouton what to install, the command line will get to work installing Linux. In my tests, the process took about 30 to 40 minutes. During the installation process you’ll be asked for three different passwords: one to set the root password for your Chromebook, an encryption password for the Linux install, and a username and password for your Ubuntu user account. Make sure to use strong, random passwords to keep your data safe.
Once the installation is done, you can enter your Linux build by typing the shell command sudo startunity or sudo startcli depending on which Linux desktop you installed. To open Linux after a reboot, enter Chrome OS, tap Ctrl + T to open a Crosh shell, type shell, hit Enter, and then type one of the commands above based on what you’ve installed.
If you ever want to erase a Linux installation type: sudo delete-chroot [name of your chroot such as unity]
There are several reasons a Linux user would want to create a Windows virtual machine, and VirtualBox is easily one of the most popular hypervisors available for Linux. It’s simple to use, easily accessible, and extremely flexible in what it allows you to do with your virtual machines. In this guide, you’ll learn how to install Windows in VirtualBox in Linux.
Tip: other than Windows, you can also install macOS in Virtualbox.Installing VirtualBox
There are two ways to install VirtualBox in Linux. The first is to go to the website and download whichever package works for your system. Follow the steps below:
Follow the download prompts, and the package installer should automatically install the package.
However, there are some challenges with that. Generally, just installing the RPM or DEB will miss building the kernel modules necessary, which can bring up many errors. The way to get around that is to install VirtualBox from your distro’s repository. This is usually a simple command to install, depending on your distribution.
For Ubuntu and its derivatives:
installvirtualbox virtualbox-guest-additions-iso Downloading Windows 11
For those who may not be aware, Windows 11 is actually free to download and use. You can’t use it in a production environment without paying for it, but if it’s purely for personal purposes, it’s fair game.
Download Windows 11 by going to Microsoft’s Windows Download page.
Tip: aside from installing Windows from an ISO, you can also download an official VM image for Windows that comes already configured for VirtualBox.
Note: the download may take a while, especially on a slow network connection, as the ISO image is almost 5GB in size.
Do you know: other than VirtualBox, you can also install Windows 11 in Raspberry Pi.Creating the Windows 11 Virtual Machine
Type “Windows 11” in the “Name” section. That will automatically choose the “Version” to “Windows 11 (64-bit).” From there, name it anything you want.
Go to the “Username and Password” group and write the credentials you want for your Windows 11 account.
Go to the “Additional Options” group. Change the values in both the “Hostname” and “Domain Name” textboxes. For this, you can write any value that you want as long as the Domain Name is two characters long.
Go through the menu and set whatever you’d like for the configuration of the virtual machine. I’d recommend at least 4096MB memory and creating a 60GB virtual disk.
After you are done creating your virtual machine, VirtualBox will automatically start and install Windows 11 in the background.
Once Windows is installed, you may notice that it’s complaining about inadequate video drivers and that you’re limited to a very small screen. To fix all that, you will need to install VirtualBox Guest Additions.Installing VirtualBox Guest Additions in Windows
You can choose to reboot now or do it later.
With that done, the Guest Additions are installed, and you can experience true 3D acceleration, screen size selection, and many of the other great benefits that come with using VirtualBox Guest Additions, like shared clipboards and file sharing from Host to Guest and back.
Note that the VM is now full screen.
Tip: learn how to share USB and network devices in VirtualBox.Transferring Files from Linux to Windows 11
Another benefit of enabling VirtualBox Guest Additions is that it allows you to seamlessly transfer files between your host Linux machine and Windows 11. This can be helpful if you are using your VM for data processing and need a way to push and pull files from your guest operating system. To get started, follow the steps below:
Creating a Permanent Shared Folder in VirtualBox
While using the File Manager utility allows you to transfer files from your host to your guest OS, there are instances where you might need a more permanent channel between them. To this end, VirtualBox provides a “Shared Folder” feature, which is used to create a link between your two machines.
Select the folder that you want to use in your host OS from the File Picker menu.
Good to know: while a Share Folder allows you to back up files inside your VM, you can also make an OVA file in VirtualBox, which will create a reproducible image that you can reinstall at anytime.Frequently Asked Questions Why does my Windows 11 VM keep crashing on startup?
While this can be due to a number of issues, the most common cause for this is a BIOS setting that disabled your machine’s virtualization features. To fix this issue, go into your system’s BIOS and enable any setting that contains either an Intel VT-x/VT-d or AMD-V.How do I fix my VM, as it’s slow and sluggish when running?
This is most likely due to a lack of available system resources in your host machine. As such, you can fix this by making sure that VirtualBox is the only heavy program that is running whenever you boot a guest operating system.Why am I getting a UEFI Shell whenever I boot my Windows 11 ISO?
This happens whenever VirtualBox tries to load a guest operating system using UEFI. By default, VirtualBox only uses UEFI as a fallback mode for pickier operating systems and will not boot Windows 11 under UEFI.
Image credit: Unsplash. All alterations and screenshots by Ramces Red.
Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox
Sign up for all newsletters.
If you’re a longtime Linux user, you likely recall how difficult installing new applications could be. Unless it was included with the installer, you usually needed to go through the configure, make, make install process, usually hunting down missing dependencies along the way. Package managers like apt and yum made this much more manageable, but dependencies could still bite you.
You may have heard of Snap, which claims to fix many of these problems. You might have also heard that it’s an Ubuntu-only thing, but fortunately, that’s not true.What Are Snap Applications?
Snap applications, known as “snaps,” are meant to be distribution-agnostic, so ideally they should run the same no matter which system they run on. To achieve this, most of the dependencies and runtimes an application needs in order to run are bundled into the snap. This means that once you have snap set up and running on your system, adding applications that would otherwise need several dependencies is now much easier.
Snap is backed by Canonical, which is why it is often mentioned around Ubuntu, but it is meant to run on any major Linux distribution. Arch is even an officially supported distribution, so snap is a great way to run apps that aren’t packaged for Arch.Installing the snapd Daemon
In order to install snaps on your system, you’ll need the snapd daemon installed. While snap officially supports Arch, you’ll need to install it from the Arch User Repository (AUR). Fortunately, this is easy to do using the yaourt tool.
First, install snapd by running the following command:yaourt
Now you need to enable the service to run. To do this, simply type the following command:systemctl
--nowsnapd.socket Installing Snap Applications
Now that you have snap installed, you can use it to install packages as you would any other package manager. For example, to install a particular application using snap, just run the following:snap
To list the snaps available on your system, run the following:snap list
To search for a package, you can query whether it is available by typing the following:snap
Finally, to remove a package, simply run this:snap remove application-name Other Snap Tips and Tricks
Snap applications are automatically kept up to date by default, but to manually update all applications, run the following:snap refresh
Some snaps don’t use the traditional path, which is “/var/lib/snapd/snap.” Instead, they install to “/snap.” In order to support installing these “classic snaps,” simply create a symbolic link with the following command:
Now you’ll be able to install and run these applications, but they’ll be installed alongside all your other snaps. It’s the best of both worlds and also happens to be compliant with the Filesystem Hierarchy Standard.Conclusion
Snap isn’t the only technology of its sort. Flatpak and AppImage are two similar package systems that aim to sort many of the same problems. That said, with Snap having the backing of Ubuntu, it seems to be the most popular of these formats, at least for now.
Does that mean it’s the best? A while ago, we took at look at Snap and Flatpak to see how they hold up against each other and to find out which one is the best.
Kris Wouk is a writer, musician, and whatever it’s called when someone makes videos for the web.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox
Sign up for all newsletters.
Linux users have the freedom to customize their system to fit their preferences, including the desktop theme and icons. There are many simple ways to create custom icons in Linux to change the look and feel of your system. We will discuss the following methods to use custom icons:
Finding and installing custom icons from trusted websites
Using the Tar Command for One User or System-Wide Usage
Modernize Xfce Desktop with Cool-Looking Icons
Install Paper Icon Theme in Linux Mint Cinnamon
Create App Shortcut on Ubuntu with GNOME DesktopFinding and Installing Custom Icons in Linux from Trusted Websites
There are many places online for users to download custom icon themes. Below are websites that are trusted by the Linux community.
Table of Contents
The source for almost all open source projects, including custom icons, is Github.
Gnome-look.org hosts high-quality Gnome-based icon themes.
The artwork sharing community, chúng tôi is known for the high-quality themes and icons created by its contributors
Users can download custom widgets from the official KDE store.
OpenDesktop.org is another trusted website for icon themes.
Your system’s file manager will create a folder automatically and put the contents of the archive inside it.
Enter the following command in terminal to create a hidden icon folder in your home directory:
Locate the downloaded icon theme, usually found in your download folder. Use the CD command below to get there.
To install the icon there, move it to the hidden icons directory you created.Using the Tar Command for One User or System-Wide Usage
Search for an icon theme from one of the trusted websites listed above. Below is a screenshot of a set of icons from openDesktop.org.
Download the icon set using the following tar command:
$ tar xJpf papirus-icon-theme-20230203.tar.xz
Next, move your extracted icon folder into place. If you are installing it for just one user, move it to:
Put the folder into the following location for a system-side installation:
Open a terminal and use one of the following commands depending upon the type of installation:
Select Themes or Appearance tab.
Find the option to select the icon theme you downloaded and select it to apply.Modernize Xfce Desktop with Cool-Looking Icons
Xfce is a popular desktop environment for Linux because it’s lightweight and runs on low resources. However, it looks and feels old.
Customizing themes and adding custom icons in Linux can spruce up the desktop and make it look more modern and fresh.
Go to chúng tôi to find and download an icon theme set you like (such as the one below), extract it, and put it in the .icons directory in your home directory.Install Paper Icon Theme in Linux Mint Cinnamon
There are two ways to install icon theme sets in Linux Mint. Downloading the icon theme and extracting it to the ~/.icons directory is discussed above.
Another way is to use a PPA (A Personal Package Archive). Below is a screenshot of a cool-looking icon set called Paper Icon Theme.
Open a terminal (Ctrl+Alt+T) and use the command below:
sudo add-apt-repository ppa:snwh/pulp
sudo apt-get update
sudo apt-get install paper-icon-theme
After installing the icon theme, from the Menu, go to Settings, then Themes.
Here you will see all the available icons. Select the set you want to use.Create App Shortcut on Ubuntu with GNOME Desktop
The instructions below will also work for any other distributions that use the GNOME desktop.
Classic desktop operating systems include icons on the screen such as the trash bin, the file manager, and application shortcuts.
While in Windows, many programs will ask if you want to create a desktop shortcut, Linux distributions do not.
Make sure you have the GNOME Tweak Tool Installed and enable the Show Icons option.
Look for the application icon and either drag and drop it onto the desktop or copy it from the .desktop file (Ctrl+C shortcut) and paste it on your desktop (Ctrl+V shortcut).
Instead of seeing a logo or icon for the application, you will see a text file with a warning that says: untrusted application launcher.
It is possible to fetch and pull remote repositories via Git Fetch and Git Pull, respectively. Several third-party websites host Git repos, like GitHub and BitBucket, for example.
Developers use remote repositories in order to collaborate with one another. When changes are made on the remote location, those changes are automatically cloned locally. Whenever local commits are made, remote commits are also updated.
Remote repositories that have been pushed are collected by Git Fetch and Git Pull. It is important to point out that despite this, their methods of working are different. There are a number of different purposes to these commands, so understanding them is important.
Understanding git is important before comparing git fetch to git pull.What is Git?
Using Git, small to large projects can track their changes over time. Developers can coordinate their work using Git. Our team members can track and collaborate simultaneously thanks to version control.
Git is the foundation for many Git services, such as GitHub and GitLab, but it is possible to use Git independently of these services. It is possible to use Git privately as well as publicly.What is Git Fetch?
It’s a command that lets you retrieve updated files, and references remotely and store them locally. Fetch is the process of checking out what everyone else has been doing and what they have come up with. I would say that the main difference between it and SVN update is that you don’t have to update the central history; instead, it shows the progress of the central history over time. Regardless of what content you fetch, the work you’re doing locally won’t be affected by the content you’re getting; it’s isolated from what you’ve already got locally. You have to use git checkout to manually check out the content. Therefore, the fetch process is a great way to make sure that you can check commits before they are incorporated into the repository locally in a secure manner.What is Git Pull?
Using this command, you can retrieve files and references that have been updated remotely, and store them locally on your computer. Local branches are updated as soon as remote-tracking branches are added to them. Branching can be done remotely anytime, while tracking branches can be pushed and pulled remotely. As a general rule, you can think of it as a mixture of fetching and merging. When the changes are fetched from the remote repository and it wants to apply them to it immediately as soon as possible, it first combines them with those changes in the local repository before applying the changes to the remote repository, in order to be able to apply them as soon as they are fetched from the remote repository.Difference between Git Fetch and Git Pull
There is a difference between Git Fetch and Git Pull. Below is a table summarizing their main differences.
In the pull method, new commits are pulled/downloaded from the remote and merged with the content there.
When it comes to remote repositories, content can be copied or downloaded using this.
Branches tracked remotely are synchronized locally.
Branches that are tracked remotely are updated, but local branches are not.
Merge conflicts happen when local and remote updates mix.
Conflicts cannot arise during merge.
Revisions made remotely are pushed locally using Git Pull.
Fetching with Git lets you view remote repository changes without making any local changes.
Our branch after pulling will contain local commits as well as new commits from the remote repository.
As long as our local working branch remains intact, we can see the changes without having to update the remote-tracking branch.Conclusion
When it comes to interacting remotely, two of the most important things you need are git fetch and git pull.
In order to keep track of what changes have been made remotely, Git fetch can be used to check and review the changes made without having to modify the original file.
When we want to merge the latest remote changes into our local repo, we can use git pull.
Update the detailed information about How To Install Git On Linux on the Achiashop.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!