Linux command + shell script collection: install software packages with aptitude

Recommended free tutorials: Python, C++, Java, JS, Rust, Go Language Introduction Complete Manual (6 in 1).zip-Python Documentation Resources-CSDN Download

After knowing how to list package information in the system, this section will take you step by step to learn how to install packages. First,
determine the name of the package to be installed. How can I find a specific package? Use the aptitude command to add the search option.
aptitude search package_name
The beauty of the search option is that you don't need to put wildcards around package_name. Wildcards are added implicitly. The following is
an example of using aptitude to find wine packages

$
$ aptitude search wine
p gnome-wine-icon-theme - red variation of the GNOME- ...
v libkwineffects1-api -
p libkwineffects1a - library used by effects...
p q4wine - Qt4 GUI for wine (W.I.N.E)
p shiki-wine-theme - red variation of the Shiki- ...
p wine - Microsoft Windows Compatibility ...
p wine-dev - Microsoft Windows Compatibility ...
p wine-gecko - Microsoft Windows Compatibility ...
p wine1.0 - Microsoft Windows Compatibility ...
p wine1.0-dev - Microsoft Windows Compatibility ...
p wine1.0-gecko - Microsoft Windows Compatibility ...
p wine1.2 - Microsoft Windows Compatibility ...
p wine1.2-dbg - Microsoft Windows Compatibility ...
p wine1.2-dev - Microsoft Windows Compatibility ...
p wine1.2-gecko - Microsoft Windows Compatibility ...
p winefish - LaTeX Editor based on Bluefish
$

Note that there is a p or i before each package name. If you see an i, the package is now installed
on your system. If you see a p or v, the package is available but not yet installed. We can see in the above list
that wine is not installed in the system, but the package can be found in the software repository.
Installing packages from repositories on your system is very simple with aptitude.
aptitude install package_name
Once a package name has been found via the search option, just insert it into the aptitude command via the install option.

$
$ sudo aptitude install wine
The following NEW packages will be installed:
cabextract{a} esound-clients{a} esound-common{a} gnome-exe-thumbnailer
{a}
icoutils{a} imagemagick{a} libaudio2{a} libaudiofile0{a} libcdt4{a}
libesd0{a} libgraph4{a} libgvc5{a} libilmbase6{a} libmagickcore3-extra
{a}
libmpg123-0{a} libnetpbm10{a} libopenal1{a} libopenexr6{a}
libpathplan4{a} libxdot4{a} netpbm{a} ttf-mscorefonts-installer{a}
ttf-symbol-replacement{a} winbind{a} wine wine1.2{a} wine1.2-gecko{a}
0 packages upgraded, 27 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/27.6MB of archives. After unpacking 121MB will be used.
Do you want to continue? [Y/n/?] Y
Preconfiguring packages ...
[...]
All done, no errors.
All fonts downloaded and installed.
Updating fontconfig cache for /usr/share/fonts/truetype/msttcorefonts
Setting up winbind (2:3.5.4~dfsg-1ubuntu7) ...
* Starting the Winbind daemon winbind
[ OK ]
Setting up wine (1.2-0ubuntu5) ...
Setting up gnome-exe-thumbnailer (0.6-0ubuntu1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
$

Note that in the above example, the sudo command appeared before the aptitude command. The sudo command allows you
to run a command as the root user. You can use the sudo command to perform administrative tasks, such as installing software.
To check if the installation process worked, just use the search option again. This time you should see
iu appear in the wine package, which means it is installed.
You may also notice that some of the other packages here also have iu in front of them. This is because aptitude automatically resolves the necessary
package dependencies and installs additional libraries and packages that are needed. This is a very nice feature that many package management systems have.

Recommended free tutorials: Python, C++, Java, JS, Rust, Go Language Introduction Complete Manual (6 in 1).zip-Python Documentation Resources-CSDN Download

Guess you like

Origin blog.csdn.net/tysonchiu/article/details/125873553