APT commands

From ALT Linux Wiki
Stub.png
Under construction.
This page is not finished yet and may lack substantial information.

apt-get commands

Update information about repositories

Initially need to get indexes, which contains actual sets of packages and links to it.

Note: This command need to run every time when:
  • you searching new version of package
  • you installing package
  • you upgrade installed packages
  • you use apt-cache


This running with next command:

# apt-get update

Example of running:

# apt-get update
Get:1 http://ftp.altlinux.org p10/branch/x86_64 release [4223B]
Get:2 http://ftp.altlinux.org p10/branch/x86_64-i586 release [1665B]
Get:3 http://ftp.altlinux.org p10/branch/noarch release [2844B]
Fetched 8732B in 0s (89.8kB/s)
Get:1 http://ftp.altlinux.org p10/branch/x86_64/classic pkglist [23.8MB]
Get:2 http://ftp.altlinux.org p10/branch/x86_64/classic release [137B]
Get:3 http://ftp.altlinux.org p10/branch/x86_64-i586/classic pkglist [17.4MB]
Get:4 http://ftp.altlinux.org p10/branch/x86_64-i586/classic release [142B]
Get:5 http://ftp.altlinux.org p10/branch/noarch/classic pkglist [7164kB]
Get:6 http://ftp.altlinux.org p10/branch/noarch/classic release [137B]
Reading Package Lists... Done
Building Dependency Tree... Done

After running of this command, apt will update own cache of new information.

System upgrade

Attention! In ALT Linux is not customary to partial system upgrade via apt-get upgrade! You can drop own system with using this command! You need use only apt-get dist-upgrade instead it.
Attention! Do not hurry to press ENTER or Y. Study carefully, what APT suggets to remove, replace, upgrade or install. Truly you accepted with his changes? Never don't add option -y for control of APT.


For upgrade system to actual condition (except kernel), use next command:

# apt-get dist-upgrade

Example of run:

Note: When for you need upgrade several packages, you need confirm action with enter Y
# apt-get dist-upgrade
Reading Package Lists... Done
Building Dependency Tree... Done
Calculating Upgrade... Done
The following packages will be upgraded
  firefox libnss
2 upgraded, 0 newly installed, 0 removed and 0 not upgraded.
Need to get 59.2MB of archives.
After unpacking 2888kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.altlinux.org p10/branch/x86_64/classic libnss 3.89.0-alt1:p10+319679.40.8.1@1684328466 [1290kB]
Get:2 http://ftp.altlinux.org p10/branch/x86_64/classic firefox 112.0.2-alt0.p10.1:p10+319679.140.8.2@1684342590 [57,9MB]
Fetched 59.2MB in 2s (20.6MB/s)
Committing changes...
Preparing...                                                    #################################################################################################### [100%]
Updating / installing...
1: libnss-3.89.0-alt1                                           #################################################################################################### [ 25%]
2: firefox-112.0.2-alt0.p10.1                                   #################################################################################################### [ 50%]
Cleaning up / removing... 
3: firefox-110.0.1-alt0.p10.1                                   #################################################################################################### [ 75%]
4: libnss-3.88.1-alt1                                           #################################################################################################### [100%]
Done.

Packages installation

Note: Don't forget before package installation to update packages list via command apt-get update

You can to install packages with using next command:

# apt-get install package_name

For example:

 # apt-get install chromium

The program will find and install all needed packages automatic.

Also, you can to indicate some or large number of packages via space, at once.

 # apt-get install firefox gimp vlc
Note: Note, when you install several packages, you need to confirm action with button Y


For example:

# apt-get install stellarium
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  libqt5-script qt5-script-common
The following NEW packages will be installed:
  libqt5-script qt5-script-common stellarium
0 upgraded, 3 newly installed, 0 removed and 0 not upgraded.
Need to get 212MB of archives.
After unpacking 338MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.altlinux.org p10/branch/noarch/classic qt5-script-common 5.15.11-alt1:p10+335121.1500.3.1@1703503918 [5910B]
Get:2 http://ftp.altlinux.org p10/branch/x86_64/classic libqt5-script 5.15.11-alt1:p10+335121.1500.3.1@1703503918 [867kB]
Get:3 http://ftp.altlinux.org p10/branch/x86_64/classic stellarium 0.21.0-alt1.1:sisyphus+279564.100.1.3@1626602684 [212MB]
Fetched 212MB in 30s (6953kB/s)                                                                                                                                                  
Committing changes...
Preparing...                                                           #################################################################################################### [100%]
Updating / installing...
1: qt5-script-common-5.15.11-alt1                                      #################################################################################################### [ 33%]
2: libqt5-script-5.15.11-alt1                                          #################################################################################################### [ 67%]
3: stellarium-0.21.0-alt1.1                                            #################################################################################################### [100%]
Done.

Additional variants

  • Package installation from file system:
# apt-get install /home/user/Downloads/whois-5.5.0-alt1.x86_64.rpm
  • Package installation from its URLL:
# apt-get install http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/files/x86_64/RPMS/whois-5.5.0-alt1.x86_64.rpm
  • Package installation by name of exec file or library:
# apt-get install /usr/bin/whois