Linux ubuntu apt update

Содержание
  1. Команда apt в Linux
  2. Обновление индекса пакета ( apt update )
  3. Обновление пакетов ( apt upgrade )
  4. Полное обновление ( apt full-upgrade )
  5. Установка пакетов ( apt install )
  6. Удаление пакетов ( apt remove )
  7. Удалить неиспользуемые пакеты ( apt autoremove )
  8. Листинг пакетов ( apt list )
  9. Поиск пакетов ( apt search )
  10. Информация о пакете ( apt show )
  11. Выводы
  12. Как обновить Ubuntu и приложения
  13. Есть два способа обновить систему Ubuntu:
  14. Способ 1: обновить Ubuntu через терминал
  15. Объяснение: sudo apt update
  16. Объяснение: sudo apt upgrade
  17. Способ 2: обновить Ubuntu через графический интерфейс [для пользователей настольных компьютеров]
  18. Несколько вещей, которые нужно иметь в виду, обновляя Ubuntu
  19. Очистить после обновления
  20. Живое исправление ядра в Ubuntu Server, чтобы избежать перезагрузки
  21. Обновления версий отличаются
  22. Заключение
  23. How Do I Update Ubuntu Linux Software Using Command Line?
  24. Update Ubuntu Linux Software Using Command Line
  25. Ubuntu Linux server – Install updates via apt-get command line ( option #1 )
  26. Get updated software list for Ubuntu, enter:
  27. Update software(s) i.e. apply updates and patches on Ubuntu Linux
  28. Install kernel updates on a Ubuntu LTS server
  29. To upgrade individual software called foo type command:
  30. Ubuntu Linux server – Install updates via aptitude command line ( option #2 )
  31. Apply Ubuntu server updates over ssh based command line session
  32. Using Ubuntu Update Manager GUI tool
  33. A note about the latest version of Ubuntu Linux
  34. Summing up

Команда apt в Linux

apt — это утилита командной строки для установки, обновления, удаления и иного управления пакетами deb в Ubuntu, Debian и связанных дистрибутивах Linux. Он сочетает в себе наиболее часто используемые команды из инструментов apt-get и apt-cache с различными значениями по умолчанию некоторых параметров.

apt разработан для интерактивного использования. Предпочитайте использовать apt-get и apt-cache в своих сценариях оболочки, поскольку они обратно совместимы между различными версиями и имеют больше параметров и функций.

Большинство команд apt необходимо запускать от имени пользователя с привилегиями sudo .

Это руководство служит кратким справочником по командам apt .

Обновление индекса пакета ( apt update )

Индекс пакетов APT — это в основном база данных, в которой хранятся записи о доступных пакетах из репозиториев, включенных в вашей системе.

Чтобы обновить индекс пакета, выполните команду ниже. Это приведет к получению последних изменений из репозиториев APT:

Всегда обновляйте индекс пакета перед обновлением или установкой новых пакетов.

Обновление пакетов ( apt upgrade )

Регулярное обновление вашей системы Linux — один из наиболее важных аспектов общей безопасности системы.

Чтобы обновить установленные пакеты до последних версий, выполните:

Команда не обновляет пакеты, требующие удаления установленных пакетов.

Если вы хотите обновить один пакет, передайте имя пакета:

Полное обновление ( apt full-upgrade )

Разница между upgrade и full-upgrade заключается в том, что при последующем удаляются установленные пакеты, если это необходимо для обновления всей системы.

Будьте особенно осторожны при использовании этой команды.

Установка пакетов ( apt install )

Установить пакеты так же просто, как запустить следующую команду:

Если вы хотите установить несколько пакетов с помощью одной команды, укажите их в виде списка, разделенного пробелами:

Для установки локальных файлов deb укажите полный путь к файлу. В противном случае команда попытается получить и установить пакет из репозиториев APT.

Удаление пакетов ( apt remove )

Вы также можете указать несколько пакетов, разделенных пробелами:

Команда remove удалит указанные пакеты, но при этом могут остаться некоторые файлы конфигурации. Если вы хотите удалить пакет, включая все файлы конфигурации, используйте purge вместо remove :

Удалить неиспользуемые пакеты ( apt autoremove )

Каждый раз, когда в системе устанавливается новый пакет, который зависит от других пакетов, также будут установлены зависимости пакетов. Когда пакет будет удален, зависимости останутся в системе. Эти оставшиеся пакеты больше не используются ничем и могут быть удалены.

Чтобы удалить ненужные зависимости, используйте следующую команду:

Листинг пакетов ( apt list )

Команда list позволяет вывести список доступных, установленных и обновляемых пакетов.

Чтобы вывести список всех доступных пакетов, используйте следующую команду:

Команда напечатает список всех пакетов, включая информацию о версиях и архитектуре пакета. Чтобы узнать, установлен ли конкретный пакет, вы можете отфильтровать вывод с помощью команды grep .

Чтобы вывести список только установленных пакетов, введите:

Перед фактическим обновлением пакетов может быть полезно получить список обновляемых пакетов:

Эта команда позволяет вам искать данный пакет в списке доступных пакетов:

В случае обнаружения команда вернет пакеты, имя которых соответствует поисковому запросу.

Информация о пакете ( apt show )

Информация о зависимостях пакетов, размере установки, источнике пакета и т. Д. Может быть полезна перед удалением или установкой нового пакета.

Чтобы получить информацию о данном пакете, используйте команду show :

Выводы

Умение управлять пакетами — важная часть системного администрирования Linux.

apt — это менеджер пакетов для дистрибутивов на основе Debian. Чтобы узнать больше о команде apt откройте терминал и введите man apt .

Не стесняйтесь оставлять комментарии, если у вас есть вопросы.

Источник

Как обновить Ubuntu и приложения

Из этого туториала Вы узнаете, как обновить Ubuntu для серверной и настольной версий, разницу между update и upgrade, а также некоторые другие вещи, которые вы должны знать об обновлениях в Ubuntu Linux.

Если вы новый пользователь и используете Ubuntu в течение нескольких дней или недель, вам может быть интересно, как обновить систему Ubuntu для повышения безопасности, исправления ошибок, а также обновления приложений.

Обновление Ubuntu абсолютно просто. Я не преувеличиваю. Это так же просто, как запустить две команды.

Есть два способа обновить систему Ubuntu:

  • Обновите Ubuntu через терминал
  • Обновите Ubuntu, используя графический инструмент Software Updater

Позвольте мне дать вам более подробную информацию об этом.

Обратите внимание, что руководство действительно для Ubuntu 18.10, 18.04, 16.04 или любой другой версии. Способ обновления через командную строку также подходит для дистрибутивов на основе Ubuntu, таких как Linux Mint, Linux Lite, elementary OS и подобных.

Способ 1: обновить Ubuntu через терминал

На рабочем столе откройте терминал. Вы можете найти его в меню приложений или вызвать зажатием комбинации клавиш Ctrl+Alt+T. Если вы вошли на сервер Ubuntu, у вас уже есть доступ к терминалу.

В терминале вам нужно ввести следующую команду:

sudo apt update && sudo apt upgrade -y

Примечание: все действия по осуществляются копирования или вставки команд в терминале выполняются при помощи зажатия дополнительной клавиши Shift . Таким образом, для того чтобы скопировать что либо в терминале, вам необходимо использовать сочетание клавиш Ctrl+Shift+С , а для того чтобы вставить какую либо команду в терминал, необходимо зажать сочетание клавиш Ctrl+Shift+V .

Для подтверждения, необходимо будет ввести пароль, он тот же, что и вашей учётной записи. Во время набора пароля, из соображений безопасности, на экране вы ничего не увидите, поэтому продолжайте вводить пароль и нажмите ввод – Enter. Это обновит пакеты в Ubuntu.

Теперь позвольте мне объяснить вышеупомянутую команду.

На самом деле, это не одна команда. Это комбинация из двух команд. && – это способ объединить две команды так, чтобы вторая команда выполнялась только тогда, когда предыдущая команда была выполнена успешно.

Читайте также:  Лучшие дистрибутивы linux для raspberry pi

-y в конце автоматически вводит yes , когда команда apt upgrade запрашивает подтверждение перед установкой обновлений.

Обратите внимание, что вы также можете использовать две команды отдельно, одну за другой:

sudo apt update

sudo apt upgrade

Это займет немного больше времени, потому что вам нужно дождаться завершения одной команды и затем ввести вторую команду.

Объяснение: sudo apt update

Эта команда обновляет локальную базу данных доступных пакетов. Если вы не запустите эту команду, локальная база данных не будет обновлена, и ваша система не будет знать, есть ли какие-либо новые доступные версии.

Вот почему, когда вы запустите sudo apt update , вы увидите много URL в выходных данных. Команда извлекает информацию о пакете из соответствующих репозиториев (URL-адреса, которые вы видите в выходных данных).

В конце команды сообщается, сколько пакетов можно обновить. Вы можете увидеть эти пакеты, выполнив следующую команду:

apt list —upgradable

Объяснение: sudo apt upgrade

Эта команда сопоставляет версии установленных пакетов с локальной базой данных. Она собирает их все, а затем перечисляет все пакеты, для которых доступна более новая версия. На этом этапе она спросит, хотите ли вы обновить установленные пакеты до более новой версии.

Вы можете ввести yes , у или просто нажать клавишу ввода, чтобы подтвердить установку обновлений.

Итак, суть в том, что sudo apt update проверяет наличие новых версий, в то время как sudo apt upgrade фактически выполняет обновление.

Термин update может сбивать с толку, так как вы можете ожидать, что команда sudo apt update обновит систему путем установки обновлений, но этого не происходит.

Способ 2: обновить Ubuntu через графический интерфейс [для пользователей настольных компьютеров]

Если вы используете Ubuntu в качестве рабочего стола, вам не нужно заходить в терминал только для обновления системы. Вы все еще можете использовать командную строку, но это не обязательно для вас.

В меню приложений найдите «Software Updater» (рус. Обновление приложений) и запустите его. Учтите, значок приложения может быть иным, ориентируйтесь лиши на название.

Он проверит наличие обновлений для вашей системы.

Если есть доступные обновления, это даст вам возможность установить обновления.

Нажмите «Установить сейчас», он может запросить ваш пароль.

Как только вы введете свой пароль, он начнет устанавливать обновления.

В некоторых случаях, вам может потребоваться перезагрузить систему Ubuntu, для правильной работы установленных обновлений. В конце обновления вы будете уведомлены, если вам потребуется перезагрузить систему.

Вы можете перезагрузить компьютер позже, если не хотите делать этого сейчас. При этом, работу можно будет продолжить без каких либо потерь.

Совет: если программа обновления программного обеспечения выдаёт ошибку, вы должны использовать команду sudo apt update в терминале. Последние несколько строк вывода будут содержать фактическое сообщение об ошибке. Вы можете найти эту ошибку в интернете и устранить проблему.

Несколько вещей, которые нужно иметь в виду, обновляя Ubuntu

Вы только что узнали, как обновить вашу систему Ubuntu. Если вы заинтересованы, вы также должны знать эти несколько вещей, касающихся обновлений Ubuntu.

Очистить после обновления

В вашей системе будет несколько ненужных пакетов, которые не потребуются после обновлений. Вы можете удалить такие пакеты и освободить место с помощью этой команды:

sudo apt autoremove

Живое исправление ядра в Ubuntu Server, чтобы избежать перезагрузки

В случае обновления ядра Linux, вам придется перезагрузить систему после обновления. Это проблема, когда вы не хотите простоев вашего сервера.

Функция Live Patching позволяет вносить исправления в ядро ​​Linux, пока оно еще работает. Другими словами, вам не нужно перезагружать вашу систему.

Обновления версий отличаются

Обсуждаемые здесь обновления предназначены для того, чтобы ваша система Ubuntu была свежей и обновленной. Но они не охватывают обновления версий (например, обновление с Ubuntu 18.10 до Ubuntu 19.04).

Обновления версии Ubuntu – это совсем другое. Оно обновляет все ядро ​​операционной системы. Вы должны сделать правильные резервные копии перед началом этого длительного процесса.

Заключение

Надеюсь, вам понравился этот урок по обновлению системы Ubuntu, и вы узнали несколько новых вещей.

Если у вас есть какие-либо вопросы, пожалуйста, задавайте их комментариях. Если вы опытный пользователь Linux и у вас есть совет, который может сделать это руководство более полезным, поделитесь им с остальными.

Источник

How Do I Update Ubuntu Linux Software Using Command Line?

I have latest version of Ubuntu Linux LTS server. How do I update Ubuntu Linux for security and application fix/upgrades using ssh command line? How can I install updates via command line option?

Ubuntu Linux can be upgraded using GUI tools or using traditional command line tools such as:

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Ubuntu Linux
Est. reading time 3 minutes
  1. apt-get or apt command – apt-get command or apt command is the command-line tool for handling packages.
  2. aptitude command – aptitude is a text-based interface to the Debian GNU/Linux package system including Ubuntu Linux.

Update Ubuntu Linux Software Using Command Line

Let us see all commands and options in details.

Ubuntu Linux server – Install updates via apt-get command line ( option #1 )

The commands are as follows:

  1. apt-get update : Update is used to resynchronize the package index files from their sources on Ubuntu Linux via the Internet.
  2. apt-get upgrade : Upgrade is used to install the newest versions of all packages currently installed on the Ubuntu system.
  3. sudo apt-get install package-name : Install is followed by one or more packages desired for installation. If package is already installed it will try to update to latest version.

First, open the Terminal application and type following two commands (Application > Accessories > Terminal and then type the commands as the root user).

Get updated software list for Ubuntu, enter:

Update software(s) i.e. apply updates and patches on Ubuntu Linux

Type the following apt-get command:
$ sudo apt-get upgrade
OR
$ sudo apt upgrade

Installing updates on Ubuntu Linux system

Install kernel updates on a Ubuntu LTS server

Type the following apt-get command:
$ sudo apt-get dist-upgrade
If a new kernel installed, reboot the Linux server:
$ sudo reboot

To upgrade individual software called foo type command:

$ sudo apt-get install foo
OR
$ sudo apt-get install apache php5 mysql-server

Ubuntu Linux server – Install updates via aptitude command line ( option #2 )

The syntax is as follows to Update the packages list:
$ sudo aptitude update
To actually upgrade the packages, type:
$ sudo aptitude safe-upgrade

Apply Ubuntu server updates over ssh based command line session

First, login to the remote Ubuntu server using ssh client:
$ ssh user@server-name-here
$ ssh vivek@server1.cyberciti.biz
Once your log into your server, run the following two commands:
$ sudo apt-get update
$ sudo apt-get upgrade
OR
$ sudo aptitude update
$ sudo aptitude safe-upgrade
OR
$ sudo apt-get update
$ sudo apt-get dist-upgrade
From the apt-get(8) page:

The dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a “smart” conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. So, dist-upgrade command may remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files.

Using Ubuntu Update Manager GUI tool

Ubuntu Update Manage the GUI tool. It works like Microsoft or Red Hat update manager i.e. you will see a little icon in the kicker bar/taskbar when there are updates. It will only appear when new upgrades are available. All you have to do is click on it and follow the online instructions. You can also start the GUI tool by Clicking System > Administration > Update Manager

A note about the latest version of Ubuntu Linux

Press the Superkey (Windows key) > Type updater:

Fig.01: Ubuntu Launch the Software Updater

Fig.02: Installing updates on a Ubuntu Linux

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

Summing up

Keeping your system kernel and apps is an essential task for all developers and sysadmin. A patched system prevents security issues and increases system stability. It is also possible to automatically download and apply all critical security updates. See

Both apt and apt-get commands have many options. Hence, read the man page:
man apt
man apt-get

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Category List of Unix and Linux commands
Documentation help • mandb • man • pinfo
Disk space analyzers df • duf • ncdu • pydf
File Management cat • cp • less • mkdir • more • tree
Firewall Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04
Linux Desktop Apps Skype • Spotify • VLC 3
Modern utilities bat • exa
Network Utilities NetHogs • dig • host • ip • nmap
OpenVPN CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04
Package Manager apk • apt
Processes Management bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop
Searching ag • grep • whereis • which
Shell builtins compgen • echo • printf
Text processing cut • rev
User Information groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w
WireGuard VPN Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04

Comments on this entry are closed.

up date Ubuntu6.06 i have Ubuntu6.10isofile

I installed ubuntu sofware in my laptop but I can changed the display of monitor (the evolution of screen is only 1240×768). I want to change it into 1240×800 to fit with the widescreen. So what do I do to change it.
I want to have vietnamese font in ubunto? please let me know the way to get it!
thank you very much!

may i know ur processor plz

I installed the ubuntu 7.10 versiyon.At the beginning ı can not connect the internet then find a way and mozilla can connect the web.But there is a problem about updates ı have not a web connection for doing updates.no problem about modem no problem about networking and mozilla work good but other application like pidgin and updates do not connect web.What can ı do?

Try updating your software sources. Go to linux ubuntu website and search for software sources. I had this problem similar to this with my Pidgen. I had to change the server addresses for my Yahoo chat to work. But you go to System>Administration>Software Sources. Hope This Helps You….

I cannot update my Feisty 7.04 and don’t have GUI on the server!
How can I do any updates at all?
apt-get update returns a lot of errors but downloads some things? I do not know what or where?
and apt-get install update does Not work and gives me E: error !
I know now that ubuntu has abandoned the 7.04 version and has changed the link/ulr so the server cant find the files it needs (to download). but when I try to put a correct link in my sources.list file the errors continue!?
Does anyone know how to Manually install the updates.
Now if Microsoft had change the URL, we would never hear the end of it, that is only fair not to mess with the configuration files on a fairly new operating system (feisty 7.04 is not that old at all, compared to NT is a new born baby)!
I am new in linux and really like some of the features but it sucks when you have to spend all your time on a dumb little simple matter as to an update,

Working Ubuntu server from the command-line, this help was very useful.

I the speed of updating is so slowly,what should i do to update faster?

yes…..it was last updated for 113 days ago….fuck the update manager……check,check,check

if you update your network settings and if you are getting IP address from DHCP you can run dhclient eth0 (or whatever NIC) and update the net info.
this will improve your speed.

Hello,
I installed ubuntu linux 9.0 on my computer how can i install a program i bought from the store or add a new graphics card. I have been trying to put new programs on my computer but the disc always comes up as a file and doesn’t autorun the program for installation. need much help thank you

If you are in the Graphical mode (GUI) then you can browse the cdrom to see what program is executable (usually install.sh or similar program).
If the CD is a linux program then a shortcut (link) to it will appear on your desktop.

If you are in the command line;
There are usually a link (or shortcut) to the CDROM in the root of your drive, if there isnt then you have to cd /media then cd cdrom .
if you have the rights (login as root or type su ) then you can cd /cdrom
(after you load the cd in the drive) then you can do an ls to see any install.sh program or README file to tell you how to install that program.

Great stuff, but can you upgrade just a single package eg. phpmyadmin only?

Very good if you have a working system! But mine is not working so I can’t up date cos my upgrade is not completed until the desktop is updated and running.

So do I just re-load again or have I misses some thing?

How can you install a windows program on ubuntu?

firstly you must install wine. after you can install windows program together wine.

I am not an expert in Linux but I think you have to use the fdisk program in linux to create an NTFS or FAT32 partition so you can install Windows on it.
fdisk in command prompt is easy to use really,
you can do an fdisk -l (L) to see what is available then do fdisk /dev/sda1 or whatever
press m for help. then l to see the list of partitions. (i.e 8e for LVM or virtual drives in Linux)…

OR if you already have an unused partition (empty) you can install Windows on it.
but take extra care not to format the linux partition.

IF your Linux system does not come up correctly you can type fsck to fix it.

There may be a suitable alternative to your Windows program, depending on what it is. There are lots of choices as far as open source software goes, you might get lucky.

You might also be able to use Wine, a Windows Emulator to install and run your Windows program, again, depending on what program it is.

Hello all….
It’s been great with the Karmic. I’m using it almost anywhere. And it does work like charm after install.. And right now i’m learning the command so i can setup my own server box. Mehdi, you are a great guy, always trying to help others… So i want to add a bit on what mehdi talk about.
If u want to run a windows program install WINE and then you can run a lot of windows program(not all.. go to winehq and read the list)
I can run my warcraft & Counter Strike that reside on my NTFS(windows) partition just like that. WINE is really a great program.
2. U don’t need fdisk all the way to manage a partition. Use gParted instead. Shrink the partition. make a new empty partition and boot up the windows cd and install windows. then configure the GRUB loader to boot your windows as well.
3. Always make time to read some tutorial and browse the forum. It will help you greatly. And try to always use the terminal to make you more understand linux (although ubuntu have done a well done job on the GUI side)

after installing packages how can i see the list of the packages or files that were just install? I am talking use terminal commands?

I HAVE problem to activate ubuntu 10.6 in my compture.

I’ve faced a problem in using ubuntu to update softweres of midia player ,video player,to running & to compile fortran programming language & more help me

I am very new to ubuntu linux, I was wondering, if I have Ubuntu and I want to upgrade it to the next version, will the drivers (and etc), get updated (or at least stay there) as well? Or do I need to install one and each of them again manually?

I am new and still learning but here’s what I know:
If you have a computer which is running Windows then I suggest to use the Wubi which is a small file but installs the latest version of Ubuntu for you (without making changes in your file allocation table or boot sector and you will Not lose any of your Windows files, and it defaults into Windows with Ubuntu as 2nd choice).
As for the updates and upgrades Ubuntu has a program which comes up automatically and asks you to verify username/password and then it updates it regularly (You can turn that option off or set it in longer intervals), Otherwise you can do it in terminal by sudo apt-get updates or upgrade.
I had a bit of problem with the Auto Updates (In GUI) with version 10.x, I have not had any trouble with (the auto-updates) in this new (11.x ) version so far and I have been using it for few weeks now.
In the last version it would totally freeze the computer and the last time it froze I lost everything (of course it was a learning machine and I didnt rely on it for anything) But then other people told me they had same problem (in version 10.x).
So to be on the safe side, try to use the command line for updates and upgrades.

Also I think with updates you update the lib. files and some drivers but with upgrade you upgrade the kernel file?!
good luck.

I am having troubles updating my 7.04 Feisty. I am trying to update to 11.04, but am not successful. I have the CD for it, and every time i run it, it takes forever, and doesnt seem to do anything. After a while, at the bottom, a few numbers and file names appear. it counts up from 1, and just keeps going up every second. It reached 8500 until i turned it off. Why will 11.04 get installed?

I used to have the same problem with updating, it was my hardware I think , I used different method of installation (used all the different options) but nothing worked.
Have you taken different options to see if it works? Do you have enough Hard Drive space left for an update?
Anyway now I do a partition-less install using Wubi but that is an exe file and only works in Windows. If they have something like Wubi for Linux, it would be excellent cuz it works great. (May be you can use Wine to run Wubi inside Ubuntu)? it is a 1.4 meg file but it picks up the latest version of Ubuntu for you and installs it.
good luck.

I did a mistake when I was running some programs. By mistake I pressed the update button on the software update page. Immediately I pressed the cancel button to cancel the update installation. But I didn’t able to cancel it. Then I pressed the shut down button immediately. After that when I started the computer, I didn’t able to open the computer anymore. it shows some spectral line on the screne.

Please give me some suggestion. Thank you.

It’s writing command not found on my machine.

Источник

Читайте также:  Восстановление рабочего стола windows 10 после восстановления системы
Оцените статью