Lecture http://enos.itcollege.ee/~edmund/osadmin/eng/software-management/software-management.pdf https://wiki.ubuntu.com/SoftwareHandling https://wiki.ubuntu.com/SoftwareUpdates http://askubuntu.com/questions/546363/software-updater-software-updates-not-working https://help.ubuntu.com/community/AptGet/Howto There is always useful switch to superuser with before managing software, then you do not need use sudo on each command: sudo -i In Ubuntu usually both apt and apt-get can be used. On (older) Debian systems you may still need apt-get. Apt is a wrapper around apt-get and gives some different parameters and more colorful feedback. You can also use some aliases to facilitate software management: sudo wget -O /root/.bash_aliases http://enos.itcollege.ee/~edmund/materials/bash/bash_aliases_root.txt wget -O ~/.bash_aliases http://enos.itcollege.ee/~edmund/materials/bash/bash_aliases_user.txt after downloading bash aliases also run that file or reopen terminal or relogin: source ~/.bash_aliases Update databases and signatures: apt update apt-get update database will be downloaded to /var/lib/apt/lists/ folder - there are also signatures Repositories: /etc/apt/sources.list /etc/apt/sources.list.d/*.list Full system upgrade apt-get update && apt-get dist-upgrade apt update && apt full-upgrade apt update; apt full-upgrade Configure automatic upgrades: /etc/apt/apt.conf.d/ 10periodic 20auto-upgrades 50unattended-upgrades Newest mainline kernel ---------------------- https://www.kernel.org/ - latest stable Ubuntu manual kernel repository: http://kernel.ubuntu.com/~kernel-ppa/mainline/ nano /root/kernel.sh #!/bin/sh # # make directory mkdir ~/kernel && cd ~/kernel # # download kernel packages wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.9/linux-headers-4.10.9-041009_4.10.9-041009.201704080516_all.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.9/linux-headers-4.10.9-041009-generic_4.10.9-041009.201704080516_amd64.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10.9/linux-image-4.10.9-041009-generic_4.10.9-041009.201704080516_amd64.deb # # installation: sudo dpkg -i *.deb # # after upgrading kernel: sudo update-grub sh /root/kernel.sh quick network conf: /etc/network/interfaces auto enp0s8 iface enp0s8 inet static address xxx.xxx.xxx.xxx/24 broadcast xxx.xxx.xxx.255 network xxx.xxx.xxx.0 Search the software package --------------------------- You do not need to know the exact name of the package apt search name apt-cache search name There is also possible search packages online: Ubuntu packages http://packages.ubuntu.com/ Debian packages http://packages.debian.org/ In Ubuntu there are PPA - Personal Package Archive Search from PPAs: https://launchpad.net/ubuntu/+ppas or search from Internet: program-name PPA Filtering: apt search ssh | grep blacklist Installing sudo apt install package1 package2 package* Empty APT cache (/var/cache/apt/archives/): sudo apt-get clean http://askubuntu.com/questions/285691/is-it-possible-to-clean-the-apt-cache-from-the-command-line Who haven't installed yet a OpenSSH server then this can be done by using following commands: sudo apt update && sudo apt install ssh openssh-blacklist* && sudo apt-get clean Package removal sudo apt remove package Package full removal (with configuration files) sudo apt purge package # # # More information status: dpkg -s nano search for a filename from installed packages dpkg -S nano list files installed to your system: dpkg -L nano even more information: man dpkg # # # http://askubuntu.com/questions/17823/how-to-list-all-installed-packages Ubuntu 14.04 and newer ----------------------- all installed packages: apt list --installed exact package: apt list --installed | grep name Older Ubuntu: ------------------------ all installed packages: dpkg --get-selections | grep -v deinstall exact package: dpkg --get-selections | grep name To get just the packages which were expressly installed (not just installed as dependencies), you can run aptitude search '~i!~M' when needed, install aptitude (similar to graphical Synaptic): sudo apt update && sudo apt install aptitude exact package: aptitude search '~i!~M' | grep name man aptitude -> see: search Same software to another computer --------------------------------- NB! Before answering y it is worth to pay attention what will happen! When there will be removed important packages then it would be good to stop and investigate reasons. 1. create a list of packages in source machine apt list --installed > /path/installed.txt 2. in target machine sudo dpkg --clear-selections && sudo dpkg --set-selections < /path/installed.txt && sudo apt-get -u dselect-upgrade More options: apt-mark showmanual > list-installed.txt dpkg -l | grep ^ii | sed 's_ _\t_g' | cut -f 2 > installed-pkgs # # # Repository does not respond http://askubuntu.com/questions/141513/how-to-lower-wait-time-for-repository-updates mirror method (can be slow!) http://askubuntu.com/questions/37753/how-can-i-get-apt-to-use-a-mirror-close-to-me-or-choose-a-faster-mirror https://notblog.org/faster-updates-with-apt-fast/ apt-select https://github.com/jblakeman/apt-select https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure # # # Newest Firefox, Thunderbird, Seamonkey - https://help.ubuntu.com/community/FirefoxNewVersion/MozillaBuilds GUI for server - http://askubuntu.com/questions/2093/how-to-install-gui-desktop-on-a-server # # # Ubuntu release upgrade ---------------------- update databases and install updates: sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade begin release upgrade: sudo apt-get install update-manager-core sudo do-release-upgrade Desktop upgrade http://www.ubuntu.com/download/desktop/upgrade https://help.ubuntu.com/community/Upgrades https://help.ubuntu.com/community/UpgradeNotes http://askubuntu.com/questions/766754/upgrading-from-ubuntu-14-04-to-16-04 https://sites.google.com/site/easylinuxtipsproject/upgrade http://askubuntu.com/questions/5763/upgrading-from-the-command-line Running sudo do-release-upgrade -d ... over GNU Screen will turn off SSH and close default port and new will be opened and also announced $ ssh USER@HOST $ screen -S upgrade $ sudo do-release-upgrade -d in new terminal on desktop machine (replace with appropriate data): $ ssh -p PORT USER@HOST $ screen -d $ screen -r upgrade