How to use apt-get to install programs in ubuntu from the command line
- September 2015
- July 2015
- June 2015
- May 2015
- November 2014
- avatar
- buddypress
- CSS
- HTML
- JS
- LiveReload
- members
- Motherboard
- notification
- RAM
- SATA
- Skype
- SPEED
- Trip
- Ubuntu
- Uncategorized
- Woocommerce
- WordPress
- September 2015
- July 2015
- June 2015
- May 2015
- November 2014
- avatar
- buddypress
- CSS
- HTML
- JS
- LiveReload
- members
- Motherboard
- notification
- RAM
- SATA
- Skype
- SPEED
- Trip
- Ubuntu
- Uncategorized
- Woocommerce
- WordPress
WordPress Developer
LiveReload is a handy tool for web-developers. Do you not use Dreamweaver alternatives for linux, or any other web development tools? If you make use of text editors to code and web browsers to preview the result, then you must be tired of constantly hitting the save button on your text editor as well as that reload button on your web browser.
Why LiveReload?
LiveReload is here to your rescue. What it does is, it monitors for changes in the file system (a folder that you specify) and then automatically reloads the browser if any change is detected. Also, when you change a CSS file or image, the browser is updated instantly without even reloading the page.
How to Install LiveReload on Ubuntu?
Installing LiveReload is a pretty straightforward process in Windows, Mac and on Linux too (somewhat different though). In order to install LiveReload on Ubuntu, hit the following commands on your terminal one after another:
sudo apt-get install ruby-dev
sudo gem install rdoc -V
sudo gem install guard -V
sudo gem install guard-livereload -V
Here, we are installing rubygems, guard and finally guard-livereload.
When you are done with that, create a new file named .Guardfile in your home directory. Put the following in the file and save it.
This will watch the directories (that we’re working on) for the changes in css, js, and html files inside them (or in their subdirectories).
Now, what you need to do next is grab LiveReload extension for your web-browser. It is this extension that refreshes the page after receiving command from guard-livereload app. Extensions are available for Chrome, Firefox and Safari.
Once you have it installed on your browser, bring up your terminal and browse to the directory where your web files (html, css, js) are located. Then type guard and press enter. You should receive the following message.
Open up the HTML file on your browser, and press on the LiveReload button (which is located in the main toolbar in Chrome and Safari & in the add-on toolbar in Firefox). The LiveReload button should now be active.
Leave the terminal as it is. Just go on making changes to your site and when you save the file, the changes will be reflected immediately on the browser. No need to press on reload button anymore.
Ubuntu is one of the most customizable operating systems available. In order to begin to understand the various complexities of the system, you need to become familiar with the most basic commands at your disposal. In this tutorial, we will introduce you to some of the everyday commands used on the operating system. These commands will help you as you interact with the Linux interface and try understand how to use its flexible operating system.
List of Beginner Ubuntu Commands
mv: Short for move, this command can be used to move your files from one folder to another.
rm: Short for remove, this command is used to remove any files or folders.
cd: Short for change, you can use this command to change your current directory.
cp: Short for copy, this command can be used to copy files or folders in a directory.
chown: This command is used to change ownership of a file.
chmod: This command is used to change permissions on a file.
ls: Short for list, this command can be used to view all of the files and folders in your current working directory.
pwd: Short for print working directory, this command can be used to display the directory in which you are currently working.
sudo: Also referred to as superuser do, a sudo command allows you to run other commands with administrative privileges. This command is especially useful for modifying files in a directory that a user wouldn’t necessarily have access to.
cd: Short for change directory, this command can be used to change the directory in which you are currently working. There are a variety of cd commands that can be used to take you to specific files or folders.
cd / : An alternate to a basic cd command, the cd / command can be used to take you to the root directory.
cd .. : This command can be used to take you up one directory level.
cd – : This command can be used to navigate to a previous directory.
When you initially start using the Ubuntu operating system, the graphical Ubuntu Applications manager is your first choice for installing software. Despite the fact that this collection contains a large number of applications, you will quickly discover that it lacks many strong tools, particularly those for the command line. Then it’s time to move to apt-get, a more capable software installation tool. You may use this tool to not only install software from the command line, but also to:
- Update the package repositories
- Update installed software
- Search for available packages
- Get the source code for an installed package
- Reinstall a software package
- Remove a software from your system
In this post, we’ll show you how to use the apt-get tool to complete the tasks indicated above.
On an Ubuntu 20.04 LTS system, we ran the tools and processes described in this article. We’ll use the Ubuntu Terminal to run apt-get because it’s a command-line utility. The Terminal may be accessed using the system Dash or the Ctrl alt T shortcut.
Update the Package Repositories with apt
A repository is a catalog of software programs that are available at a specific point in time. Because the packages in this list are added, deleted, and changed on a regular basis, you should keep your system repositories up to date. This will provide you with an up-to-date list of all the repository’s accessible software packages.
Before installing new software, it’s a good idea to update the repositories by executing the following command as root:
Now your system repositories are in-line with those on the Internet.
Update Installed Software with apt
Although you can use the update manager in order to update installed software on your system. The apt-get utility also provides a way to do the same. Use the following command as root in order to upgrade software on your system:
Now the software on your system is up to date.
Search for Available Packages with apt
In order to search for available packages from the Internet repositories, you can use the apt-cache utility. Use the following syntax to do so:
$ sudo apt-cache search [package name keyword]
Let us search for the stable version of the Opera web browser through the following apt-cache command:
The following output shows the availability of вЂopera-stable’ package for the web browser.
You can get detailed information about the package through the following apt-cache command:
$ sudo apt-cache show “package-name”
The following output shows detailed about the вЂopera-stable’ package:
Install a Package with apt
Here comes the most famous use of the apt-get command; installing software from an updated repository.
Use the following command as root in order to install a software package:
$ sudo apt-get install “package-name”
You can install the stable version of the Opera web browser by installing the package, that we searched above, as follows:
The system prompts you with a y/n solution before installing a program through the apt-get utility. Always enter Y to proceed with the installation.
Get the Source Code for an Installed Package with apt
If you want the source code for an installed package, you can use the following command :
$ sudo apt-get source “package-name”
For example, if I want to get the source code of the opera-stable package that I just installed, I will use the following command:
If you get this error after running the above command:
E: You must put some вЂsource’ URIs in your sources.list
You need to remove the commenting from the deb-src line for the respective package from the sources.list file. This file is located in /etc/apt/ folder.
You can open the sources file in the nano editor through the following command:
Press Ctrl X and then Y for exiting and then saving the changes.
Reinstall a Software Package with apt
While running an application, it might stop working or go corrupt. In that case, you can easily reinstall that application through the apt-get command as follows:
$ sudo apt-get install “package-name” –reinstall
This command will re-install the Opera browser that was already installed on my system.
Remove a Software from Your System
When you want to remove a software from your system, you can use the following apt-get command:
$ sudo apt-get remove “package-name”
This command will remove the Opera web browser from my system
Remove Complete Software Configurations
The apt-get remove command removes the software from your system but it does not remove the configuration files that might have been installed with it. The following command will completely remove those configuration files for a software:
$ sudo apt-get purge “package-name”
This command will completely remove Opera configurations from my system.
When uninstalling or purging software, the system will provide you with a Y/n choice; always select Y to proceed with program removal.
We’ve shown how the apt-get command can be used to not only install software on your system but also to execute all installation-related activities in this article. You no longer have to rely exclusively on the Ubuntu Software Manager to install apps on your computer.
When you initially start using the Ubuntu operating system, the graphical Ubuntu Applications manager is your first choice for installing software. Despite the fact that this collection contains a large number of applications, you will quickly discover that it lacks many strong tools, particularly those for the command line. Then it’s time to move to apt-get, a more capable software installation tool. You may use this tool to not only install software from the command line, but also to:
- Update the package repositories
- Update installed software
- Search for available packages
- Get the source code for an installed package
- Reinstall a software package
- Remove a software from your system
In this post, we’ll show you how to use the apt-get tool to complete the tasks indicated above.
On an Ubuntu 20.04 LTS system, we ran the tools and processes described in this article. We’ll use the Ubuntu Terminal to run apt-get because it’s a command-line utility. The Terminal may be accessed using the system Dash or the Ctrl+alt+T shortcut.
Update the Package Repositories with apt
A repository is a catalog of software programs that are available at a specific point in time. Because the packages in this list are added, deleted, and changed on a regular basis, you should keep your system repositories up to date. This will provide you with an up-to-date list of all the repository’s accessible software packages.
Before installing new software, it’s a good idea to update the repositories by executing the following command as root:
Now your system repositories are in-line with those on the Internet.
Update Installed Software with apt
Although you can use the update manager in order to update installed software on your system. The apt-get utility also provides a way to do the same. Use the following command as root in order to upgrade software on your system:
Now the software on your system is up to date.
Search for Available Packages with apt
In order to search for available packages from the Internet repositories, you can use the apt-cache utility. Use the following syntax to do so:
$ sudo apt-cache search [package name keyword]
Let us search for the stable version of the Opera web browser through the following apt-cache command:
The following output shows the availability of ‘opera-stable’ package for the web browser.
You can get detailed information about the package through the following apt-cache command:
$ sudo apt-cache show “package-name”
The following output shows detailed about the ‘opera-stable’ package:
Install a Package with apt
Here comes the most famous use of the apt-get command; installing software from an updated repository.
Use the following command as root in order to install a software package:
$ sudo apt-get install “package-name”
You can install the stable version of the Opera web browser by installing the package, that we searched above, as follows:
The system prompts you with a y/n solution before installing a program through the apt-get utility. Always enter Y to proceed with the installation.
Get the Source Code for an Installed Package with apt
If you want the source code for an installed package, you can use the following command :
$ sudo apt-get source “package-name”
For example, if I want to get the source code of the opera-stable package that I just installed, I will use the following command:
If you get this error after running the above command:
E: You must put some ‘source’ URIs in your sources.list
You need to remove the commenting from the deb-src line for the respective package from the sources.list file. This file is located in /etc/apt/ folder.
You can open the sources file in the nano editor through the following command:
Press Ctrl+X and then Y for exiting and then saving the changes.
Reinstall a Software Package with apt
While running an application, it might stop working or go corrupt. In that case, you can easily reinstall that application through the apt-get command as follows:
$ sudo apt-get install “package-name” –reinstall
This command will re-install the Opera browser that was already installed on my system.
Remove a Software from Your System
When you want to remove a software from your system, you can use the following apt-get command:
$ sudo apt-get remove “package-name”
This command will remove the Opera web browser from my system
Remove Complete Software Configurations
The apt-get remove command removes the software from your system but it does not remove the configuration files that might have been installed with it. The following command will completely remove those configuration files for a software:
$ sudo apt-get purge “package-name”
This command will completely remove Opera configurations from my system.
When uninstalling or purging software, the system will provide you with a Y/n choice; always select Y to proceed with program removal.
We’ve shown how the apt-get command can be used to not only install software on your system but also to execute all installation-related activities in this article. You no longer have to rely exclusively on the Ubuntu Software Manager to install apps on your computer.
Karim Buzdar
About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn
If you are a Linux user, you might be well aware of the apt and apt-get commands with the most common option apt install. Apt is a powerful package management tool that can be used to search, install, update, upgrade, and manage the packages in a Linux operating system. It is a command-line-based tool that is preferred by most system administrators and users.
This article shows how to use the apt-get command for installing programs from the command line in Debian OS.
We have used Debian 10 OS for running the commands and procedure mentioned in this article. The same commands will work on Debian-based distributions like Ubuntu and its derivates as Kubuntu and Linux Mint too.
Using apt for installing programs
We will take the example of VLC player for installation using the apt-get command in the command line Terminal application. To open the Terminal, go to the Activities tab on the top left corner of the desktop. Then in the search bar, type terminal. When the Terminal icon appears, click on it to open.
Before installing the software, make sure you have the required software in the repositories of your OS. If it is not already present, you will have to add the additional repository to your sources.list.
Step 1: Add repository
Follow the below steps in order to add the repository to your system.
Enter the following command in Terminal to edit the “sources.list” file.
Now add the entries in the file using the following syntax:
For instance, in order to add the repository for VLC player, we have added the following entries:
Once done, press Ctrl+O to save and Ctrl+X to exit the nano editor.
Step 2: Update sources
Now after adding the repository, you will need to update your package list. To do so, enter the following command in Terminal:
When prompted for the password, enter the sudo password. Advertisement
Step 3: Install a package using apt-get using apt-get install
Now you can install the package from the updated repository. Use the following syntax in Terminal in order to install the packages using apt-get command:
You can use the above command to install just one package or multiple packages at once. Replace the package-name with your desired package name. If you do not remember the exact package name, just type initial letters and press tab to auto-complete them.
For instance, to install VLC player, the command would be:
apt install vs. apt-get install
The traditional way to install programs using apt is to use the command ‘apt-get’ with the install option. Nowadays, the short form is more and more used. So instead of using
$sudo apt-get install
you can also use just:
$sudo apt install
is just a placeholder for the .deb package name that you want to install. Multiple packages can be separated by white space.
Step 4: Verify installation
You can verify if the application is installed by viewing it in the list of all installed packages. To do so, run the following command in Terminal:
After installation, you can launch the application via Terminal or via the system application’s menu.
To make it easier to find the right package, combine the command with grep to search for the package name. Example:
with the name of the .dpkg package that you are searching for.
Use apt to upgrade packages
You can also upgrade the packages to their latest available versions using the apt-get command.
Use the following command syntax in order to upgrade the packages:
To upgrade all packages, you can use the following syntax:
Remove packages
In case you want to remove the installed packages using the apt-get command, you can do so by using the following syntax:
The system will provide you with Y/n option to confirm the removal process. Press y to continue and the package will be removed from the system. However, note that this will only remove the package but not the configuration files. In order to remove the configuration files too, use the following command:
In this article, we have learned the use of apt-get command for installing packages in a Debian system. Using the apt command line for installing and managing packages saves a lot of time. It also comes in handy when you are accessing and performing the installation on a remote system via SSH. There is also a guide on using apt on Ubuntu.
- ← 6 Ways to find your internal IP Address on Debian
- How to Change the Keyboard Layout in Ubuntu →
Karim Buzdar
About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn
Apt Get List Installed – step by step tutorial. Apt is a command-line interface that allows you to perform actions such as installing new software packages, removing unnecessary software packages, updating the existing software packages, searching for specific software packages etc. on a Linux VPS running Debian as an operating system or Debian-based Linux distributions like Ubuntu. In this tutorial, we will show you how to list all installed packages with apt on Ubuntu (show all installed software on your VPS).
Table of Contents
1. List the installed software packages on Ubuntu
First of all, connect to your Linux server via SSH. To list the installed software packages on your machine you can use the following command:
The output of the command will be very similar to the following one, depending on which packages are currently installed:
2. Use the LESS program
To easily read the entire output you can use the less program.
3. Use the GREP Command
You can look for a specific package through the output using the grep program.
4. List all packages that include Apache
The output from the above command will list all packages that include apache in their names.
Apt supports patterns to match package names and options to list installed (–installed) packages, upgradeable (–upgradeable) packages or all available (–all-versions) package versions.
5. Use the DPKG program
Another alternative that you can use to list the installed software packages on your Ubuntu VPS is the dpkg command.
The output of the command will provide you with information such as the name of the package, version, architecture and short description about the package. Of course, you can use the grep program again to search for a specific package.
The output should look like the one below:
With the competition of this tutorial, you have successfully learned how to list installed packages in Ubuntu.
If you’d like to list all installed packages on your CentOS VPS, then check our yum tutorial.
Of course, you don’t have to list all Installed packages with apt on Ubuntu if you use one of our Managed Linux Hosting services, in which case you can simply ask our expert Linux admins to List All Installed Packages with apt on Ubuntu and export it for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post, on How to List All Installed Packages with apt on Ubuntu, please share it with your friends on the social networks using the buttons below or simply leave a reply. Thanks.
Ubuntu is a Linux distribution and as they say, Linux is for geeks. Although Ubuntu makes it too easy on you by offering you really nice and cool ways to search and install software, there always is a more sophisticated way to search and install software, there always is a more sophisticated way to do it. To install software from the terminal, you should know the right commands to be used. Before installing the software however, you must get the updated list of software from the Ubuntu servers, at least once. Performing any software install using built in commands for package
management would require internet connection (except when you are removing them).
The most used command for installing software from the command line is ‘apt-get’.
To get the updated list of packages from the Ubuntu servers, run :
sudo apt-get update
This will make Ubuntu contact the servers and fetch the list of software packages and consider them the next time when installing software. So if it happens that someone says that a particular software or some specific version of it is available in the Ubuntu repos but your system does not agree, run an update. Remember however that an update is different from an upgrade. While an update gets only the list of software from the servers, an upgrade will actually get those packages and install them on the machine.If you wonder what the ‘sudo’ command does, it makes you the root user when you enter the command. If you do not use ‘Sudo’ in the begin
ning of the command, the command will fail because it requires admin privileges on machine to install software.
Installation of programs on Ubuntu is also a simple job. You just have to change the action for the apt-get and add in the package name of the software which you want to install.
To install gimp, for example, type this into the terminal:
sudo apt-get install gimp
The above command will automatically find out whether gimp is already installed or not. If it is installed, you will be notified. If it is not installed, apt-get will find out how much data it needs to download in form of software and dependency packages, how much space will it consume on disk after installation and then prompt you if you want to continue. If you think that it is fine to go with, just confirm and it will automatically download, install and update the menus to reflect the changes.
Now if you wonder what if the internet connection break down while downloading packages, let us tell you that you will have to type in the same command again to make Ubuntu complete the installation. Be not worried however because the download will resume exactly from the point where it broke down from.
Another question that would come up when installing software from command line is : How do i search for a particular software package? There is no search bar! Well, as a surprise to many, apt-get does not help you search for packages in Ubuntu repositories, but aptitude does. So install aptitude first.
sudo apt-get install aptitude
After aptitude gets installed, you can search for packages by using the command in format :
aptitude search
For example, if you wanted to install chromium but ‘apt-get install chromium’ is saying that the package name is incorrect, you should first search for the exact package name. Once you get to know the name, install the package using apt-get.
sudo apt-get install chromium-browser
Even if every graphical program is failing, you can make use of the terminal and install something new on the machine.
How to update your Ubuntu using terminal aka command line :
If you want to update your Ubuntu in terminal you need to remember a simple command line.
first you need to update the list of new updates available officially by Ubuntu. to do this type :
sudo apt-get update
it will refresh your Ubuntu update list with newly available updates. Then you need to finally run a command to update the system.
sudo apt-get upgrade
you will be asked a confirmation whether you want to update the system along with the information about how much data will be downloaded and what space it will consume on your HDD.
press ‘y’ if you want to update or type ‘n’ (without quote) if you don’t want to update Ubuntu at that time.
Note: when you enter password in terminal, it doesn’t show up like it does in GUI mode (the ” *** “) however the terminal is accepting your inputs it doesn’t show up any significant characters.
Ubuntu server installation, hard disk partition, basic commands, network configurations, Ubuntu administration and security guide for a beginner.
Ubuntu update command line
Here is a guide for Ubuntu update in command line. There are two two commands you need to run. The first command is sudo apt-get update command to scan for available packages to update from Ubuntu support. If the update found a security patch or software packages update, then you need to run the next command which is sudo apt-get upgrade to install the updates. You must have Internet connection to run the command.
Here are example of Ubuntu update in command line:
Running the apt-get upgrade command:
1 comment:
I’ve been running Fedora forever, so I know “yum” pretty well, and I’ve done plenty of Ubuntu desktop installs, but this is the first time I’ve actually tried to run Ubuntu server. I’m going to guess that administering it will be no more difficult than Fedora, but I’m sure there will be a bit of a learning curve. 🙁
Please keep comment relevant and strictly no spam will be tolerated. Thank you.
Linux server tutorials README!
Basic tutorials and user guides about Ubuntu server Linux. These tutorials are owner’s documentation based on Ubuntu server installed on VMware.
The tutorials and guides are owner’s own works and experiences. Owner is not a doctor or IT scientist, just someone who love to experienced new knowledge. There maybe errors and mistakes everywhere. Please correct it if you found one by leaving a comment.
Use user guides and information in this blog freely but it is your own responsibility if anything unintended happened. The owner of this blog should not be blamed or take any responsibility at any course.
COMMENT POLICY
Comments are moderated.
Spam will not be tolerated.
I am a new Ubuntu Linux server user. My server hosted at Google cloud VM. How do I see what packages are installed on Ubuntu Linux?
Introduction: Ubuntu Linux is an open source operating system based upon the Linux kernel and GNU command line utilities. Ubuntu Linux is extremely popular among new Linux users as well as developers all around the globe. This page shows how to list all installed packages with apt command or apt-get command on Ubuntu Linux.
| Tutorial details | |
|---|---|
| Difficulty level | Easy |
| Root privileges | Yes |
| Requirements | Debian or Ubuntu Linux |
| Est. reading time | 5 minutes |
You need to use the apt or apt-get or dpkg command to list all installed packages on an Ubuntu Linux server from the bash shell prompt.
How do I see what packages are installed on Ubuntu Linux?
The procedure to list what packages are installed on Ubuntu:
- Open the terminal application or log in to the remote server using ssh (e.g. ssh user @ sever-name )
- Run command apt list –installed to list all installed packages on Ubuntu
- To display a list of packages satisfying certain criteria such as show matching apache2 packages, run apt list apache
Let us see some examples,.
apt list installed packages
Let us list all software packages on Ubuntu Linux available for us:
$ apt list
You might want to use the grep command/egrep command to filter out:
$ apt list | grep nginx
OR
$ apt list | more
However, you may see message on screen that read as follows:
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
To avoid this message use the dpkg command as follows:
$ dpkg –list | grep nginx
$ dpkg –list | more
List all installed packages only
The apt command displays both installed and packages available to install. What if you want to list currently installed software only? Fear not, pass the option to the apt command:
$ apt list –installed
How to list or find out if a specific package installed or not
Run package policy as follows:
$ apt list -a pkgNameHere
Is sudo package installed?
$ apt list -a sudo
Is sudo package mariadb-server?
$ apt list -a mariadb-server
Ubuntu list installed packages
It is also possible to list installed packages matching given pattern. The syntax is:
dpkg -l pattern
dpkg –list pattern
apt list pattern
apt list –installed pattern
For example:
dpkg –list ‘x*’
Sample outputs:
- ii – Indicates that package named xauth installed.
- un – Indicates that package not installed or in Unknown status.
Listing installed packages sorted by installation date and time
There is no simple command, but we can use the combination of zgrep and other commands as follows. Let us count it:
Total installed packages on nixcraft-wks01 : 6433
List them:
zgrep ” installed ” /var/log/dpkg.log*
Please note that zgrep will search possibly compressed files for a regular expression as those log files are compressed by system. Hence, we need to use various z commands on Linux. See “How to find out when Debian or Ubuntu package installed or updated” for more info.
Conclusion
You learned how to list both installed and uninstalled packages on an Ubuntu Linux server or desktop using the CLI method. See the following man pages:
man apt
man apt-get
man dpkg
🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.
🐧 8 comments so far. add one ↓