Linux makes it easy to track software on servers and workstations. Package management has been part of Linux since very early in the operating system's life, and the toolset has been perfected over the decades. There's no reason that even a total system rebuild should require more than one quick Ansible playbook or shell script to return to its previous state.
Even though Linux has robust package management, new software for Linux is released all the time, and not all of it is integrated with the system's package manager. However, it doesn't take much beyond a little organization and consistency to ensure that even application outliers are well-accounted for.
[ Take a Linux infrastructure planning assessment. ]
Here are the five tactics I use to track applications installed on my fleet.
1. List packages with RPM
Do the easy one first. Red Hat Enterprise Linux (RHEL), CentOS, Fedora, and several others catalog all supported software as RPM packages, and the dnf command is usually the best interface to that manifest.
However, you can get a dump of all installed packages with just the rpm command:
$ rpm --query --all
publicsuffix-list-dafsa-20190417-4.noarch
ncurses-base-6.2-3.20200222.noarch
libssh-config-0.9.5-1.noarch
kbd-misc-2.3.0-2.noarch
[...]
That's a lot of information, and it's specific to the versions of packages installed on a system you might be planning to upgrade. I find its output even more useful when I look at the full package information coupled with a simple awk command to extract just the package name:
$ rpm --query --all --info | \
awk --field-separator ': ' '/^Name/ {print $2;}'
publicsuffix-list-dafsa
ncurses-base
libssh-config
kbd-misc
[...]
The advantage of getting a package name without the version is that you can pipe the whole list into dnf on an upgraded system, and dnf doesn't fail due to mismatched version numbers.
2. Flatpakrefs
The Flatpak system makes it trivial for even non-administrative users to install applications on workstations safely. It also makes it trivial to report what's installed:
$ flatpak list --app --columns=application | head -n-1
im.element.Element
io.github.Cockatrice.cockatrice
net.scribus.Scribus
org.audacityteam.Audacity
org.inkscape.Inkscape
org.kde.kdenlive
org.kde.krita
org.signal.Signal
org.synfig.SynfigStudio
[...]
This reports only on applications installed as Flatpaks, not runtimes. Installing an application as a Flatpak also installs its required runtime, so I don't bother to report installed runtimes.
Flatpaks are usually installed in the user environment, but with root privileges, they can also be installed on the system. If you're auditing what's been installed, keep that in mind.
Finally, Flatpaks might not all come from the same repository. When in doubt, you can see what Flatpak remotes were added to a system with the flatpak remotes command.
3. Outliers
Some vendors provide software for Linux as plain old tarballs, self-extracting scripts with embedded "install wizards" that unarchive the software's components to your chosen system location. Whether you use /usr/local or /opt or some other location, make sure to set a strict standard within your organization for the outlier location.
These outlier applications are the hardest to track, and it takes discipline. You must define a process for installing to /opt (or whatever place you use), and part of that process must be keeping a log. In my experience, many of the applications I end up installing to /opt are also applications that require a license, so I keep a copy of the tarball or installer in a central directory along with the licensing information. (But don't let that create a loophole where applications installed to /opt without licenses are never logged.)
4. SDKMAN and Maven and Pip and Node and Cargo
Many popular languages have package managers of their own. Luckily, these tend to restrict themselves to a user's environment. The best way to deal with language-specific package managers is for developers to actually use them. These tools are designed to be all the big words: programmatic, ephemeral, and idempotent.
Reinforce with your developers that their environments are meant to be easy to replicate. As long as their code is pushed to the organization's version control system, it should be self-migratory.
5. The stuff you almost forgot
I'm a testament to just how customized a home directory can become. There are scripts I've written and thrown into my personal ~/bin directory that I've sometimes forgotten weren't just default Linux commands. It can be genuinely difficult to separate actual Linux from your Linux, and that's one reason why people use Linux. You want it to be yours, and an organization often needs Linux to be uniquely crafted for its needs.
The key is to keep track of what's yours.
At some point, that useful script everyone's shared around the office isn't just a useful script; it's a product of the organization. Encourage its maintainer to give it a version number, commit it to Git, and package it up so it can be included in the upgrade process.
[ Learn best practices for implementing automation across your organization. Download The automation architect's handbook. ]
Be aware
Tracking applications in your organization is often a matter of being aware of what's being used, whether it's an officially supported package or something surprisingly useful that an intern drummed up while accidentally learning Python one day. And knowing the right tools to get complete reports about applications on your systems is vital to any upgrade, recovery, or architectural planning.
저자 소개
Seth Kenlon is a Linux geek, open source enthusiast, free culture advocate, and tabletop gamer. Between gigs in the film industry and the tech industry (not necessarily exclusive of one another), he likes to design games and hack on code (also not necessarily exclusive of one another).
유사한 검색 결과
More than meets the eye: Behind the scenes of Red Hat Enterprise Linux 10 (Part 4)
Beyond modularity and other upgrades: The game-changer for your IT planning
Why Should You Write Technical Documentation? | Compiler
The Developer Advocate And The Exchange | Compiler: Re:Role
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
가상화
온프레미스와 클라우드 환경에서 워크로드를 유연하게 운영하기 위한 엔터프라이즈 가상화의 미래