TL;DR: there is a lot of gray areas and it depends on what you're doing. Mostly, Software Center and command-line methods do similar things when it comes to
.deb packages, but other software packages may require different steps.
What's the difference between installing a software in Ubuntu software
center and command line?
Here's the reality: installation is nothing more than throwing the files that come with software package into appropriate directories. It doesn't matter if it's done via command line or via Software Center - they do the same thing - throws the files into their respective directories. What matters, however, is the package and how you handle it. Here I'll go over some of the basic packages that you can deal with on Ubuntu. As for the difference between command-line and Software Center, the most basic difference is that in Software Center you click buttons; in command-line you type in commands. I know Software Center uses a lot of python code, but in command-line it depends on the utility you use. There's also amount of how much Software Center can remove ( read below about that )
The software packages for Ubuntu can come in three ways:
.run file, and just raw source-code in compressed
tar archive. Depending on which one you're dealing with, command line installation can be more or less painful. This is not something you as new user should really worry about, at least not in the first year of using Linux.
You will see mostly
.deb files - they are pre-compiled packages of software, ready for use. These are less painful. They also very often specify dependencies - other software without which your program won't run. Command line utilities such as
apt-get will install dependencies automatically for you. In fact, Software Center uses
apt-get as back-end , so it also installs dependencies automatically.
.run files are typically proprietary and encoded binary files. You can't really see what they're doing.
With raw source code, you have to do everything yourself - build software and install dependencies.
There is also ways to install packages from other distros, like
.rpm packages, but this is done very very rarely.
There also exists a class of software known as containers. There is docker and
lxd containers. As of recently, Ubuntu has introduced something known as
snap packages. What is good about all those ? They can run anywhere , securely isolated from your main system, and can be installed/reinstalled quite quickly. These types of software are not installable via Software Center and generally for professional system administrators or techie/advanced users. As new user you don't have to worry about those, just be aware that they exist and they're awesome :)
Finally, something like a script ( and typically a single file ) can also be considered an application and again - installation is nothing more than throwing that file where it belongs or supposed to belong.
Why some software I installed with command line can't be searched in
software center(press the window key)?
Again, this really depends on the package. If the developers of the software decided to include
.desktop file with their package, you will be able to search it in the Dash.
.desktop files are sort of like Windows shortcuts,although they do much much more. Good example of command-line utility that comes with
.desktop file is Byobu - a very handy program for splitting terminal into extra tabs/windows.
You can , however, create your own
.desktop file for each program and place it into
Again, this has nothing to do with app being command-line or GUI. It depends on choices app developers make
What are the correct commands to install a software from command line
so that I can search them?
Again,depends on what you're doing. If you are installing software from official Ubuntu repositories, then you can simply do
sudo apt-get install my-software
If you're installing a
.deb package, you may use either
dpkg command or
apt-get. Here's example of me installing google-chrome deb package with apt-get. NOTE: at the moment of installation i am in the same directory as
.deb file, therefore have to specify
$ sudo apt-get install ./google-chrome-stable_current_amd64.deb
[sudo] password for xieerqi:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'google-chrome-stable' instead of './google-chrome-stable_current_amd64.deb'
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 54 not upgraded.
Need to get 0 B/50.0 MB of archives.
After this operation, 190 MB of additional disk space will be used.
Get:1 /home/xieerqi/下载/google-chrome-stable_current_amd64.deb google-chrome-stable amd64 53.0.2785.101-1 [50.0 MB]
Selecting previously unselected package google-chrome-stable.
(Reading database ... 476104 files and directories currently installed.)
Preparing to unpack .../google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (53.0.2785.101-1) ...
Processing triggers for menu (2.1.47ubuntu1) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160701-0ubuntu1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up google-chrome-stable (53.0.2785.101-1) ...
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/google-chrome (google-chrome) in auto mode
Processing triggers for menu (2.1.47ubuntu1) .
What is nice about
apt-get ? It has
--purge option, which allow you to remove everything related to a program. For example, if I just remove it with
sudo apt-get remove google-chrome-stable or do it via Software Center, it may leave behind config files, so that when you reinstall the software, it's ready for use like before.
--purge option will delete the config files,too. That's convenient if your software broke and you want completely fresh installation of it. Software Center doesn't do that, so that's another difference.
If you are dealing with
.run file, you will need to make that file executable and run it. Like this:
$ sudo chmod +x ./software.run
$ sudo ./software.run
I backed and restored up my system once but some commands worked
before (like "subl") don't work after restoring the system.
It depends on type of backup you did. If your backup included all the files that are necessary to make
subl to work, then it should have worked. It also could be that your backup occured before
subl was installed. Ensure you configured your backup properly
I think these questions are about $PATH somehow but I can't find some
material about this. Any extra material would be appreciated.
$PATH variable is relevant to shell ( the command interpreter where you put commands ). It is not really relevant to Unity Dash.
$PATH variable is really list of directories ,where shell will search for programs that have executable permission set. Dash is really concerned with
.desktop files only. For example, I can have a program sit in
/usr/bin folder and be able to open it via command line but Dash will not, because there is no corresponding
.desktop file for it.
If you want to find extra material about
$PATH, literally pick up any book about Linux shell scripting. It's one of the foundation knowledge items for any Linux user who wants to use command-line.
Some closing thoughts: The complexity of software installation for Linux may sometimes be shocking to new users who come from Windows or Mac world. In reality, it's the same principles - throw everything where it belongs, and it will work. You don't find shortcut to your program ? Make one - it's just a text file ! Computers are machines, and they're meant to be operated. Windows also has
%PATH% variable for its command-line, you just never knew about it, because Windows command-line is less versatile and less used than on Linux. In short, don't be intimidated by everything you may see,because on day to day basis it's all about 20% of most frequently used commands or actions, and they give you 80% of work done.